A dependable VPS backup for a self-hosted AI agent is a recovery system, not a single snapshot. Keep a rebuildable copy of the deployment definition, export every persistent Docker volume and bind-mounted directory, create database-aware dumps, encrypt the resulting files, and store them outside the VPS. Provider images and snapshots are useful for fast rollback, but they may omit attached volumes and cannot replace portable, independently held copies.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
The procedure below is designed to restore the agent on a clean server, including its configuration, memory, files, indexes, databases, credentials, integrations, and scheduled jobs.
As an Amazon Associate I earn from qualifying purchases.
What a complete backup must contain
An AI agent usually has more state than its running container suggests. A container can be recreated from an image, while the information that makes the agent yours lives in configuration files, volumes, databases, mounted directories, and external integrations. Back up these items as separate but coordinated layers.
Rebuild layer
Store the exact instructions needed to recreate the host and services:
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Docker Compose files, override files, and the output of
docker compose config. - Image tags and, preferably, immutable image digests.
- Operating-system package notes, runtime versions, and deployment scripts.
- Reverse-proxy configuration, TLS settings, domain mappings, and renewal jobs.
- Firewall rules, systemd units, cron entries, and monitoring configuration.
- Prompts, tool definitions, model-routing rules, agent policies, and startup parameters.
- A list of environment-variable names, without committing secret values to ordinary version control.
Keep this layer in version control or another system that is independent of the VPS. A backup that contains data but not the recipe for running the data can still leave you rebuilding by guesswork.
Application-data layer
Export Docker named volumes and every bind-mounted host directory. These commonly contain conversation history, agent memory, uploaded documents, vector indexes, caches, local model files, certificates, and embedded databases. Docker describes volumes as persistent data stores managed by Docker; removing a container does not remove a volume, but a provider image may not include one.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Database layer
Use the database’s own export tools. A raw copy of a live database directory can be inconsistent even when the files appear present. PostgreSQL’s pg_dump creates a consistent logical dump while users continue reading and writing. Use pg_dumpall when cluster-wide roles or tablespaces must also be preserved. SQLite and other embedded databases need their supported backup or dump mechanism before the resulting file is archived.
Provider-recovery layer
Enable the VPS provider’s backups or take snapshots for quick rollback, cloning, and emergency recovery. This is the fastest way to recover an entire system disk, but it is vendor-specific and may have a narrower scope than your application. Treat it as a convenience and rapid-rebuild layer, not the only copy.
Off-site layer
Send encrypted archives to object storage or another host that is independent of the VPS. Keep the repository password and object-storage credentials away from the agent server. If an attacker gains control of the VPS and the only backup credentials are stored there, the attacker may be able to erase both the workload and its backups.
Inventory the agent before choosing a schedule
Start with an inventory while the deployment is healthy. Record what is running, where it stores state, and how it is reached.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Render the deployment. Run
docker compose config > compose.rendered.yamland retain the rendered file with the source Compose files. It exposes merged services, mounts, networks, and resolved non-secret settings. - List volumes. Run
docker volume ls, then inspect each relevant volume withdocker volume inspect volume_name. Record the volume name and the services that use it. - Inspect mounts. Run
docker inspect container_nameand record every bind mount, including host paths outside the project directory. - Identify databases. Record database engine, database names, users, ports, schemas, extensions, and whether the database runs in a container or directly on the host.
- Find non-obvious state. Include model and embedding caches, downloaded models that cannot be quickly re-fetched, queue data, webhook certificates, local vector stores, and agent-specific directories.
- Record versions. Capture the operating-system release, Docker and Compose versions, reverse-proxy version, database version, model runtime version, and image tags or digests.
- Map integrations. List domains, DNS records, OAuth applications, API providers, webhook endpoints, messaging channels, schedulers, and monitoring destinations. Note which credentials must be rotated rather than restored.
Save the inventory with the runbook. A restore drill should be able to answer every “where is this stored?” question without logging into the original host.
Preserve configuration and secrets safely
Back up configuration files, but do not turn an archive into a password dump. Keep ordinary files such as Compose YAML, proxy rules, systemd units, firewall definitions, prompts, and scripts in version control. Replace secret values with documented variable names and describe how each value is recreated.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Document a secret-recreation process
- Identify the source for each secret: password manager, cloud secret store, certificate authority, or provider console.
- Record whether a credential can be restored, must be regenerated, or must be revoked and rotated after a migration.
- Keep encryption keys, API tokens, database passwords, OAuth client secrets, and webhook signing keys outside the VPS backup directory.
- Store a recovery copy of the backup-repository password separately from the repository itself. Without that password, an encrypted Restic repository cannot be read.
- Document DNS and TLS steps, including the order in which a new host obtains certificates and receives production traffic.
Do not assume that restoring a secret is always desirable. For example, an API token exposed during an incident should be revoked and replaced, while a database encryption key may need a carefully protected recovery copy.
Export Docker volumes and bind mounts
Never rely on a container’s writable layer. Recreating a container discards changes made only inside that layer. Named volumes and bind mounts are the durable application state and must be copied explicitly.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minutePrepare a consistent copy
Stop services that write heavily to a volume, or put the agent into a maintenance mode that prevents new conversations, uploads, and background jobs during the archive. A tar file made while files are changing may be crash-consistent at best and logically inconsistent at worst. Databases inside a volume still require their database-aware dump first.
Archive a named volume
Docker’s documented pattern uses a short-lived helper container. After identifying the volume, run a command like:
docker run --rm -v agent_data:/data -v "$PWD/backups":/backup alpine tar czf /backup/agent_data.tgz -C /data .
This mounts the named volume at /data and writes the archive to a host directory. Repeat it for each volume, using a distinct archive name. Include a text manifest containing the volume name, the service that owns it, and the path at which the service expects it.
Archive a bind-mounted directory
For a host directory, preserve its contents and permissions with a host-side archive:
tar czpf backups/agent-config.tgz -C /srv/agent config
Use the actual parent directory and path from your inventory. The p option preserves permissions where the host permits it. Also record ownership, ACLs, symbolic links, and extended attributes when the application depends on them.
Restore a named volume
- Create the destination volume:
docker volume create agent_data. - Extract the archive into it:
docker run --rm -v agent_data:/data -v "$PWD/backups":/backup alpine sh -c 'tar xzpf /backup/agent_data.tgz -C /data'. - Check ownership and permissions against the UID and GID used by the restored container.
- Start the service only after the database and configuration it depends on have also been restored.
If an archive was created while writes were active, test the application rather than assuming that a successful extraction means the data is usable.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Create database-aware dumps
PostgreSQL
Run the dump before archiving the related volume. A custom-format dump is convenient when restoring with pg_restore:
mkdir -p backups/postgres
docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" -Fc "$POSTGRES_DB"' > backups/postgres/app.dump
The command writes the dump on the VPS host, not inside the container. Confirm that the exit status is successful and record the PostgreSQL server version. For a cluster where roles, tablespaces, or other global objects matter, also export them:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutedocker compose exec -T postgres sh -c 'pg_dumpall -U "$POSTGRES_USER" --globals-only' > backups/postgres/globals.sql
Use a separate dump for each database when the cluster contains more than the agent’s primary database. PostgreSQL documents SQL dumps, file-system-level backups, and continuous archiving as distinct approaches; choose among them according to database size and recovery objectives. A logical dump is portable to another server, while physical or continuous-archive methods can be more appropriate for very large databases and tighter recovery requirements.
Restore PostgreSQL
- Install a compatible PostgreSQL version and create the destination cluster.
- Restore global roles and tablespaces from
globals.sqlwhen they are required. - Create the destination database with the correct owner and extensions.
- Restore the custom dump with
pg_restore, using options such as--clean --if-existsonly when you understand the effect on existing objects. - Run application migrations only after checking whether the dump already contains the required schema.
- Test logins, memory retrieval, indexes, background workers, and write operations.
Keep the dump protected: it can contain every conversation, document, user record, and credential stored in the database.
SQLite and other embedded stores
Do not copy a live SQLite file blindly while transactions are in progress. Use the SQLite version’s backup or dump mechanism, then archive the resulting file with the other application data. A typical command, run where the database is accessible, is:
sqlite3 /srv/agent/data/agent.sqlite '.backup "/srv/agent/backups/agent.sqlite"'
Verify the backup with an integrity check appropriate to the deployed SQLite version, and include WAL or journal files only when the application’s documented procedure requires them. For other embedded stores, follow that engine’s consistency procedure and note it in the runbook.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Encrypt and copy archives off the VPS with Restic
Restic provides encrypted, content-addressed repositories and can send backups to S3-compatible object storage. The repository is useful only if its password is protected independently of the host.
Initialize a repository
- Provision a bucket or object-storage destination that is separate from the VPS account where possible.
- Place the repository address, object-storage access credentials, and Restic password in a password manager or secret store. Do not hard-code them in the Compose file or backup script.
- Initialize the repository with
restic initusing the environment variables supplied by your storage provider. - Copy the configuration export, database dumps, volume archives, manifests, and runbook into one staging directory with restrictive permissions.
- Run
restic backup /srv/agent-backupand record the snapshot identifier. - Run
restic checkregularly. It checks repository structure, but it is not a substitute for extracting a snapshot and starting the application.
Keep at least one recovery copy of the repository password away from the VPS. Encryption protects the contents in object storage, but losing the password can make the encrypted data unrecoverable.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Schedule and prune snapshots
Run the backup script from cron or a systemd timer after database dumps and volume exports complete. A practical starting policy is several recent daily snapshots, a few weekly snapshots, and monthly snapshots for longer-lived configuration and data. One possible Restic retention command is:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune
These numbers are an example, not a universal standard. Tune retention to how quickly the agent changes, the cost of storage, legal or operational retention needs, and how much recent work can be lost. Alert on failed jobs, expired credentials, insufficient storage, and a backup age older than your operational limit.
Use provider backups and snapshots as a separate safety net
Provider recovery is valuable when a host fails suddenly or a deployment needs to be rolled back, but scope differs by provider and product.
| Recovery method | Attached-volume coverage | Database consistency | Portability | Encryption and credential isolation | Restore granularity | Retention and automation | Typical use |
|---|---|---|---|---|---|---|---|
| Provider VPS backup or snapshot | Provider-specific; verify explicitly | Usually an image-level capture unless the service is quiesced | Usually tied to the same provider | Controlled by provider account; not independent of that account | Whole server or image | Preset slots or provider settings | Fast rollback, cloning, and emergency host replacement |
| Encrypted Restic archive | Includes files you stage, including exported volumes and dumps | As consistent as the dump and archive procedure | Portable to another host and generally another provider | Repository encryption; credentials can be kept off-host | Individual files, volumes, dumps, or full staged set | You define schedule and retention | Independent disaster recovery and granular restore |
| Manual exports only | Only what someone remembers to export | Depends on operator and tool | Usually portable | Depends on storage and handling | Granular | Easy to omit or run late | One-time migration or supplementary copy |
Hetzner Cloud
Hetzner documents automatic daily server backups with seven available backup slots. Manual snapshots persist until deleted. Its documentation also states that attached Volumes are not included in server Backups or Snapshots, so a server image alone cannot restore volume-held agent data. Use volume exports and an independent off-site copy in addition to the provider features.
DigitalOcean
DigitalOcean documents selectable Droplet backup intervals of four hours, six hours, twelve hours, daily, or weekly. These backups are disk images that can be used to create or restore Droplets. Confirm the current plan, region behavior, pricing, and retention details for your account before relying on a particular interval. Export attached or external data separately if the selected product does not include it.
For any provider, read the current scope statement for the exact VPS plan and attached-storage product. “Backup enabled” does not by itself prove that every volume, database, or external service is covered.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Build an operational schedule
Separate frequent, cheap exports from less frequent rebuild copies. A schedule should reflect how much agent data can be recreated and how much recent activity is acceptable to lose.
| Cadence | Suggested work | Reason |
|---|---|---|
| After configuration changes | Commit Compose, proxy, firewall, scripts, prompts, and version changes | Keeps the rebuild layer aligned with production |
| Several times per day or daily | Dump databases, export changed volumes, encrypt, and upload | Limits loss of conversations, memory, and files |
| Weekly | Run restic check, review job logs, and verify repository access |
Catches silent failures and expired credentials |
| Monthly or after major upgrades | Perform a clean-host restore drill | Tests that files, versions, secrets, and integrations work together |
| According to provider settings | Retain VPS backups or snapshots | Provides rapid rollback while the off-site system remains independent |
There is no universally correct recovery-point or recovery-time target for every AI agent. Set yours explicitly: decide how many hours of conversations and uploads may be lost, and how long the service may remain unavailable while a clean host is rebuilt.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Restore on a clean VPS, not only on the original host
A restore drill is the proof that a backup is usable. Schedule one before an incident and record the elapsed time, missing prerequisites, and every manual workaround.
Recommended Free Tools
- Provision a clean server. Use a supported operating-system release and install the pinned Docker, Compose, reverse-proxy, and database versions.
- Retrieve credentials safely. Obtain the Restic password and object-storage credentials from the independent recovery location, then download a snapshot into a protected staging directory.
- Restore the rebuild layer. Check out the Compose files, scripts, proxy configuration, firewall rules, systemd units, prompts, and version manifest.
- Recreate secrets. Restore valid secrets where appropriate; rotate credentials that were exposed, revoked, or tied to the old host.
- Restore databases. Create PostgreSQL roles and databases, apply global objects when needed, and restore each dump. Restore SQLite or other embedded stores using the documented procedure.
- Restore volumes and bind mounts. Create destination volumes, untar archives, restore host directories, and correct ownership and permissions.
- Start dependencies first. Bring up the database, queue, storage, and model services before starting the agent and workers.
- Recreate network edges. Configure DNS, firewall rules, reverse-proxy routes, TLS certificates, webhook URLs, and OAuth callback addresses.
- Run functional checks. Confirm login, a normal agent response, memory retrieval, vector search, file upload and download, tool execution, scheduled jobs, webhooks, monitoring, and database writes.
- Record the result. Note the snapshot used, restore duration, failures, manual steps, and any data that could not be recovered. Update the runbook immediately.
After testing, destroy or isolate the drill host and revoke temporary credentials. Do not accidentally leave a restored copy exposed to the internet.
Common backup failures and fixes
The snapshot restored the server but the agent forgot everything
The memory or vector index was in an attached volume or bind mount outside the captured disk. Add those paths to the application-data layer and test volume restoration separately.
Containers start, but configuration is missing
The image was preserved without Compose files, environment-variable names, proxy rules, or scripts. Keep the rebuild layer under version control and include a rendered Compose configuration in each release record.
The database dump exists but cannot be restored
Check database-version compatibility, required extensions, roles, ownership, and whether the dump was truncated by a failed pipeline. Store command output and exit status, and perform a test restore rather than checking only that a file has nonzero size.
Files extract with the wrong owner
Archive and restore permissions, then compare the restored UID and GID with the IDs used by the container. Correct ownership before starting workers that need to write.
Restic snapshots exist but the password is unavailable
The repository is encrypted by design. Recover the password from the independent password manager or secret store; if no recovery copy exists, the repository cannot be treated as usable.
The backup job succeeded locally but the off-site copy is old
Separate staging, encryption, upload, verification, and pruning in the script. Alert on each stage, run restic snapshots from an independent environment, and investigate object-storage credential expiry or quota errors.
Restoration works, but webhooks and TLS do not
External integrations are not contained in a VPS archive. Include DNS, certificate, OAuth, webhook, and monitoring procedures in the rebuild layer, then test them during every drill.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteQuick Recap
Pre-incident checklist
- Compose source and rendered configuration are stored independently of the VPS.
- Image tags or digests and runtime versions are recorded.
- Every named volume and bind mount has an owner, path, and archive procedure.
- PostgreSQL dumps, global objects, SQLite backups, and other database exports complete successfully.
- Agent memory, uploaded files, vector indexes, model caches, and local databases are included or intentionally reproducible.
- Archives are encrypted before leaving the VPS.
- Restic repository credentials and password have an off-host recovery copy.
- Provider backup scope, including attached volumes, has been verified for the exact plan.
- Retention and alerting are configured and reviewed.
- A clean-VPS restore has been completed and documented.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




