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.
npx -y skills add aksheyw/claude-code-learned-skills --skill ssh-docker-remote-config-managementAssembled 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
-
docker compose restartvsdown/up:restart= same container, reloads process. Env vars already in container work.down && up= destroys and recreates container. Needed for NEW env vars from.envfile.
-
SIGUSR1 hot reload:
- Many Node.js apps (MyApp, PM2, etc.) support
kill -USR1for config reload - Avoids the 5+ minute npm install cycle on full restart
- Send to PID 1 or the actual gateway process
- Many Node.js apps (MyApp, PM2, etc.) support
-
docker cpdirection matters:docker cp container:/path/. /host/path/— note the.to copy CONTENTS not nested dir- Without the
.:/host/path/gets/host/path/path/(nested!)
-
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.