← Docs

Using dotMage on your own

dotMage keeps your .env files encrypted on a server you run and syncs them to the machines you use. The server stores only ciphertext; you unlock your copy with a master password that stays on your machine.

Deploy a server

You need a small server — your own machine, a home box, or a cheap VPS. One command installs it via Docker:

$ curl -fsSL https://raw.githubusercontent.com/dotMage/server/main/install.sh | bash

It prints a bootstrap secret (save it — you need it to create the account and add devices) and the server URL. Details and production notes: Deploy server.

1. Authenticate (once per machine)

$ dmage auth --server https://your-server
  # enter your master password — your key is unwrapped locally

2. Put an app under dotMage

From a directory that has a .env:

$ dmage init myapp

3. Day to day

sync decides for you: it pulls when the server is ahead, pushes when you have local changes, and shows a diff when both changed.

$ dmage sync
  # or be explicit:
$ dmage pull myapp
$ dmage push myapp

4. Run without writing secrets to disk

$ dmage exec myapp -- npm run dev

Secrets are passed to the process through its environment; nothing is written to .env.

What else

Troubleshooting

Full reference: Documentation.