What to back up (and what not)
In this lesson I start a small self-hosted service, give it some data and decide what to backup and what not to. At the end you have the service running and a written backup plan. The rest of the course turns that plan into scripts and tests it. Before you start you need Docker with Compose version 2 from Docker Desktop, Kolima or Orbstack. stack. You also need a JQ and Mac OS 26 or later for the disk image commands in module 2. One command checks compose. The service lives in a small git repository called Homelab Backup. It has one commit, a compose file, a readme, and one script that adds the sample data. The compose file defines two services. The first is the database, a PostgreSQL 18.6 pinned to an exact tag. Its files live in a named volume called dbdata. The password comes from a variable, db.passworder. If it is not set, compose refuses to start. The second service is the app Forgio 17.0.1, a GitForge also pinned. Its repositories, avatars and settings live in a second named volume app data. It listens only on localhost port 3300. So everything that changes while the service runs sits in two places. the db data volume and the app data volume everything else is in this repository the passwords go in a file called env next to the compose file git ignores it together with the backups folder and log files so no password ends up in the repository I create the env file with two random passwords one for the database and one for the admin user and make it readable only by me. Keep a copy of this file in your password manager. It is not in Git and it will not be in the backups either. Now I start the stack. The wait flag returns only when both containers are running and the database answers its health check. I downloaded the two images before recording. Compose creates a network, the two volumes and the two containers. The seed script creates an admin user called student, three repositories and three issues, through Forger's own command line tool and its web API, the interface that programs use. This is the data the rest of the course protects. Here are the two volumes that hold that data. Docker labels every volume with its compose project, so this filter shows only the volumes of Homelab backup. The database files take about 70 MB and the app files less than 1. The sizes are small but the rules are the same for a large service. What does not need a backup? The images. Their tags are pinned, so Docker pulls exactly the same ones again, Compose lists them. I write a plan down in the repository so it is versioned with the service. Two things are backed up every night, a dump of the database and an archive of the app data volume which also holds a Forgeos settings file with its secret keys. The compose file and scripts are in git, the passwords are in a password manager, images, logs and caches are not backed up. That is the plan, two volumes to protect, one secrets file to keep somewhere else and everything else in git or pulled again from my registry