Documentation
Run DumpStation
Everything you need to install, configure and operate DumpStation: a self-hosted server that runs pg_dump on a schedule, stores verified artifacts in S3-compatible storage, and reaches private databases through outbound-only agents.
.env, first sign-in. About five minutes.
Configuration →Every environment variable, searchable, with defaults.
Agents →Back up databases in private networks without opening a port.
Troubleshooting →All error codes and what to do about each.
The pieces
- Server (
ghcr.io/monzim/dumpstation): one Go binary serving the web UI, the REST API (/api/v1) and the agent API (/agent/v1). It schedules jobs, runs direct backups, applies retention and sends notifications. - Metadata database: a PostgreSQL instance for DumpStation's own configuration, history and encrypted secrets.
- Object storage: one or more S3-compatible buckets where artifacts live.
- Agents (
ghcr.io/monzim/dumpstation-agent, optional): small workers next to databases the server can't reach.
Requirements
| Need | Notes |
|---|---|
| Docker + Compose v2 | Or Kubernetes / a bare binary. Images are linux/amd64 and linux/arm64. |
| 1–2 vCPU, 256–512 MiB RAM | Plus ~64 MiB per concurrent upload. Agents do their own work. |
| Temp disk | Largest compressed dump × BACKUP_CONCURRENCY, for direct backups. |
| An S3-compatible bucket | AWS S3, Cloudflare R2, MinIO, B2, Wasabi, Spaces, Garage, Ceph RGW… |
| A domain with TLS | Recommended for production and required in practice for agents across the internet. |
| PostgreSQL 12–18 to back up | Client tools for every version are bundled in the images. |
Quick start
The production Compose bundle in configs/ runs the server and its metadata database. Direct backups work out of the box.
- Get the bundle
terminal
git clone https://github.com/monzim/DumpStation.git cd DumpStation/configs cp .env.example .env - Fill in the required values
Generate secrets and set the URL browsers and agents will use:
.envPOSTGRES_PASSWORD= # openssl rand -base64 24 JWT_SECRET= # openssl rand -base64 64 DUMPSTATION_SECRET_KEY= # openssl rand -base64 32 (keep it safe!) PUBLIC_URL=https://backups.example.com SYSTEM_USERNAME=admin APP_ENV=productionBack up
DUMPSTATION_SECRET_KEYseparately. It encrypts stored database passwords, storage keys, webhooks and TOTP secrets. Losing it makes them unrecoverable; changing it breaks decryption. - Start it
terminal
docker compose up -d docker compose logs -f dumpstation # wait for "Auto-migration completed successfully" - Sign in
Open
http://localhost:8080(or your domain), enteradminand request a code. WithoutDISCORD_WEBHOOK_URLthe code is written to the server log:terminaldocker compose logs dumpstation | grep "OTP not sent" - Turn on two-factor authentication
Under Settings → Security, before you expose the server. Then continue with your first backup.
The configurator on the home page generates a ready .env with fresh secrets in your browser.
Docker Compose
This is configs/compose.yml. The metadata database sits on an internal network with no route out; only the server publishes a port.
services:
postgres:
image: postgres:${POSTGRES_IMAGE_TAG:-15-alpine} # keep the major your volume was created with
container_name: dumpstation_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-backup_service}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Database password required}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
networks: [dumpstation_internal]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-backup_service}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
dumpstation:
image: ghcr.io/monzim/dumpstation:${DUMPSTATION_VERSION:-latest}
container_name: dumpstation
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${POSTGRES_USER:-postgres}
DB_PASSWORD: ${POSTGRES_PASSWORD:?Database password required}
DB_NAME: ${POSTGRES_DB:-backup_service}
DB_SSLMODE: disable
JWT_SECRET: ${JWT_SECRET:?JWT secret required}
DUMPSTATION_SECRET_KEY: ${DUMPSTATION_SECRET_KEY:?Encryption key required}
PUBLIC_URL: ${PUBLIC_URL:-http://localhost:8080}
TRUST_PROXY_HEADERS: ${TRUST_PROXY_HEADERS:-false}
SYSTEM_USERNAME: ${SYSTEM_USERNAME:-admin}
SYSTEM_EMAIL: ${SYSTEM_EMAIL:-admin@dumpstation.local}
DISCORD_WEBHOOK_URL: ${DISCORD_WEBHOOK_URL:-}
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-}
GITHUB_ALLOWED_LOGIN: ${GITHUB_ALLOWED_LOGIN:-}
GITHUB_REDIRECT_URL: ${GITHUB_REDIRECT_URL:-}
TURNSTILE_ENABLED: ${TURNSTILE_ENABLED:-false}
TURNSTILE_SITE_KEY: ${TURNSTILE_SITE_KEY:-}
TURNSTILE_SECRET_KEY: ${TURNSTILE_SECRET_KEY:-}
APP_ENV: ${APP_ENV:-production}
DEMO_ENABLED: ${DEMO_ENABLED:-false}
BACKUP_CONCURRENCY: ${BACKUP_CONCURRENCY:-2}
BACKUP_TIMEOUT_MINUTES: ${BACKUP_TIMEOUT_MINUTES:-360}
AGENT_JOB_QUEUE_TTL_MINUTES: ${AGENT_JOB_QUEUE_TTL_MINUTES:-360}
DIRECT_ALLOWED_CIDRS: ${DIRECT_ALLOWED_CIDRS:-}
volumes:
- backup_tmp:/tmp/dumpstation
ports:
- "${DUMPSTATION_PORT:-8080}:8080"
networks: [dumpstation_internal, dumpstation_external]
networks:
dumpstation_internal:
internal: true
dumpstation_external: {}
volumes:
postgres_data:
name: dumpstation_postgres_data
backup_tmp:
name: dumpstation_backup_tmpUseful commands
docker compose pull && docker compose up -d # upgrade; migrations run on start
docker compose logs -f dumpstation # follow logs
./manage.sh backup # dump the metadata database
curl -fsS localhost:8080/api/v1/health # health checkEnvironment variables
All settings are environment variables read at start-up. In the Compose bundle you set them in .env. Invalid numbers or booleans fall back to the default.
| Variable | Default | Description |
|---|---|---|
PUBLIC_URL | from request | External base URL, e.g. https://backups.example.com. Shown in agent snippets and used for GitHub sign-in. Set it in production. |
JWT_SECRETrequired | Signs sessions and OAuth state. openssl rand -base64 64. | |
DUMPSTATION_SECRET_KEYrequired | Base64 32-byte AES-256-GCM key for secrets at rest. openssl rand -base64 32. | |
JWT_EXPIRATION_MINUTES | 30 | Sliding session length; absolute cap 12 hours. |
SERVER_HOST / SERVER_PORT | 0.0.0.0 / 8080 | Listen address and port. |
WEB_DIR | /app/web in the image | Built web UI. Empty disables UI serving (API only). |
TRUST_PROXY_HEADERS | false | Take client IPs from X-Forwarded-For. Only behind a proxy you control. |
TZ | UTC | Server time zone, used for schedules without their own. |
DB_HOST · DB_PORT | localhost · 5432 | Metadata database. |
DB_USER · DB_NAME | postgres · backup_service | Metadata database. |
DB_PASSWORDrequired | Metadata database password (POSTGRES_PASSWORD in Compose). | |
DB_SSLMODE | disable | libpq sslmode for the metadata connection. |
SYSTEM_USERNAME | root (admin in Compose) | Initial user, created on first start and made administrator if none exists. |
SYSTEM_EMAIL | Email of the initial user. | |
DISCORD_WEBHOOK_URL | empty | Receives sign-in codes and start/stop notices. Empty: codes go to the server log. |
OTP_EXPIRATION_MINUTES | 5 | Lifetime of sign-in codes. |
GITHUB_CLIENT_ID · GITHUB_CLIENT_SECRET | empty | GitHub OAuth app. |
GITHUB_ALLOWED_LOGIN | empty | The only GitHub login allowed. GitHub sign-in turns on when ID, secret and login are set. |
GITHUB_REDIRECT_URL | empty | https://<host>/api/v1/auth/github/callback. |
TURNSTILE_ENABLED | false | Require Cloudflare Turnstile on code requests. |
TURNSTILE_SITE_KEY · TURNSTILE_SECRET_KEY | empty | Turnstile keys. TURNSTILE_TIMEOUT (s) defaults to 5. |
APP_ENV | empty | production disables demo seeding and the demo default. |
DEMO_ENABLED | true unless production | Enables the read-only demo sign-in. |
BACKUP_CONCURRENCY | 2 | Simultaneous direct backups and restores on the server. |
BACKUP_TIMEOUT_MINUTES | 360 | Limit for one backup or restore (server and agents). |
BACKUP_TEMP_DIR | /tmp/dumpstation | Staging for direct dumps and restores. |
BACKUP_MIN_FREE_MB | 0 (off) | Refuse to start a direct dump with less free temp space. |
DIRECT_ALLOWED_CIDRS | empty (any) | CIDRs/IPs the server may connect to for direct jobs, tests and DB Explorer. |
AGENT_JOB_QUEUE_TTL_MINUTES | 360 | How long an agent job waits to be picked up before agent_unavailable. |
AGENT_JOB_LEASE_SECONDS | 120 | An agent silent for this long loses its job. |
AGENT_JOB_MAX_ATTEMPTS | 3 | Attempts for agent backups after lost leases. Restores are never retried. |
PG_BIN_DIRS | empty | Extra colon-separated directories with PostgreSQL client tools. |
CORS_ALLOWED_ORIGINS | empty (off) | Only for API calls from another origin. The UI is same-origin. |
DUMPSTATION_VERSION | latest | Compose only: image tag. Pin it in production. |
DUMPSTATION_PORT | 8080 | Compose only: published host port. |
POSTGRES_IMAGE_TAG | 15-alpine | Compose only: keep the major version your data volume was created with. |
Reverse proxy & TLS
Put one hostname in front of the server for every path (/, /api/, /agent/, /config.js) and set PUBLIC_URL to it. Agents long-poll and may stream large artifacts, so /agent/ needs long timeouts and no body limit.
backups.example.com {
reverse_proxy dumpstation:8080 {
flush_interval -1
transport http {
read_timeout 6h
write_timeout 6h
}
}
}server {
listen 443 ssl http2;
server_name backups.example.com;
# ssl_certificate ...; ssl_certificate_key ...;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
# Agent protocol: long-polls and streamed artifact transfers.
location /agent/ {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
proxy_request_buffering off;
proxy_buffering off;
proxy_http_version 1.1;
proxy_read_timeout 6h;
proxy_send_timeout 6h;
}
}# traefik.yml — raise entrypoint timeouts (v3 defaults readTimeout to 60s)
entryPoints:
websecure:
address: ":443"
transport:
respondingTimeouts:
readTimeout: 0
writeTimeout: 0
# Do not attach a buffering middleware with a body limit to /agent/.Set TRUST_PROXY_HEADERS=true when the proxy is yours, so login rate limits and the activity log see real client IPs.
Behind Cloudflare or another CDN? Proxied plans cap request bodies (100 MB on free) and hold requests for about 100 s. Long-polls fit; proxied transfers of large backups don't. Let agents upload directly to storage (auto / direct) or expose a hostname for agents that bypasses the CDN.
Sign-in & security
One-time codes
Users sign in with a username and a 6-digit code. Codes go to DISCORD_WEBHOOK_URL when set, otherwise to the server log. They expire after OTP_EXPIRATION_MINUTES.
GitHub
- Create an OAuth app at github.com/settings/developers.
- Set its callback URL to
https://backups.example.com/api/v1/auth/github/callback. - Set
GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,GITHUB_ALLOWED_LOGINandGITHUB_REDIRECT_URL. Only that one account can sign in; it becomes an administrator on first sign-in.
Two-factor authentication
TOTP from Settings → Security, with recovery codes. Once enabled it is enforced for GitHub sign-ins too.
Turnstile
Set TURNSTILE_ENABLED=true and both keys to put a Cloudflare Turnstile challenge on code requests.
What's protected, and how
- Secrets at rest (database passwords, storage keys, webhook URLs, TOTP secrets, Explorer credentials) are encrypted with AES-256-GCM under
DUMPSTATION_SECRET_KEY. - Every resource has an owner; administrators can see all and manage roles. The demo account is read-only.
- Downloading an artifact needs a code sent to one of your notification channels, then gives a presigned URL valid for 5 minutes.
- The activity log records logins, configuration changes, backups, restores and agent events for 60 days.
Your first backup
- Add storage
Storage → Add storage. Pick the provider, bucket, endpoint and keys, then Test: it writes, reads and deletes a probe object under
.dumpstation/and tells you which step failed. The first storage becomes the default. - Add a database
Databases → Add database (or ⌘K → "Add database"). Choose Direct if the server can reach it, Agent if not. Test connection checks reachability, authentication, the server version and that a compatible
pg_dumpexists. - Pick a schedule and retention
A preset or cron expression, an IANA time zone, and keep-last-N or keep-N-days. See schedules & retention.
- Back up now
Press Back up now and follow the job: queued → connecting → dumping → uploading → verifying → retention. Every stage is logged.
The backup role must be able to read everything in the database: the owner, or pg_read_all_data on PostgreSQL 14+.
Storage providers
| Provider | Endpoint | Region | Notes |
|---|---|---|---|
| AWS S3 | leave empty | bucket region (empty → us-east-1) | Virtual-hosted style. |
| Cloudflare R2 | https://<account>.r2.cloudflarestorage.com | auto | API token with Object Read & Write on the bucket. |
| MinIO | http://minio:9000 | any (empty → auto) | Path-style. |
| S3-compatible | provider's S3 endpoint | as documented | B2, Wasabi, Spaces, Garage, Ceph RGW… Must support multipart and presigned URLs. |
The access key needs only object-level actions; no ListBucket, no bucket CORS:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:AbortMultipartUpload"],
"Resource": "arn:aws:s3:::my-dumpstation-backups/*"
}]
}Each backup remembers the storage it was written to. Changing a database's storage only affects new backups; older ones are restored from and deleted in their original bucket. Consider a lifecycle rule that aborts incomplete multipart uploads after a day, and object lock if you need protection against deletion.
Schedules & retention
Schedules are cron expressions or presets (hourly, every N hours, daily, weekly, monthly) evaluated in the database's IANA time zone, with a preview of the next runs. Runs missed while the server was down are detected and reported, and can notify you.
| Retention | Range | Keeps |
|---|---|---|
count | 1–10,000 | The N newest successful backups. |
days | 1–3,650 | Successful backups started within the last N days. |
The newest successful backup is never deleted, whatever the policy. A broken schedule can't leave you with nothing.
Retention runs after every successful backup. Failed and cancelled backups aren't counted; purge them from the Backups page. Pause stops scheduled runs while manual backups still work.
Restore
Open a successful backup and choose Restore. The wizard has three steps: target, options, confirmation.
| Target | Runs on | Notes |
|---|---|---|
| Original database | its executor | Restores into the source; typed confirmation. |
| Another configured database | that database's executor | Great for staging copies; typed confirmation. |
| Custom target | the server or an agent you pick | Enter connection details or pick an agent's local connection. |
- --clean runs
pg_restore --clean --if-exists. Without it, existing objects cause errors. - Restores always use
--no-owner --no-privileges. The target database must already exist. - The artifact's SHA-256 is checked against the value recorded at backup time before anything is restored.
- Through an agent, both Allow restores on the server and
DUMPSTATION_ALLOW_RESTORE=trueon the agent are required. - Restores are never retried automatically.
Prefer the command line? Download the artifact and run:
pg_restore --no-owner -d mydb backup.dumpNotifications
Notifications → Add channel. A channel holds a Discord webhook, a Telegram bot token and chat ID, or both; Test sends a message. Assign it to databases to receive:
- backup success (size, duration) and failure (with the error code);
- restore success and failure;
- missed scheduled runs;
- the database's agent going offline or coming back.
For Telegram, create a bot with @BotFather; get a chat ID from @userinfobot or by adding the bot to a group. The server-wide DISCORD_WEBHOOK_URL is separate: it only receives sign-in codes and start/stop notices.
How agents work
An agent is a small worker that backs up (and optionally restores) databases the server can't reach. It runs inside the private network, makes outbound HTTPS requests only, and executes only backup, restore and test_connection jobs.
| It needs | Why |
|---|---|
Outbound HTTPS to PUBLIC_URL | Control traffic and, in proxy mode, artifact transfers. |
| Network access to the databases | pg_dump / pg_restore connect from the agent host. |
| Outbound HTTPS to storage (optional) | Direct uploads via presigned URLs; otherwise uploads go through the server. |
| A persistent state directory | Holds the credential issued at enrollment. |
| Temp disk ≥ your largest compressed dump | Dumps are written to disk before upload. |
Registration
- Backup Agents → Add agent: name, restore permission (off by default), token lifetime (15 min, 1 h or 24 h).
- Copy the single-use
dse_…enrollment token and one of the ready-made snippets. - Start the agent. It enrolls, stores its credential, and the wizard flips to online.
- Databases → Add database → Agent, pick the agent and one of its connections.
Transfer modes
| Mode | Behaviour | Use when |
|---|---|---|
auto | Presigned multipart upload; falls back to proxy if it fails twice. | Most setups (default). |
direct | Presigned only; failure fails the job. | You don't want artifacts flowing through the server. |
proxy | Streamed through the server. | The agent can reach the server but not the bucket. |
Install an agent
The image ghcr.io/monzim/dumpstation-agent runs as UID 10001, keeps state in /var/lib/dumpstation-agent and bundles PostgreSQL client tools 12–18.
docker volume create dumpstation-agent-state
docker run -d --name dumpstation-agent --restart unless-stopped \
-e DUMPSTATION_SERVER_URL=https://backups.example.com \
-e DUMPSTATION_ENROLLMENT_TOKEN=dse_... \
-e DUMPSTATION_CONN_MAIN='postgres://backup:secret@db.internal:5432/app' \
-v dumpstation-agent-state:/var/lib/dumpstation-agent \
ghcr.io/monzim/dumpstation-agent:latest# deploy/agent/compose.yml — put the token in .env, the password in orders_password.txt
services:
dumpstation-agent:
image: ghcr.io/monzim/dumpstation-agent:${AGENT_VERSION:-latest}
container_name: dumpstation-agent
restart: unless-stopped
environment:
DUMPSTATION_SERVER_URL: ${DUMPSTATION_SERVER_URL:?e.g. https://backups.example.com}
DUMPSTATION_ENROLLMENT_TOKEN: ${DUMPSTATION_ENROLLMENT_TOKEN:-}
DUMPSTATION_CONN_ORDERS: postgres://backup_user@db.internal:5432/orders?sslmode=prefer
DUMPSTATION_CONN_ORDERS_PASSWORD_FILE: /run/secrets/orders_password
DUMPSTATION_ALLOW_RESTORE: "false"
DUMPSTATION_MAX_CONCURRENCY: "1"
DUMPSTATION_TRANSFER_MODE: auto
secrets:
- orders_password
volumes:
- agent_state:/var/lib/dumpstation-agent
- agent_tmp:/tmp/dumpstation
secrets:
orders_password:
file: ./orders_password.txt
volumes:
agent_state:
agent_tmp:kubectl create namespace dumpstation
kubectl -n dumpstation create secret generic dumpstation-agent \
--from-literal=enrollment-token=dse_... \
--from-literal=orders-password='...'
# edit DUMPSTATION_SERVER_URL and the connection in agent.yaml
kubectl -n dumpstation apply -f deploy/kubernetes/agent.yaml
kubectl -n dumpstation logs -f statefulset/dumpstation-agent# copy the binary out of the image
docker cp "$(docker create ghcr.io/monzim/dumpstation-agent:latest)":/usr/local/bin/dumpstation-agent /usr/local/bin/
sudo mkdir -p /etc/dumpstation-agent /var/lib/dumpstation-agent
sudo tee /etc/dumpstation-agent/agent.env >/dev/null <<'EOF'
DUMPSTATION_SERVER_URL=https://backups.example.com
DUMPSTATION_ENROLLMENT_TOKEN=dse_...
DUMPSTATION_STATE_DIR=/var/lib/dumpstation-agent
DUMPSTATION_TEMP_DIR=/var/tmp/dumpstation
DUMPSTATION_CONN_MAIN=postgres://backup:secret@127.0.0.1:5432/app
EOF
sudo chmod 600 /etc/dumpstation-agent/agent.env
# /etc/systemd/system/dumpstation-agent.service
# [Service]
# EnvironmentFile=/etc/dumpstation-agent/agent.env
# ExecStart=/usr/local/bin/dumpstation-agent run
# Restart=always
sudo systemctl daemon-reload && sudo systemctl enable --now dumpstation-agentThe Kubernetes manifest is a single-replica StatefulSet with a small PVC for state, a read-only root filesystem, all capabilities dropped and an exec liveness probe. No Service or Ingress is needed. Keep replicas: 1; for more capacity, deploy another agent.
Leaving DUMPSTATION_ENROLLMENT_TOKEN set after enrollment is harmless: the agent only re-enrolls when the value changes.
Connections
Agents back up named connections defined on the agent host. The server only sees the name; passwords never leave the host. Define them as env vars or in a YAML file.
# name "orders": lower-cased, _ becomes -
DUMPSTATION_CONN_ORDERS=postgres://backup_user@orders-db.internal:5432/orders?sslmode=require
DUMPSTATION_CONN_ORDERS_PASSWORD_FILE=/run/secrets/orders_password# /etc/dumpstation-agent/connections.yaml (or DUMPSTATION_CONNECTIONS_FILE)
connections:
orders:
url: postgres://backup_user@orders-db.internal:5432/orders?sslmode=require
password_file: /run/secrets/orders_password
analytics:
host: 10.20.0.15
port: 5432
database: analytics
user: backup
password_env: ANALYTICS_DB_PASSWORD
sslmode: preferCheck what an agent sees with docker exec dumpstation-agent dumpstation-agent connections. Restart the agent after changing connections.
Agent reference
| Variable | Default | Description |
|---|---|---|
DUMPSTATION_SERVER_URLrequired | Base URL of the server, https://. | |
DUMPSTATION_ENROLLMENT_TOKEN | Single-use dse_ token. _FILE supported. | |
DUMPSTATION_AGENT_CREDENTIAL | Use this dsa_ credential instead of enrolling. _FILE supported. | |
DUMPSTATION_STATE_DIR | /var/lib/dumpstation-agent | Stores the credential. Must persist. |
DUMPSTATION_CONNECTIONS_FILE | /etc/dumpstation-agent/connections.yaml | Named connections (YAML/JSON). Missing file is fine. |
DUMPSTATION_CONN_<NAME> | Connection URL. Also _PASSWORD_FILE and _FILE variants. | |
DUMPSTATION_ALLOW_RESTORE | false | Agent-side restore switch. |
DUMPSTATION_MAX_CONCURRENCY | 1 | Concurrent jobs, 1–16. |
DUMPSTATION_TRANSFER_MODE | auto | auto, direct or proxy. |
DUMPSTATION_TEMP_DIR | /tmp/dumpstation | Dump and restore scratch space. |
DUMPSTATION_MIN_FREE_MB | 0 (off) | Refuse to dump with less free temp space. |
DUMPSTATION_CA_FILE | PEM bundle for a server behind a private CA. | |
DUMPSTATION_INSECURE_SKIP_VERIFY | false | Disable TLS verification. Testing only. |
DUMPSTATION_SHUTDOWN_GRACE_SECONDS | 30 | Time running jobs get after SIGTERM. |
PG_BIN_DIRS | Extra directories with PostgreSQL client tools. | |
HTTPS_PROXY · NO_PROXY | Standard outbound proxy settings. |
CLI
| Command | Does |
|---|---|
run | Enroll if needed, then heartbeat and process jobs (default). |
healthcheck | Exit 0 if the server was reached in the last 2 minutes. |
connections | Print the connections the agent would report, with warnings. |
tools | Print the PostgreSQL client versions found. |
version | Print the build version. |
Operations & sizing
- Health:
GET /api/v1/health(unauthenticated, used by the image'sHEALTHCHECK). System Health in the UI shows version, uptime, DB latency, client tools and enabled sign-in methods. - Logs:
docker compose logs -f dumpstation, plus an execution log per job in the UI. - Back up the metadata database (
configs/manage.sh backup) and storeDUMPSTATION_SECRET_KEYseparately. Artifacts in storage are plainpg_dumpfiles and stay restorable without DumpStation. - Graceful shutdown: on SIGTERM the server stops the scheduler, drains HTTP for 30 s, then cancels running direct jobs (marked
interrupted). Agent jobs are unaffected. - Upgrades: pull and recreate; migrations run on start. Pin
DUMPSTATION_VERSIONin production.
| Resource | Server | Notes |
|---|---|---|
| CPU | 1–2 vCPU | Compression for direct backups. |
| Memory | 256–512 MiB | + ~64 MiB per concurrent upload. |
| Temp disk | largest dump × concurrency | Only for direct backups and restores. |
| Metadata DB | small | Grows with history and the 60-day activity log. |
Upgrading from v1
v2 serves the UI from the server itself, so the separate web service goes away. Existing databases become direct databases, and secrets keep working.
- Stop v1
docker compose down. Volumes are kept. Back up the metadata database first. - Swap the Compose file
Use the v2
configs/compose.yml, or delete thewebservice and map the server to8080. Keep your PostgreSQL image major version. - Update
.envSet
DUMPSTATION_SECRET_KEY(your existing key),PUBLIC_URL,APP_ENV=production. DropVITE_*,WEB_PORT,BACKEND_PORT. - Point the proxy at one upstream
Every path to port 8080. GitHub users: update the OAuth callback to
https://<host>/api/v1/auth/github/callback. - Start and verify
docker compose pull && docker compose up -d, wait for "Auto-migration completed successfully", test each storage and run one manual backup.
Troubleshooting
Every failed job carries a typed error code, shared by the server, agents and UI.
| Code | Meaning | What to do |
|---|---|---|
auth_failed | Wrong password, no password, role missing, or pg_hba.conf rejected the connection. | Check credentials (on the agent for local connections) and add a pg_hba.conf entry for the executor's IP. |
host_unreachable | DNS failure, refused, no route, or 15 s connect timeout. | Check host/port from the executor's network. A private host usually means: use an agent. |
database_not_found | The database name doesn't exist. | Fix the name; for restores create the target first. |
permission_denied | The role can't read some objects (or must own them to restore). | Use the owner or pg_read_all_data; for restores, --clean with an owner. |
version_mismatch | No installed pg_dump new enough, or an archive from a newer pg_dump. | Use the official images, or add a newer client to PG_BIN_DIRS. |
ssl_error | SSL negotiation or certificate verification failed. | Check sslmode; use disable for local containers without SSL. |
insufficient_disk | Temp space below the minimum, or disk full. | Grow the temp volume, lower concurrency. |
timeout | Ran longer than BACKUP_TIMEOUT_MINUTES. | Raise the limit; check locks and storage speed. |
cancelled | Cancelled by a user, or the lease was lost during upload. | Re-run if needed. |
tool_missing | No PostgreSQL client tools on the executor. | Use the official image or install postgresql-client. |
upload_failed | Upload to storage failed. | Run the storage Test; for agents try DUMPSTATION_TRANSFER_MODE=proxy. |
download_failed | Couldn't fetch the artifact for a restore. | Check the object exists and is reachable; try proxy mode. |
verification_failed | Object missing or size differs, or checksum mismatch on restore. | Re-run the backup; for restores pick another backup and check bucket integrity. |
storage_error | Storage config missing or invalid, or presigning failed. | Check endpoint, region and keys; run Test. |
agent_unavailable | Agent revoked, disabled, or didn't pick the job up in time. | Start or enable the agent; re-enroll a revoked one. |
agent_lost | The agent stopped reporting progress. | Check agent logs for crashes, OOM kills or network loss. |
configuration_error | Invalid fields, unknown connection name, restores disabled, or host blocked by DIRECT_ALLOWED_CIDRS. | Read the message; check dumpstation-agent connections. |
restore_failed | pg_restore reported errors. | Read the output tail; use --clean or an empty database; create missing roles/extensions. |
dump_failed | pg_dump failed for another reason or produced an empty file. | Read the output tail (locks, catalog issues). |
interrupted | The server restarted during a direct job. | Re-run; use agents for jobs that must survive restarts. |
unknown | Unclassified. | Read the message and the server/agent logs. |
Common problems
- Agent won't enroll: the token is single-use and expires; create a new one. Check the agent can reach
PUBLIC_URLover HTTPS. - Agent shows offline: it hasn't sent a heartbeat recently. Check its logs and outbound network;
dumpstation-agent healthcheckprints the reason. - Backups stuck in
waiting_for_agent: the agent is offline or busy; jobs fail afterAGENT_JOB_QUEUE_TTL_MINUTES. - No sign-in code: without a Discord webhook, look for "OTP not sent" in the server log.
Build from source
Go 1.25 and Node with pnpm. The server serves the built UI from WEB_DIR.
git clone https://github.com/monzim/DumpStation.git && cd DumpStation
cd web && pnpm install && pnpm build && cd ..
cd server && go build -o dumpstation ./cmd/server
WEB_DIR=../web/dist ./dumpstation # plus the DB_* and secret variables
CGO_ENABLED=0 go build -o dumpstation-agent ./cmd/agent # the agentContributions are welcome: see the repository for issues, the roadmap and contributor notes.