Deploy & Remote¶
Deploy to the cloud and manage remote servers from the CLI.
Overview¶
The dango deploy command provisions cloud infrastructure and deploys your project. The dango remote commands manage the deployed server — push updates, view logs, manage backups, configure firewalls, and more.
Deploy commands:
dango deploy— Interactive deployment wizarddango deploy destroy— Tear down cloud infrastructure
Remote commands (15+ subcommands across 5 groups):
- Core:
push,rollback,status,logs,ssh,query,upgrade,resize,migrate,history,sync - Environment:
env set/get/list/delete - Firewall:
firewall list/allow-ip/allow-all - Domain:
domain set/remove - Backup:
backup list/enable/disable/download/restore - Auth:
auth add-user/list-users/remove-user/reset-password
Deployment¶
dango deploy¶
Interactive deployment wizard. Supports DigitalOcean provisioning, BYOS (bring your own server), and reconnection to existing servers.
| Option | Description |
|---|---|
--non-interactive | All params via flags/env (DigitalOcean only) |
--reconnect | Reconnect to an existing server |
--ip TEXT | Server IP for --reconnect |
--region TEXT | DO region slug |
--size TEXT | Droplet size slug |
--domain TEXT | Custom domain for HTTPS |
--admin-email TEXT | Admin user email |
--admin-password TEXT | Admin password (or DANGO_ADMIN_PASSWORD env var) |
--skip-backups | Skip automated backup setup |
--byos | Deploy to an existing server (any provider) |
--server-ip TEXT | Server IP/hostname for --byos |
--ssh-user TEXT | SSH user for --byos |
--ssh-key TEXT | SSH key path for --byos |
The wizard guides you through region selection, server sizing, domain setup, and admin account creation.
dango deploy --non-interactive \
--region nyc3 \
--size s-2vcpu-4gb \
--admin-email [email protected] \
--admin-password mypassword
dango deploy destroy¶
Tear down all cloud infrastructure for this project.
| Option | Description |
|---|---|
--force | Skip confirmation and backup prompts |
--keep-spaces | Keep the Spaces bucket and its contents |
--keep-ssh-key | Keep the SSH key on DigitalOcean |
Deletes the Droplet, firewall, SSH key (from DO), and Spaces bucket. Local SSH keys and project files are never deleted.
Optionally stops remote services and removes local cloud.yml.
Danger
This is a destructive operation. For DigitalOcean deployments, the server and all its data will be permanently deleted.
Remote Server Management¶
dango remote status¶
Show server status, resource usage (CPU, RAM, disk), service health, DuckDB size, and version info.
dango remote logs¶
View logs from a remote service.
| Option | Default | Description |
|---|---|---|
--service [dango\|caddy\|metabase] | dango | Service to view logs for |
--tail INTEGER | — | Number of log lines to show |
-f, --follow | — | Stream logs in real-time (Ctrl+C to stop) |
dango remote ssh¶
Open an interactive SSH session to the remote server. Replaces the current process with SSH, providing full TTY support.
dango remote query¶
Run a read-only SQL query against the remote DuckDB database.
| Option | Description |
|---|---|
--timeout INTEGER | Query timeout in seconds |
The query runs in read-only mode — INSERT/UPDATE/DELETE are rejected.
dango remote query "SELECT count(*) FROM information_schema.tables"
dango remote query "SELECT * FROM raw.my_table LIMIT 10" --timeout 120
dango remote push¶
Push local project files to the remote server and rebuild.
| Option | Description |
|---|---|
--dry-run | Show changes without applying |
--force | Override an existing deploy lock |
-y, --yes | Skip confirmation prompt |
--allow-dirty | Allow deployment with uncommitted changes |
--allow-branch | Allow deployment from any branch |
Syncs config and dbt files, creates a pre-deploy backup, runs dbt compile, and selectively rebuilds changed models.
dango remote push
dango remote push --dry-run
dango remote push --force --yes
dango remote push --allow-dirty --allow-branch
Tip
By default, dango remote push checks for uncommitted changes and the current branch. Use --allow-dirty and --allow-branch to override these guardrails.
dango remote rollback¶
Restore the remote server from a backup.
| Option | Description |
|---|---|
--backup TEXT | Path to a specific backup archive (defaults to most recent) |
-y, --yes | Skip confirmation prompt |
Stops services, restores the backup, then restarts and verifies health.
dango remote rollback
dango remote rollback --backup /srv/dango/backups/deploy/backup-20260224-143000.tar.gz
dango remote upgrade¶
Upgrade Dango on the remote server.
| Option | Description |
|---|---|
--version TEXT | Specific version (defaults to latest on PyPI) |
-y, --yes | Skip confirmation prompt |
--skip-backup | Skip the pre-upgrade backup |
dango remote resize¶
Resize the remote server (change CPU/RAM).
| Parameter | Description |
|---|---|
SIZE | Droplet size slug. If omitted, shows current spec and available tiers |
-y, --yes | Skip confirmation prompt |
dango remote migrate¶
Migrate to a new server (new droplet for disk/region changes). Transfers data via Spaces.
| Option | Required | Description |
|---|---|---|
--size TEXT | Yes | Size slug for the new server |
--region TEXT | No | Region slug (defaults to current region) |
-y, --yes | No | Skip confirmation prompt |
dango remote history¶
Show deployment history from the remote server's deployment journal.
| Option | Description |
|---|---|
-n, --limit INTEGER | Number of entries to show |
dango remote sync¶
Trigger a data sync on the remote cloud server.
| Parameter | Description |
|---|---|
SOURCE | Source name to sync (required) |
--full-refresh | Run a full refresh sync |
--backfill TEXT | Backfill duration (e.g. 7d, 2w, 1m) |
--wait | Wait for sync to complete and show result |
dango remote sync my_source
dango remote sync my_source --full-refresh --wait
dango remote sync my_source --backfill 7d --wait
Environment Variables¶
dango remote env set¶
Set an environment variable on the remote server.
dango remote env get¶
Display an environment variable (value masked).
dango remote env list¶
List all environment variables on the remote server (values masked).
dango remote env delete¶
Remove an environment variable from the remote server.
Firewall¶
dango remote firewall list¶
Show current inbound and outbound firewall rules.
dango remote firewall allow-ip¶
Restrict ports 80 and 443 to a specific IP address or CIDR range. SSH (port 22) is always left open.
dango remote firewall allow-ip 203.0.113.42 # Single IP (/32)
dango remote firewall allow-ip 203.0.113.0/24 # CIDR range
dango remote firewall allow-all¶
Revert ports 80 and 443 to allow all public traffic.
Domain & HTTPS¶
dango remote domain set¶
Configure HTTPS for a custom domain with automatic Let's Encrypt certificates.
DNS must point DOMAIN_NAME to the droplet IP for certificate issuance. If DNS hasn't propagated yet, the configuration is still applied — Caddy retries automatically.
dango remote domain remove¶
Revert to IP-only HTTP access. Removes the domain from config and rewrites the Caddyfile for plain HTTP on port 80.
Backups¶
dango remote backup¶
Trigger an on-demand backup on the server.
dango remote backup list¶
List backups on the server and in Spaces.
dango remote backup enable¶
Enable daily scheduled backups via systemd timer. Requires Spaces to be configured.
dango remote backup disable¶
Disable daily scheduled backups.
dango remote backup download¶
Download a backup archive from Spaces.
| Option | Description |
|---|---|
-o, --output PATH | Local path to save the backup (defaults to current directory) |
dango remote backup download backup-20260224-143000.tar.gz
dango remote backup download backup-20260224-143000.tar.gz -o ./my-backup.tar.gz
dango remote backup restore¶
Restore the server from a Spaces backup. Downloads the backup to the server, then restores it.
| Option | Description |
|---|---|
-y, --yes | Skip confirmation prompt |
Warning
Current data on the server will be overwritten.
Remote User Management¶
dango remote auth add-user¶
Create a new user on the remote server with a temporary password.
| Option | Description |
|---|---|
--role [admin\|editor\|viewer] | Role for the new user |
dango remote auth add-user [email protected] --role editor
dango remote auth list-users¶
List all users on the remote server.
dango remote auth remove-user¶
Permanently remove a user from the remote server.
Danger
This permanently deletes the user and cannot be undone.
dango remote auth reset-password¶
Reset a user's password on the remote server. Generates a new temporary password.
dango remote repair¶
Diagnose and repair common cloud deployment issues. Checks disk, RAM, DNS, restarts services, re-runs Metabase setup if metabase.yml is missing, and triggers a Metabase schema scan.
dango remote reset-metabase¶
Reset Metabase to a fresh state without losing warehouse data. Stops Metabase, removes its Docker volume (H2 database), restarts it, and lets dango-web re-run Metabase setup on next startup.
Troubleshooting¶
Deploy fails with SSH connection error
Verify the server IP and SSH key. For BYOS, ensure the SSH user has sudo access and port 22 is open.
Push rejected due to deploy lock
Another push may be in progress. Wait for it to complete, or use --force to override the lock (only if you're sure no other deploy is running).
Domain HTTPS not working
Ensure DNS is pointed to the server IP. Caddy automatically retries certificate issuance. Check dango remote logs --service caddy for details.
Firewall locked you out
SSH (port 22) is always kept open. Connect via dango remote ssh and troubleshoot from the server. If needed, use DigitalOcean console access.
Backup restore fails
Ensure Spaces credentials are configured (SPACES_ACCESS_KEY, SPACES_SECRET_KEY). Check available backups with dango remote backup list.
Related Pages¶
- CLI Reference — Quick reference for all commands
- Auth Commands — Local user management
- Schedule Commands — Configure scheduled syncs on the remote server