Repository navigation
Guide Backup Restore
Protect your data with regular, tested backups.
Install the backup plugin for scheduled, automated backups:
nself plugin install backup
nself build && nself restartConfigure schedule and retention in .env:
BACKUP_SCHEDULE=0 2 * * * # daily at 2am
BACKUP_RETENTION_DAYS=30 # keep 30 days
BACKUP_S3_BUCKET=my-backup-bucket # optional: upload to S3/MinIOnself db dumpWrites a pg_dump file to .nself/backups/ with a timestamped filename.
Configure in .env (or .env.secrets):
BACKUP_S3_ENDPOINT=https://s3.amazonaws.com
BACKUP_S3_BUCKET=my-backups
BACKUP_S3_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
BACKUP_S3_SECRET_KEY=<secret>Compatible with AWS S3, MinIO, Cloudflare R2, Backblaze B2, and any S3-compatible provider.
nself backup stream, nself backup schedule and the heartbeat (--heartbeat-to) accept the same destinations as nself backup create:
- an rclone remote:
name:path, ors3://r2://minio://b2://gcs://az:// - a local or mounted directory:
path://<absolute dir> - a server from
.nself/control-plane.yaml:host://<server>/<absolute dir>(over SSH, with a pinned host key)
Values that rclone could read as an option (-x, --config=...), connection strings (:s3,key=...:bucket) and other URL schemes (file://, http://) are refused before anything runs.
Credentials never go in the destination, and that includes userinfo in a scheme URI: s3://user@bucket and s3://KEY:SECRET@bucket/path are refused on purpose, because no bucket name can hold @ or :. backup schedule writes --to and --heartbeat-to into a systemd unit, so it refuses a value that carries inline options or credentials (:s3,access_key_id=...:bucket, s3://KEY:SECRET@bucket/path). Use a named remote from rclone.conf (rclone config), or define the remote in the environment with RCLONE_CONFIG_<NAME>_TYPE and its keys, put those lines in a file and pass it with backup schedule --env-file, then give the destination as <name>:<path>. The service unit is written with mode 0600.
nself backup stream, and nself backup create with encryption on (--encrypt), encrypt with age. In v1.5 (NSELF_V15=1), a project with no recipient configured gets an identity created once at ~/.config/nself/<project>-age.key, and restores find it on their own. Set BACKUP_AGE_RECIPIENTS to encrypt to a key you keep elsewhere; production should work that way, so the server never holds the key that decrypts its own backups.
A lost identity makes every backup encrypted to it unrecoverable. Copy it off the machine right after the first backup, then prove the copy with nself backup drill --from <remote> --identity <copy>, which restores into a throwaway container. nself doctor reminds you until you mark the copy done with touch ~/.config/nself/<project>-age.key.backed-up.
Full rules, lookup order, error codes and the threat model: cmd-backup (Zero-config encryption key).
nself db restore .nself/backups/myproject_20260328_020000.sqlThe restore command:
- Stops application services (keeps Postgres running)
- Drops and recreates the target database
- Restores from the dump file
- Restarts services
Important: Test your restores regularly. Untested backups are not backups.
- Backup job runs successfully (check logs:
nself logs backup) - Backup files appear in
.nself/backups/or S3 bucket - Restoration test succeeds on a staging instance
- Retention policy removes old files as expected
- plugin-backup, backup plugin reference
- cmd-db, db command reference
- Guide-Production-Deployment, server setup
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-access · cmd-security · cmd-secrets
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license · cmd-dogfood (extracted, CLI-R11) · cmd-k8s (extracted, CLI-R11) · cmd-encryption (extracted, CLI-R11) · cmd-waf (extracted, CLI-R11) · cmd-federation (extracted, CLI-R11) · cmd-mail (extracted, CLI-R11) · cmd-dlq (extracted, CLI-R11)
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-nClaw, AI Assistant
- Feature-nChat, Messaging
- Feature-nFamily, Family Social
- Feature-nCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Shared-Proxy
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
- Plugin-Overview
- Plugin-Catalog
- Plugin-Install
- Plugin-Licensing
- Plugin-Architecture
- Plugin-Dev-Guide
- Plugin-Migrations-Contract
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- plugin-analytics
- plugin-auth
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-entitlements
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-object-storage
- plugin-observability
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-social
- plugin-sports
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
- Architecture
- Architecture-Guardrails
- Service-Graph
- Compose-Generation
- Nginx-Generation
- Plugin-Architecture
Reference
Machine interface
-
JSON-Output,
--jsonenvelope -
Command-Registry,
nself help --json - Exit-Codes
- error-codes, Error Codes
-
Compat-V15,
NSELF_V15gate
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions
All commands (21)
- A: cmd-add · cmd-admin
- B: cmd-backup · cmd-build
- C: cmd-clean · cmd-config
- D: cmd-db · cmd-deploy · cmd-doctor
- E: cmd-exec
- I: cmd-init
- L: cmd-license · cmd-logs
- M: cmd-mcp
- R: cmd-remove · cmd-reset · cmd-restart
- S: cmd-start · cmd-status · cmd-stop
- U: cmd-update