{% extends "admin/dbs/wiki/_layout.html" %} {% block wiki %}
The DBS manager is a separate application in the same package. Run it on your own machine:
pip install django-dbs
django_dbs run
django-dbs and dbs are the same command. If the shell says it is
not recognized, pip put the script in a folder that is not on your PATH. Run
python -m dbs.manager run instead, or install with
pipx install django-dbs.
It opens in your browser and looks after many servers over SSH. A server is a
machine it signs in to; an application is one Django project on it, run on the
server itself, in a Compose service or in a container, under Docker or Podman. For each
application it pulls the backups, keeps them on its own machine, schedules them, keeps the
.env versions and folder archives, deploys in place or moves the project onto
another server, and restores, with a console and a terminal in the browser.
This server pushes nothing. Each time the manager backs this project up, it first collects
the backups it left waiting here, then runs manage.py dbs backup --stream and
receives the new backup as it is written. A copy stays in DBS_BACKUP_DIR; when
the connection breaks, the manager reconnects, waits for this server to finish, and pulls
only the rest. Once the manager has checked its own copy, it removes the copies it left here,
keeping as many as the plan says (none by default). This server keeps at most five streamed
backups per name. If this panel's own schedule is on as well, the manager's check warns that
both are taking backups.
The manager stores this project's backup passphrase, sealed, read from the project while it is added and before its first backup. It must never change: the backups taken with it would no longer open.
The master account manages the other accounts, each an admin, an operator or a viewer,
each allowed less than the one before. Every sign-in takes the password and a code from an
authenticator app, set up at the first sign-in, and passwords expire after 30 days. Adding an
application, changing what it runs, opening a terminal and every real restore or deploy ask
for the password again. From a shell: django_dbs createuser NAME --role operator,
django_dbs account list|role|disable|enable|reset-2fa and
django_dbs password NAME.
Everything the manager's interface does is also a command, on the same data and the same audit trail:
django_dbs server add web --host app.example.com --user deploy --ssh-password
django_dbs app add shop --server web --folder /srv/shop
django_dbs backup take --all
server add shows the host key fingerprint to confirm, signs in and checks the
server and its container engines. app add finds the project in the folder, on the
server or in a container, with its Python, manage.py, backup folder and
.env, then checks it. django_dbs AREA VERB --help lists the rest:
server, app, backup, plan,
activity, env, files and redeploy. The
Console page runs the same commands in the browser as the signed-in account.
django_dbs mcp lets Claude add servers and applications, take and verify
backups, set up plans and rehearse restores, deploys and moves
(claude mcp add dbs -- django_dbs mcp). Before it adds a server, you confirm the
host key yourself, in the manager or with django_dbs server confirm-host-key ID.
It adds an application only as discovery found it, never reveals a secret, never takes your
account password, never reaches the console or the terminal, and cannot restore, deploy or
move for real, make a plan keep fewer backups, or remove or delete anything.
~/.ssh/authorized_keys for that user.manage.py, or the one that holds the compose file. Browse the
server lets you pick it.The manager needs django-dbs 0.7 or later here, 0.8 to resume a transfer that broke, and
DBS_BACKUP_DIR.
When this project runs in a container, the manager finds it from the folder on the server:
the Compose project whose working folder that is, or the container that mounts it. It runs
every manage.py command inside the container through the engine, maps the paths
it reads here to the server through the container's mounts, streams a restore into the
container over standard input, and sweeps its leftovers there. Keep
DBS_BACKUP_DIR on a mounted folder so the copy outlives the container. The SSH
user must be allowed to run the engine (the docker group, or rootless Podman as
that user); the manager never uses sudo.
This project never contacts the manager and keeps nothing about it. A backup the manager
asks for is written to DBS_BACKUP_DIR and recorded in the
audit trail like any other
backup.