iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
The safest approach is layered: make an occasional offline image of the entire Raspberry Pi system, back up service files and Docker configuration more often, and create application-consistent database dumps. Keep at least one copy on storage that is not permanently attached to the Pi, and rehearse restoring to a separate device before an SD card, SSD, or configuration mistake becomes an emergency.
A Raspberry Pi running containers, databases, file stores, dashboards, or home-automation software has two different kinds of state. The operating system and boot files live on the SD card or SSD. Service state changes independently in Docker named volumes, bind-mounted directories, database files, uploaded media, configuration files, and secrets. A backup that captures only one layer can leave you with a bootable Pi that has no application data, or a folder of data that cannot be deployed.
The Raspberry Pi Official Magazine describes a complete SD-card image as the simplest whole-device backup. The raspiBackup project documents full and incremental approaches for ongoing protection. Use those methods together with deployment files and service-specific database procedures rather than treating a container image as a complete backup.
What a self-hosted Raspberry Pi backup must contain
System and boot state
A card or disk image records the partitions, boot configuration, operating-system files, installed packages, permissions, and configuration that exist at the moment of imaging. It is the quickest route back to a known working system after storage failure, but it is a point-in-time snapshot. Any changes made after the image—new uploads, database transactions, certificates, or configuration edits—are absent.
#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.
Deployment and configuration
Keep every file needed to recreate the deployment: Compose files, systemd unit files, reverse-proxy configuration, firewall rules, scripts, package lists, environment files, and documented port mappings. Treat secrets as sensitive material: store them encrypted or in a restricted location, and do not put credentials in a publicly accessible repository.
Persistent service data
Record every bind mount and named volume. Docker’s documentation explains that data in volumes is separate from a container image and that Compose configuration is used to recreate containers. That documentation is written for Docker Desktop, so its Desktop-specific procedures should not be copied as Raspberry Pi instructions; the underlying separation between image, configuration, and persistent data still applies to Docker Engine on a Pi.
Databases and changing records
A database directory is not automatically safe to copy while the database is accepting writes. Use the database and application’s own dump or export procedure, or stop and quiesce the service before copying its files. A dump should be kept with the deployment backup and tested by restoring it into an isolated instance. The correct command depends on the database and application; there is no universal Raspberry Pi command that guarantees a consistent copy of every database.
| Layer | Typical contents | Suitable protection | Recovery use |
|---|---|---|---|
| Whole system | Boot partition, operating system, packages, system configuration | Offline card or SSD image; full dd or tar backup |
Replace failed storage and return to the previous system state |
| Deployment definition | Compose files, environment files, unit files, scripts, proxy configuration | Versioned file backup with restricted permissions | Recreate containers and services after a clean install |
| Application files | Bind-mounted directories, uploads, media, certificates, generated content | Scheduled archive or rsync copy |
Selective file recovery or migration |
| Named volumes | Data stored under Docker-managed volume paths | Service stopped or quiesced, then volume-level backup | Reattach data to recreated containers |
| Database logical data | Tables, users, schema, and transactions | Application-supported dump or export | Consistent database recovery independent of filesystem timing |
| Secrets | Passwords, keys, tokens, certificates | Encrypted, access-controlled copy | Allow services to start without exposing credentials |
Choose a backup mix instead of one all-purpose copy
Each method trades recovery scope, downtime, browsing convenience, and storage history differently.
| Method | What it captures | Downtime and environment | Best use | Main limitation |
|---|---|---|---|---|
| Offline whole-card image | Every partition and file on the card at one instant | Power down the Pi, remove the card, and use another computer with a reader | Fast disaster recovery to replacement media | Large files, infrequent by nature, and awkward for one-file recovery |
tar archive |
Selected paths such as /home/pi or a service directory |
Can run on the Pi; stop services when consistency matters | Portable, browsable file-level snapshots | Only the paths selected are protected; not a complete system by default |
rsync |
Selected files, copying only changes after the first run | Suitable for scheduled copies to mounted storage | Frequent protection with lower bandwidth and time | Requires careful path selection, deletion policy, and permissions |
raspiBackup dd |
Full block-level system backup | Follow the project’s current restore requirements | Full images with configurable history | Restore is tied to device layout and target identification |
raspiBackup tar |
Full file-level system backup | Restore requires Linux; Raspberry Pi OS is recommended by the project | Full backup with file-level handling | Not a block-for-block image |
raspiBackup rsync |
Complete initial backup followed by incremental backups using hard links | Restore through a Linux recovery environment | Retained history without duplicating unchanged files | Hard-link history needs a filesystem and retention plan that support it |
| Application database export | Logical database contents in a consistent format | Use the application’s documented dump or quiescing process | Reliable recovery of frequently changing records | Must be paired with deployment files and compatible software |
Make an offline image of the entire card or boot disk
The Raspberry Pi Official Magazine workflow is intentionally offline. It is appropriate before a major upgrade, after a known-good configuration, or as a periodic disaster-recovery snapshot.
Prepare the imaging workstation
- Have a computer with enough free space for an image as large as the source card or disk.
- Use a compatible USB microSD card reader for an SD-card system, or an enclosure/adapter for USB, SSD, or NVMe media.
- Choose a destination that is not the source device. A second external disk is safer than writing the image back to the card you are reading.
- Plan a filename that includes the date, for example
raspi-$(date +%F).img.
Create the image
- Shut down the Pi cleanly with
sudo shutdown -h nowand wait until activity LEDs stop. Removing storage from a running system risks filesystem corruption. - Remove the SD card or storage device and connect it to the computer.
- List disks with the operating system’s disk utility. On Linux,
lsblk -o NAME,SIZE,MODEL,MOUNTPOINTSis useful. Identify the source by model and capacity, not by a guessed device letter. - Unmount any automatically mounted partitions without ejecting the device.
- Read the entire device. On Linux, an example is
sudo dd if=/dev/sdX of=raspi-$(date +%F).img bs=4M status=progress conv=fsync. Replace/dev/sdXonly after verifying the device listing; selecting the wrong input can read another disk. - Calculate a checksum beside the image with
sha256sum raspi-2026-10-17.img > raspi-2026-10-17.img.sha256. Use the actual date produced by your filename. - Eject the card safely, label the backup with its source and date, and keep a second copy if the image is your only recovery point.
The image contains the system exactly as it was when the Pi was powered off. It does not include work performed after shutdown, so pair it with scheduled protection for databases, uploads, and other rapidly changing data.
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.
Write an image to replacement media
- Connect the replacement card or disk and identify it again by model and capacity.
- Confirm that the target is not the computer’s operating-system disk and that no important partitions are mounted.
- Write the image with an imaging application or a command such as
sudo dd if=raspi-2026-10-17.img of=/dev/sdY bs=4M status=progress conv=fsync. - Run
sync, eject the target, install it in the Pi, and boot with only the intended storage attached where possible. - Check that the operating system boots, then verify containers, mounts, scheduled jobs, and recent data. Restore newer files or database dumps from the more frequent backups.
A mistaken destination can overwrite another partition. The raspiBackup documentation makes the same warning: device assignments can differ between systems, so check the actual assignment immediately before every restore.
Create file-level archives that are easy to browse
Archive a home directory or service path with tar
The Raspberry Pi guide demonstrates a compressed archive of /home/pi. This is convenient for scripts, user configuration, and selected application files, but it is not a complete backup of every service on the Pi.
sudo tar -czf /media/backup/pi-home-$(date +%F).tar.gz -C /home pi
Use a destination mounted with enough space and verify that the archive exists before disconnecting it. To inspect an archive without extracting it, use tar -tzf followed by the archive name. Restore into a temporary directory first when you need to compare files; restore into the original location only after checking ownership and permissions.
Use Déjà Dup for guided scheduling
Déjà Dup provides a graphical way to select folders, choose a local or network destination, schedule recurring backups, and restore either to the original location or to a chosen location. The Raspberry Pi guide mentions local flash storage, SSH, FTP, and Amazon S3 as possible destinations and recommends setting an encryption password in its example. Labels and supported back ends can change between operating-system releases, so confirm the options shown by the version installed on your Pi.
Recommended Free Tools
Include service directories explicitly. Selecting only a home directory will miss data stored under locations such as /srv, /opt, or Docker-managed paths unless you add them. Exclude caches and rebuildable files when appropriate, but never exclude a directory until you know whether it contains user data, a database, or a required secret.
Schedule changed-file copies with rsync
rsync is useful when a full archive every night is too slow or consumes too much space. A basic copy of a service tree to mounted storage is:
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.
sudo rsync -a /srv/ /media/backup/srv/
The trailing slash means copy the contents of /srv. Add --delete only when the destination must exactly mirror the source and you have tested the command without it first; a deletion on the Pi would otherwise propagate to the backup. For a scheduled job, use an absolute path and log output, for example:
30 2 * * * /usr/bin/rsync -a /srv/ /media/backup/srv/ >> /var/log/rsync-backup.log 2>&1
Run the job while the destination is mounted, check its log, and monitor available space. File-level synchronization is not a substitute for an application-consistent database export.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Use raspiBackup for recurring system protection
raspiBackup documents three backup types:
dd: a full block-level backup suitable for restoring the whole storage layout.tar: a full file-level backup.rsync: a complete initial backup followed by incremental backups that use hard links for unchanged files.
The project supports configurable backup history, including a grandfather-father-son rotation pattern, and offers both regular full-system and partition-oriented modes. It lists local USB media, external disks and SSDs, SMB and NFS shares, SSHFS, WebDAV, and other Linux-mountable destinations. It also documents restores to SD cards, USB disks, SSDs, and NVMe SSDs. Exact options and restore steps depend on the current raspiBackup release, the Pi’s boot mode, the storage device, and the selected backup type; use the project’s live documentation when configuring it.
One documented extension can stop Docker containers before a backup and start them afterward. That coordination reduces changes during the filesystem copy, but it does not replace a database’s own dump procedure. A database may still require a logical export or other application-specific consistency step.
Plan retention before enabling schedules
A single latest backup protects against hardware failure but not against discovering that a configuration mistake happened days ago. Retain several generations when storage permits: recent copies for operational mistakes and older copies for unnoticed corruption. Hard-link-based rsync history saves space for unchanged files, while full images consume storage roughly equal to the source device. The documentation does not prescribe a universal capacity or retention number, so base the schedule on how quickly your services change and how far back you need to recover.
Back up Docker services without losing their data
Inventory the deployment
- Save the Compose files and any override files used to start production. Render the effective configuration with
docker compose config > compose-rendered.ymland protect the resulting file if it contains secrets. - List named volumes with
docker volume ls. - For each running container, inspect mount sources and destinations. For a container selected by name, set a shell variable and run
CONTAINER_ID=$(docker ps -q --filter name=my-service | head -n1), thendocker inspect $CONTAINER_ID --format '{{range .Mounts}}{{println .Type .Source .Destination}}{{end}}'. Record whether each mount is a bind mount or a named volume. - Record image tags, exposed ports, networks, restart policies, user IDs, and the host directories used for certificates, media, and backups.
Protect bind mounts and volumes
Back up bind-mounted directories directly, preserving ownership, permissions, symbolic links, and timestamps. Named volumes need an equivalent volume-level backup; copying only the Compose file recreates an empty volume. Stop the relevant container or use the application’s documented quiesce mechanism before copying mutable files. After the copy, check that the archive contains expected directory names and nonzero data files.
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
Do not assume that copying /var/lib/docker while containers are running is safe. It may contain files changing at the moment of the copy, and restoring the entire directory can couple you to a particular Docker installation. A cleaner recovery plan is usually to reinstall the operating system or Docker Engine, recreate containers from the saved deployment files, and restore each volume or bind mount deliberately.
Keep images reproducible
Container images are replaceable build artifacts. Record the exact image tags or digests and retain Dockerfiles, build scripts, and package configuration when you build images locally. The image alone does not contain named-volume data, bind-mounted files, or external databases.
Handle database data as a separate recovery item
Before backing up a service that uses a database, determine whether its documentation supports an online dump, a read-only or maintenance mode, or a clean shutdown. Use that procedure and store the resulting dump with the matching Compose files and application version. If you copy a live database directory without a consistency guarantee, the restored files may contain an incomplete transaction or incompatible journal state.
Crashes, 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 minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Document the restore order: start the database with the required version, import the logical dump, restore application files, then start dependent services. Test authentication, schemas, indexes, and representative records. Keep at least one dump separate from the Pi so a filesystem-level mistake cannot destroy both the database and its backup.
Choose destinations and protect the copies
raspiBackup lists external USB storage, USB SSDs, network shares mounted through SMB or NFS, SSHFS, WebDAV, and other Linux-mountable destinations. A local USB SSD offers convenient throughput, while a network destination keeps a second copy away from the Pi’s power and storage path. Déjà Dup can also target local storage, SSH, FTP, or Amazon S3 according to the Raspberry Pi guide.
- Keep the backup medium disconnected or inaccessible when a scheduled job is not running if practical; this limits damage from accidental deletion or a compromised service.
- Encrypt archives or use an encrypted destination when they contain credentials, private keys, personal records, or database contents.
- Store the encryption password in a separate, recoverable password manager or offline record. An encrypted backup whose password is lost cannot be restored.
- Monitor mount failures. A scheduled command that runs while the destination is absent can write into the Pi’s local filesystem or appear successful without creating the intended copy.
- Label each copy with source device, date, backup type, and software version where relevant.
Restore safely after a failure or bad change
Prepare a separate recovery target
Do not restore over the storage that is currently running the recovery environment. The raspiBackup documentation requires the target device to be separate from the running operating system for its restore process. For tar and rsync restores, use a Linux system; the project recommends Raspberry Pi OS as the recovery environment.
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.
- Connect the replacement SD card, USB disk, SSD, or NVMe device.
- Identify it by physical model, capacity, and the current device listing. Device names can change between boots and between computers.
- Disconnect unrelated disks when possible, unmount target partitions, and verify the source and destination a second time.
- Restore the selected image or raspiBackup set according to its current documentation.
- Boot the Pi with the replacement storage, then check network identity, filesystem mounts, service users, and available space.
- Recreate or start the deployment from the saved Compose and configuration files.
- Restore bind mounts, named volumes, and database dumps in the documented order.
- Rotate credentials if the incident involved unauthorized access or an exposed backup.
Choose the recovery path by incident
- Failed card or disk: flash the latest verified whole-device image to replacement media, then apply newer file and database backups.
- Bad configuration change: restore the affected file or volume from the most recent known-good copy rather than replacing the entire system.
- Corrupted container deployment: reinstall or repair the runtime, recreate containers from Compose, and restore persistent data separately.
- Database corruption: use the last known-good logical dump or application export, even if the operating-system image is newer.
- Unknown compromise: treat the old system as untrusted, reinstall from clean media, rotate secrets, and restore only inspected data.
Test a restore before you need one
A backup is an assumption until a restore works. Use a spare card or disk and a compatible reader to perform a limited drill. For an image, boot the spare device and confirm that the Pi reaches the operating system. For file-level backups, install a clean system, recreate the deployment, restore a sample volume and database dump, and verify that users can log in and that recent records and uploads are present.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Record the time required, the commands used, missing dependencies, and any permissions that needed correction. Update the runbook while the details are fresh. Do not claim a universal restore-success rate or duration: the result depends on storage, service size, network speed, and the backup method.
Troubleshoot common recovery failures
| Symptom | Likely cause | Correction |
|---|---|---|
| The restored Pi boots but a service has no data | The backup included the container definition but not its volume or bind mount | Map every mount, restore the missing path, and recreate the container with the same destination path |
| Containers start and immediately stop | Missing environment file, secret, network, permission, or incompatible image tag | Compare the saved Compose configuration, logs, image version, user IDs, and file ownership |
| Database reports journal or transaction errors | A live data directory was copied without quiescing or a logical dump | Restore the application-consistent dump or repeat the backup with the database’s documented procedure |
| Restore command targets the wrong disk | Device assignments changed or the listing was not checked | Stop immediately, re-list devices by model and capacity, and never assume a letter such as /dev/sdX is stable |
| Scheduled backup appears successful but files are missing | The destination was not mounted and the job wrote locally, or the source path was incomplete | Check mount state, absolute paths, logs, free space, and archive contents; add a mount check to the job |
| Restored files are inaccessible | Ownership, group IDs, ACLs, or permissions changed during copying | Preserve metadata where supported and recreate the service users or correct ownership before startup |
| Incremental history consumes unexpected space | Retention is too long, files change frequently, or the destination filesystem handles hard links poorly | Review retention, confirm hard-link support, and use full archives or a different destination when appropriate |
A practical maintenance schedule
Take a full image after the Pi is configured and working, and repeat it after significant operating-system or storage changes. Run file-level synchronization frequently enough for the amount of data you can afford to recreate. Schedule database exports according to transaction volume, then retain several generations. Keep deployment files under version control or another protected history, and copy the latest verified set away from the Pi.
Once per cycle, confirm that the backup destination is readable, inspect archive listings, verify checksums for images, and perform a small restore. A backup job that has not been monitored can fail silently because a cable was unplugged, a network share expired, or storage filled.
Pre-failure checklist
- Can you identify the Pi’s current boot device and its replacement?
- Do you have a recent whole-device image stored separately from the Pi?
- Are Compose files, environment files, scripts, and image versions saved?
- Have you listed every bind mount and named volume?
- Are database dumps created with the application’s consistency procedure?
- Can you access the encryption password and the backup destination?
- Have you tested restoring to a separate card, SSD, or Linux recovery system?
- Does the written runbook warn you to verify the target device before using
ddor a restore tool?
raspiBackup’s rationale is concise: “A regular backup of Raspberry Pis is important in case of a failure of the system storage device (SD card, USB disk, SSD, NVMe …) or an unintentional change that causes the system to no longer boot or to boot incorrectly, to be able to recover and reset the system to a previous state.” That principle applies especially to self-hosted services, where the operating system, deployment definition, persistent files, and database contents must all be recoverable together.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
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.

