agentsclimarketplace

Ssh docker remote config management

Skill aksheyw/claude-code-learned-skills/skills/ssh-docker-remote-config-management

12 Claude Code skills auto-extracted from real sessions: Docker/SSH/VPS ops, data/ML pipeline gotchas, 4 model prompting field guides, a 10-category bug audit, and a persistent project wiki (llm-wiki) with slash commands.

Install
npx -y skills add aksheyw/claude-code-learned-skills --skill ssh-docker-remote-config-management

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Reliable pattern for editing JSON config files in Docker containers on a remote VPS via SSH — avoids the triple-nested-quoting nightmare (SSH → docker exec → jq) using a pipe-and-copy approach. Includes hot-reload tricks (SIGUSR1) and gotchas around `docker cp` direction and `restart` vs `down/up`.

SKILL.md

2.9 KB, 653 tokens by cl100k_base, as published. Nobody here has run it

SSH + Docker Remote Config Management

Context: Managing Docker container configs on a remote VPS via SSH, especially when dealing with JSON config files and nested quoting

Problem

Editing JSON config files inside Docker containers on remote VPS via SSH involves triple-nested quoting (SSH → Docker exec → jq/shell) that frequently breaks. Direct docker exec ... jq commands via SSH produce quoting nightmares.

Solution: Pipe-and-Copy Pattern

Instead of fighting nested quoting, use this reliable pattern:

Read config (safe):

ssh user@host "docker exec <container> cat /path/config.json | jq '.some.field'"

Write config (safe — avoids nested quoting):

# 1. Pull config to host
ssh user@host "docker exec <container> cat /path/config.json > /tmp/config.json"

# 2. Modify on host with jq (single level of quoting)
ssh user@host "cat /tmp/config.json | jq '.field = \"value\"' > /tmp/config-new.json"

# 3. Copy back into container
ssh user@host "docker cp /tmp/config-new.json <container>:/path/config.json"

# 4. Hot reload (no restart needed)
ssh user@host "docker exec <container> kill -USR1 1"

For volume-mounted configs (even simpler):

# Edit directly on host — it's the same file the container sees
ssh user@host "cat /root/.appdir/config.json | jq '.field = \"value\"' > /tmp/new.json && mv /tmp/new.json /root/.appdir/config.json"

# Hot reload
ssh user@host "docker exec <container> kill -USR1 1"

Key Gotchas

  1. docker compose restart vs down/up:

    • restart = same container, reloads process. Env vars already in container work.
    • down && up = destroys and recreates container. Needed for NEW env vars from .env file.
  2. SIGUSR1 hot reload:

    • Many Node.js apps (MyApp, PM2, etc.) support kill -USR1 for config reload
    • Avoids the 5+ minute npm install cycle on full restart
    • Send to PID 1 or the actual gateway process
  3. docker cp direction matters:

    • docker cp container:/path/. /host/path/ — note the . to copy CONTENTS not nested dir
    • Without the .: /host/path/ gets /host/path/path/ (nested!)
  4. Finding where config actually lives:

    # Recursive search for a field name
    docker exec <container> cat /path/config.json | jq '.. | objects | select(has("fieldName"))'
    

When to Use

  • Managing Docker containers on remote VPS via SSH
  • Editing JSON configs inside containers
  • Avoiding quoting issues with SSH + Docker + jq
  • Hot-reloading config without full container restart

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,970. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.