# SafeGrd > SafeGrd backs up PostgreSQL, MySQL, MongoDB and SQLite databases, file trees and IMAP mailboxes. Each backup is encrypted with age on the customer's host, locked with S3 Object Lock in compliance mode so nothing can delete it early, and the newest is restored on a schedule (a Fire Drill) to test that it works. Backups and restores run on the customer's host with the `safegrd` CLI, and the backup data never passes through SafeGrd's server. The customer chooses how the private key is managed. With a customer-managed key only the customer can decrypt the backups. With a SafeGrd-managed key SafeGrd keeps the key sealed and releases it only to the organization's enrolled hosts, so the customer can restore even after losing a host. Agents can operate SafeGrd but cannot destroy anything: a personal access token cannot delete, disable, re-route or re-key a backup, through MCP or the REST API. ## Try it with no account A person with no SafeGrd account can see a real backup and restore check first. On the host that reaches the database: curl -fsSL https://safegrd.dev/install.sh | SAFEGRD_NO_SETUP=1 sh safegrd try postgres://user:pass@host/db A MySQL, MongoDB or SQLite URL, or a directory, works the same; `env:DATABASE_URL` keeps the password out of the config. The backup is encrypted on the host, uploaded to SafeGrd's storage, restored in memory from there, and kept for 24 hours. `safegrd signup` prints a link and a code; the person signs up in a browser (or signs in to an account with no organization), and the host, its backup and its daily schedule become their organization. An account that already has an organization runs `safegrd login` and then `safegrd enroll` on that host instead: it enrolls as a new host there, with the same surfaces and key. Details: https://safegrd.dev/docs/install#try ## Connect an agent Remote server, for any machine, on every plan including free. A client that can sign in (claude.ai, Claude Desktop, Claude Code, ChatGPT) adds https://safegrd.dev/mcp by URL: the person signs in to SafeGrd, picks one organization and approves, and the sign-in is listed under Tokens in the console. OAuth 2.1 with PKCE; metadata at https://safegrd.dev/.well-known/oauth-authorization-server. In Claude Code: claude mcp add --transport http safegrd https://safegrd.dev/mcp A Claude Code session that was already open lists the server only after a restart (`claude --continue` keeps the conversation); then /mcp, safegrd, Authenticate. Or the Claude Code plugin, which adds the same server, signed in the same way, with skills that back up and run a Fire Drill before a risky change (https://github.com/safegrd/agent-plugins). After installing, run /mcp and choose Authenticate: /plugin marketplace add safegrd/agent-plugins /plugin install safegrd@safegrd A client that cannot sign in sends a personal access token, created in the console under Tokens: claude mcp add --transport http safegrd https://safegrd.dev/mcp --header "Authorization: Bearer sg_pat_..." It lists organizations, projects, surfaces, snapshots and Fire Drills, asks for a backup or a drill now, and returns the console link or the commands that add a surface or a host (get_surface_setup, get_host_setup). A surface is added by the person in the console, so no connection string passes through the chat. The host's daemon picks a request up at its next check-in; a surface SafeGrd backs up or drills is queued on SafeGrd and needs no daemon. Start with `list_organizations` and `list_surfaces`. The tools are listed without a token at https://safegrd.dev/.well-known/mcp/server-card.json. Local server, on a host that runs the `safegrd` CLI (no plan needed). It backs up, verifies and restores into an empty target with that host's config and key: claude mcp add safegrd -- safegrd mcp Any client that speaks Streamable HTTP with a bearer header, or stdio, works the same way. ## Agents - [AI agents (MCP)](https://safegrd.dev/docs/mcp): the remote MCP server at https://safegrd.dev/mcp (Streamable HTTP, bearer personal access token) and the local `safegrd mcp` (stdio) - [Agent guard](https://safegrd.dev/docs/agents): `safegrd guard` takes a locked snapshot before a destructive command; hook recipes for Claude Code, Cursor and Codex; `safegrd doctor --agent-proof` - [OpenAPI](https://safegrd.dev/openapi.json): the /api/v1 routes an agent needs - [API reference](https://safegrd.dev/docs/api): the same document as a page, rendered from it - [MCP server card](https://safegrd.dev/.well-known/mcp/server-card.json): the remote server's tools and their arguments, readable without a token ## Docs Every docs page below is also Markdown at its address with .md added (https://safegrd.dev/docs/install.md), and all of them are in one file: https://safegrd.dev/llms-full.txt - [Overview](https://safegrd.dev/docs) - [Install and enroll](https://safegrd.dev/docs/install) - [Where to run it](https://safegrd.dev/docs/deploy): Docker Compose, a Kubernetes CronJob, the Helm chart, GitHub Actions - [Command reference](https://safegrd.dev/docs/cli) - [Config file reference](https://safegrd.dev/docs/config) - [Surfaces](https://safegrd.dev/docs/surfaces) - [Databases](https://safegrd.dev/docs/surfaces/databases) - [Files](https://safegrd.dev/docs/surfaces/files) - [Email](https://safegrd.dev/docs/surfaces/email) - [Storage and retention](https://safegrd.dev/docs/storage) - [Daemon](https://safegrd.dev/docs/daemon) - [Hosted backups and drills](https://safegrd.dev/docs/hosted) - [Restore and Fire Drills](https://safegrd.dev/docs/verify) - [Recovery runbooks](https://safegrd.dev/docs/runbooks) - [Security and key custody](https://safegrd.dev/docs/security) ## By database and platform - [PostgreSQL backup](https://safegrd.dev/postgresql-backup): pg_dump schema and binary COPY rows from one snapshot, restored on a schedule - [MySQL and MariaDB backup](https://safegrd.dev/mysql-backup): mysqldump --single-transaction, loaded into a scratch database to test it - [MongoDB backup](https://safegrd.dev/mongodb-backup): mongodump --archive, document counts checked on restore - [Supabase backup](https://safegrd.dev/supabase-backup): what Supabase's backups leave out, pg_dump through the session pooler, restore locally or into a project - [Neon backup](https://safegrd.dev/neon-backup): pg_dump over the direct endpoint, what the restore window covers by plan, the copy outside Neon - [Railway backup](https://safegrd.dev/railway-backup): private networking or the TCP proxy, what volume backups and PITR cover, the copy outside the project - [Render backup](https://safegrd.dev/render-backup): the external URL, what recovery covers on Hobby and Pro, a copy past 7 days - [Fly.io Postgres backup](https://safegrd.dev/fly-postgres-backup): Managed Postgres and Fly Postgres from inside the private network, a file you hold - [DigitalOcean Postgres backup](https://safegrd.dev/digitalocean-postgres-backup): from a droplet in the VPC, trusted sources, a copy past 7 days, Spaces and Object Lock - [Hetzner Postgres backup](https://safegrd.dev/hetzner-postgres-backup): to Hetzner Object Storage under Object Lock, a key that cannot delete - [Amazon RDS PostgreSQL backup](https://safegrd.dev/rds-postgres-backup): from inside the VPC off a replica, what automated backups and snapshots keep, a copy outside the AWS account - [Heroku Postgres backup](https://safegrd.dev/heroku-postgres-backup): what PGBackups and rollback keep by plan, the string read at backup time, a copy that outlives the add-on - [Coolify backup](https://safegrd.dev/coolify-backup): beside Coolify's own backups, encrypted, locked and restore-tested - [Integrations](https://safegrd.dev/integrations): every database, platform, storage and host on one page - [Backup verification](https://safegrd.dev/backup-verification): what each kind of check proves, and what a Fire Drill checks per database ## Free tools - [Backup file checker](https://safegrd.dev/tools/backup-file-checker): reads a pg_dump, mysqldump, mongodump or SQLite file in the browser; reports format, versions, whether it was cut short, and the restore command - [pg_dump command builder](https://safegrd.dev/tools/pg-dump-command-builder): a pg_dump command and the matching pg_restore or psql command - [Object Lock cost calculator](https://safegrd.dev/tools/object-lock-cost-calculator): locked copies held at once and their monthly cost, with daily, weekly and monthly tiers ## Guides - [How to back up PostgreSQL to S3 with pg_dump](https://safegrd.dev/guides/postgres-backup-s3) - [Immutable backups with S3 Object Lock](https://safegrd.dev/guides/immutable-backups-s3-object-lock) - [How to test that a PostgreSQL or MySQL backup restores](https://safegrd.dev/guides/test-database-backup-restore) - [RPO and RTO for a database backup](https://safegrd.dev/guides/rpo-rto) - [pg_dump, pg_basebackup or pgBackRest](https://safegrd.dev/guides/pg-dump-vs-pg-basebackup-vs-pgbackrest) - [PostgreSQL backup tools compared](https://safegrd.dev/guides/postgresql-backup-tools): pgBackRest, Barman, WAL-G, Databasus, SimpleBackups, BackupDrill, AWS Backup, SafeGrd and pg_dump, each with what it does best - [Supabase backup tools compared](https://safegrd.dev/guides/supabase-backup-tools): Supabase's own backups, GitHub Actions, BackupDrill, BackProve, ReviveDB, Reeve, SimpleBackups, SupaSafe, Supabackup, Ottomatik and SafeGrd: which back up Storage files and which test the restore - [SQLite WAL mode and backups](https://safegrd.dev/guides/sqlite-wal-backup): what WAL mode does, why copying app.db misses recent writes, and three backups that do not - [Database backups an AI coding agent cannot delete](https://safegrd.dev/guides/backups-ai-agent-cannot-delete): what an agent on your machine can reach, Object Lock in compliance mode, a key and a token that cannot delete, and a snapshot before each destructive command - [Restore-test evidence for SOC 2 and security questionnaires](https://safegrd.dev/guides/restore-test-evidence-soc2): what SOC 2 A1.2 and A1.3 ask about backups, what a restore-test record holds, and questionnaire answers - [SafeGrd vs AWS Backup](https://safegrd.dev/compare/aws-backup) - [SafeGrd vs SimpleBackups](https://safegrd.dev/compare/simplebackups) - [SafeGrd vs pgBackRest](https://safegrd.dev/compare/pgbackrest) - [SafeGrd vs Barman](https://safegrd.dev/compare/barman) - [How to back up Supabase with GitHub Actions](https://safegrd.dev/guides/supabase-backup-github-actions) - [Know when Coolify's database backups stop working](https://safegrd.dev/guides/check-coolify-backups): check the age, size and restore of each backup Coolify writes, by script or with a SafeGrd surface that watches the bucket - [Restore a Postgres backup without bringing back deleted users](https://safegrd.dev/guides/restore-without-deleted-users): replay the erasures made after a backup, and restore with pg_cron's jobs left out, with pg_restore or SafeGrd - [Supabase project down: get running from your own backup](https://safegrd.dev/guides/supabase-project-down): a new project from your own backup when the old one is stuck restoring or locked, database, Storage files, settings and cutover - [Restore a Supabase dump outside Supabase](https://safegrd.dev/guides/restore-supabase-dump): the supabase/postgres image, a new database and supabase_admin restore a Supabase pg_dump with no errors; plain postgres:17 gives 130 errors and drops row-level security policies, and the checks that catch it - [pg_dump errors on Supabase](https://safegrd.dev/guides/supabase-pg-dump-errors): pg_dump --enable-row-security as a role without BYPASSRLS exits 0 and dumps only the rows its policies show (0 of 5,000 in our test); the sequence, auth schema, version mismatch and IPv6 errors and the fix for each - [MongoDB Atlas backup cost](https://safegrd.dev/guides/mongodb-atlas-backup-cost): Atlas backup prices for Free, Flex and M10+ clusters, snapshot storage against Continuous Cloud Backup, export and egress, with a worked 50 GB example - [SafeGrd vs BackupDrill](https://safegrd.dev/compare/backupdrill) - [SafeGrd vs Databasus](https://safegrd.dev/compare/databasus) - [SafeGrd vs Ottomatik](https://safegrd.dev/compare/ottomatik) ## Optional - [Pricing](https://safegrd.dev/pricing) - [AI agents: backups an agent cannot delete](https://safegrd.dev/#ai-agents) - [Threat Shield](https://safegrd.dev/docs/threat-shield) - [The attestation record](https://safegrd.dev/docs/attestation) - [Alerts](https://safegrd.dev/docs/alerts) - [Organizations and billing](https://safegrd.dev/docs/account) - [Troubleshooting](https://safegrd.dev/docs/troubleshooting) - [Source (BSL 1.1)](https://github.com/safegrd/cli)