depops
Deploy to any VPS from your own machine over SSH, with zero server details in plain text.
Everything (IP, port, user, SSH key, sudo password, registry login, server folders, steps, .env files)
is stored in a single encrypted file, .depops.vault, that you commit to the repo. Clone on any computer,
type the master password, deploy.
npx depops init # one time: server + projects + master password
git add .depops.vault && git commit -m "Add deploy vault"
# any computer, any time
npx depops deploy # deploy every project
npx depops deploy backend # deploy one project
npx depops deploy backend admin # deploy several
Works on macOS, Linux and Windows (pure JavaScript SSH, no ssh/sshpass/expect needed).
How it works (recommended Docker flow)
- Build here: every service in your compose file that has
build: + image: is built with
docker buildx and pushed to your registry.
- Server gets only two files:
docker-compose.yml (with build: removed) and .env (chmod 600).
No source code ever lands on the server.
- Server pulls and restarts:
docker compose pull && docker compose up -d --no-build.
On first setup, init creates the server folders and copies docker-compose.yml + .env there.
One project or many
init scans the repo (root and up to two folder levels, e.g. backend/, apps/web/) for
docker-compose.yml / compose.yaml. Every folder with its own compose file becomes a project:
repo/
├─ backend/ docker-compose.yml, .env → project "backend" → /var/www/backend
├─ frontend/ docker-compose.yml, .env → project "frontend" → /var/www/frontend
├─ admin/ docker-compose.yml, .env → project "admin" → /var/www/admin
└─ worker/ docker-compose.yml → project "worker" → /var/www/worker
Names and server folders default to the folder name and can be changed. A single project with a compose
file in the repo root works the same way. Projects without Docker can be added by hand.
depops deploy builds all selected projects first; if any build fails, no server is touched.
Compose file requirements
-
Every service with build: needs an image: (e.g. image: youruser/backend:latest), otherwise the
server cannot pull it. init/deploy tell you if one is missing.
-
Use env_file: .env (the server only gets .env).
-
Build-time variables (e.g. NEXT_PUBLIC_*) go in build.args; their values come from the project's
vault env:
build:
context: .
args:
- NEXT_PUBLIC_API_URL
Open a terminal on the server
depops enter backend # logs in and opens the backend server folder (alias: depops ssh)
depops enter # pick a project, or the home folder
No server password to type — only the vault password (or none while unlocked). Type exit to come back.
Unlock for a while (scripts and assistants)
depops unlock --for=30m # default 30m, max 12h
depops lock # end it now
While unlocked, every depops command in this project works without a password prompt, including when a
script or a coding assistant runs it for you, for example to investigate and fix a problem:
depops run "docker compose ps" --target=backend
depops run "docker compose logs --tail 200" --target=backend
depops deploy backend
The master password and server credentials are never printed or handed out as text. The session is held by
a small background process that only your OS user can reach (private socket + random token), like
ssh-agent. Without a session, non-interactive commands stop with "Vault is locked" instead of hanging.
Other deploy types
| Type |
What happens |
| Docker – build on server |
git pull → docker compose up -d --build |
| Node.js + PM2 |
git pull → npm ci → npm run build → pm2 startOrReload |
| Static site |
local build → upload folder (e.g. dist) |
| Custom |
your own local + server commands (Python, PHP, Go, systemd, …) |
All steps are editable later with depops edit.
Commands
depops init create the vault
depops deploy [name…] [--skip-local] [--skip-remote]
depops enter [name] terminal on the server (alias: ssh)
depops unlock [--for=30m] / lock password-free session for scripts and assistants
depops forget remove the master password saved in .env
depops test check SSH + sudo
depops run "<cmd>" [--target=name] [--no-sudo]
depops edit add/remove projects, steps, server, sudo, registry
depops env list|set KEY|rm KEY|import [file] [--target=name]
depops show [--reveal] summary (server details hidden unless --reveal)
depops passwd change master password
depops update update to the newest version
Master password
- On
init / passwd choose Generate (recommended: 32 random characters, ~205 bits, shown once —
save it in your password manager) or type your own (12+ characters with strength checks).
- Not asked every time: depops reads
DEPOPS_PASSWORD from the environment or from the project's
.env. If it isn't there, depops asks once and offers to save it to .env:
- only if
.env is not committed to git (otherwise it refuses and tells you how to fix it),
.env is added to .gitignore if needed and set to chmod 600,
depops passwd updates it, a wrong value is replaced after you type the right one,
depops forget removes it.
DEPOPS_PASSWORD is never imported into a project's env, so it never reaches the server.
Keeping the password in .env is convenient but means anyone who can read that file on your computer can
deploy. Use depops forget on shared machines.
Login options
- Password → auto SSH key (recommended): logs in once with the password, creates an ed25519 key,
installs it on the server, and stores only the key.
- Generate a new key, add the public key to the server yourself (e.g. VPS provider panel)
- Existing private key file (with or without passphrase)
- Password only
- SSH agent (key never leaves this computer, so not portable)
Every option is verified by actually connecting; on failure you can retry or change the details.
Docker registry login
For Docker projects, init asks for registry credentials (Docker Hub, ghcr.io or any other registry).
Use an access token instead of your account password. The login is verified on this computer and on the
server. During deploy the server logs in, pulls, and logs out again, so credentials don't stay on the server.
Security
- Encryption: scrypt (N=2^17, r=8, p=1, 128 MiB per guess) → AES-256-GCM. The header is authenticated,
so any change to the file is detected. Node built-in crypto only.
- Master password is never stored; minimum 12 characters with strength checks.
- Lockout: after 3 wrong passwords on a computer, unlocking is blocked for 30s, then 1m, 2m, … up to 1h.
Offline guessing against a copied vault file is what scrypt + a strong password protect against; a
"self-destruct" counter could not stop that (the attacker never runs depops), so the vault is never deleted.
- Host key pinning: the server fingerprint is confirmed on first connect and stored in the vault.
A changed key aborts the deploy (man-in-the-middle protection).
- No secrets on command lines: the sudo password is passed via stdin and the deploy script goes to a
0600 temp file that is always deleted. Commands cannot read the sudo password from stdin.
- No server details in output: host, user, port and server folders are not printed; errors are scrubbed.
.env on the server is chmod 600.
init warns if other project files contain your server address or passwords in plain text.
The vault is only as strong as the master password. Use a long, unique one and share it through a
password manager. Anyone with the repo and the password can deploy.
Updates
depops checks npm for a new version at most every 12 hours (1.5s timeout, never blocks when offline):
- npx: runs the newest version automatically.
- Global install (
npm i -g depops): updates itself, then re-runs your command.
- Project install (
node_modules): shows the update command, never edits your package.json.
depops update updates on demand; depops --version shows the installed version.
Turn it off with --no-update or DEPOPS_NO_UPDATE=1. It is always off in CI.
Requirements
- Node.js 18.17+
- Docker with buildx on your computer (for the Docker flow)
- Server: Linux with
bash and Docker (and sudo if you enable it)
License
MIT