vps-deploy
Skill1 starsChanged 2 days agoMITView on GitHub
Deploy a Next.js App Router site, a Next.js dashboard and a NestJS API with its database (Postgres, MySQL or SQLite) to one Ubuntu VPS with Docker Compose and Caddy for automatic HTTPS, over SSH, one approved step at a time, with nightly database backups to S3-compatible storage and a restore test. Use when the user asks to deploy, self-host or move such a project to a VPS or their own server.
- Reads credentials
- Deletes or force-pushes
4 other projects use a version of this.
Adopted by
Most recently taken up by
- Edzard9/stashtheir own version, first seen Nov 16, 2026
- shahinrehimov/claude-skillstheir own version, first seen Nov 16, 2026
- sifenfisaha/vps-deploytheir own version, first seen Oct 22, 2026
- braincandy-parallel/tamarindos-workflow-kittheir own version, first seen Sep 18, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- sifenfisaha/vps-deploy★ 1same name
- braincandy-parallel/tamarindos-workflow-kit★ 0same name
- Edzard9/stash★ 0same name
- shahinrehimov/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- add-admin-dashboardSkill
- app-screenshotsSkill
- design-rulesSkill
- docs-checkSkill
- i18n-keys-checkSkill
- nextjs-claude-mdSkill
- nextjs-hooksSkill
- production-checkSkill
- rtl-checkSkill
- template-rebrandSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 1 is distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Never a loop that reconnects to poll.
- Very specific: line 34
Check: 0 FAIL. Note each app's port and NEXT_PUBLIC_ variables, the API's health route, the database, its one-time schema command, and the …
- Very specific: line 41
Check: dig +short <domain> prints IP for each one.
- Very specific: line 47
Check: ufw status verbose lists only 22, 80 and 443, and step 4's check still passes.
- Very specific: line 55
Check: ssh -o BatchMode=yes -o PubkeyAuthentication=no HOST true ends in Permission denied (publickey) with no password listed, root@IP is …
- Very specific: line 62
Check: ssh HOST 'sh -s -- ROOT' < ${CLAUDE_SKILL_DIR}/scripts/server-check.sh has no FAIL in the settings lines.
- Very specific: line 64
Ship and start: Ask the user to commit first: git status --porcelain must be empty.
- Very specific: line 69
Check: the server prints the same commit as git rev-parse --short HEAD, --wait exits 0, and server-check shows every service running and …
- Very specific: line 72
Check: 0 failed: ports 22, 80, 443 open and the rest closed, HTTP redirects to HTTPS, each site answers, each certificate is valid.
- Very specific: line 76
Run ROOT/ops/db-backup.sh ROOT/env/backup.env once, then add the two cron lines from reference.md.
- Very specific: line 78
Check: the run prints OK for the dump and copied to the remote.
- Very specific: line 80
Check: the last line starts with PASS and every table is ok.
- Distinctive: line 84
Check: step 10's probe passes and the server prints the new commit.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy to one VPS with Docker Compose and Caddy
Work in the numbered steps below. Each step ends with a check; run it, show the result, and stop at the first check that fails. Report what failed and wait for the user.
Safety rules
- One SSH connection per step: a single
ssh HOST '...', orssh HOST 'sh -s' < script. Never a loop that reconnects to poll. Withufw limit 22/tcp, an address that opens 6 connections in 30 seconds is refused. - No secret passes through the chat. Generate secrets on the server, straight into the
file. Third-party keys are typed by the user into the file in their own SSH session. Print
setting names, never values, and never
catan env file. - Ask before anything destructive and say what it deletes:
docker compose down -v,docker volume rm,DROP DATABASE(other thanrestore_check),rm -rfoutside a temp folder, overwriting an env file, a ufw change that could cut off SSH, any script that resets or drops data. - Only Caddy publishes ports (80 and 443). Docker-published ports skip ufw.
- Only committed code goes to the server (
git archive HEAD). Local.envfiles never do.
Names used below: IP 203.0.113.10, HOST deploy@IP, ROOT /srv/shop, and
DC = cd ROOT/app/deploy && RELEASE=$(cat ../RELEASE) docker compose --env-file ROOT/env/compose.env.
Steps
- Read the project.
node ${CLAUDE_SKILL_DIR}/scripts/preflight.mjs .Check: 0 FAIL. Note each app's port andNEXT_PUBLIC_variables, the API's health route, the database, its one-time schema command, and the scripts the report says delete data. - Write the deploy files from reference.md:
deploy/compose.yml,deploy/caddy/Caddyfile,deploy/env.example/*.env, and the.gitignorelines. Commit them. Check:ENV_DIR=$PWD/deploy/env.example node ${CLAUDE_SKILL_DIR}/scripts/preflight.mjs . --compose deploy/compose.yml --env-file deploy/env.example/compose.envreports the compose file valid and 0 FAIL. - DNS. The user points an A record for every domain at
IPnow, so it resolves by step 10. Check:dig +short <domain>printsIPfor each one. - SSH user with a key (as
root@IP, Ubuntu 24.04 or 26.04): createdeploywith no password, copy root'sauthorized_keysto it, createROOTand/srv/backupsowned by it. Check:ssh -o BatchMode=yes HOST trueexits 0. - Firewall (as root):
ufw default deny incoming,ufw default allow outgoing,ufw limit 22/tcp,ufw allow 80/tcp,ufw allow 443, thenufw --force enable. Check:ufw status verboselists only 22, 80 and 443, and step 4's check still passes. - Docker (as root): Docker's apt repository for Ubuntu (fetch
docs.docker.com/engine/install/ubuntu; not the convenience script), then
usermod -aG docker deploy. Check:ssh HOST 'docker version --format "{{.Server.Version}}" && docker compose version'. - Close root and password logins (last root step):
/etc/ssh/sshd_config.d/10-hardening.confwithPermitRootLogin no,PasswordAuthentication no,KbdInteractiveAuthentication no;sshd -t && systemctl restart ssh(open sessions stay connected). Check:ssh -o BatchMode=yes -o PubkeyAuthentication=no HOST trueends inPermission denied (publickey)with nopasswordlisted,root@IPis refused, and step 4's check passes. - Settings on the server. Copy
deploy/env.example/*.envtoROOT/env(folder 700, files 600) with onetar | ssh. Fill generated secrets in place, for examplesed -i "s/^JWT_SECRET=.*/JWT_SECRET=$(openssl rand -hex 48)/" api.env, with the same generated database password in both files. The user adds third-party keys themselves. Check:ssh HOST 'sh -s -- ROOT' < ${CLAUDE_SKILL_DIR}/scripts/server-check.shhas no FAIL in the settings lines. - Ship and start. Ask the user to commit first:
git status --porcelainmust be empty.git archive HEAD | ssh HOST '...'into a temp folder on the server, write the short commit toRELEASE, thenrsync -a --deleteit intoROOT/app. Then, in one connection:DC build,DC up -d --wait db, the schema command once withDC run --rm api ...,DC up -d --wait. Check: the server prints the same commit asgit rev-parse --short HEAD,--waitexits 0, and server-check shows every service running and healthy. - HTTPS from outside.
node ${CLAUDE_SKILL_DIR}/scripts/probe.mjs IP <every domain> --health https://<api domain>/<health route>Check:0 failed: ports 22, 80, 443 open and the rest closed, HTTP redirects to HTTPS, each site answers, each certificate is valid. - Nightly backup. Copy
db-backup.sh,restore-check.shandserver-check.shtoROOT/opswith onetar | ssh. The user fills the bucket keys inROOT/env/backup.env. RunROOT/ops/db-backup.sh ROOT/env/backup.envonce, then add the two cron lines from reference.md. Check: the run printsOKfor the dump andcopied tothe remote;crontab -lshows both lines. - Restore test.
ssh HOST 'ROOT/ops/restore-check.sh ROOT/env/backup.env'Check: the last line starts withPASSand every table isok. - Every later deploy: step 9's ship, then
DC build && DC up -d --wait, thenDC exec -T -w /etc/caddy caddy caddy reload --config /etc/caddy/Caddyfileif the Caddyfile changed. Roll back withRELEASE=<old commit>andup -d --wait --no-build. Check: step 10's probe passes and the server prints the new commit.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

