3.0 KiB
Home Server Setup
This is the docker based home server setup for a ubuntu server machine running on proxmos on my N100 mini computer.
The traefik proxy does not run on this machine but it's own LXC container on proxmox, there is a small script to sync it from there to here so I can have it all on one git repo.
Stop home assistant first if jellyfin isn't starting.
Check the wiki here for more information: wikimd/wiki/homepage.md
Drives (view from the ubuntu guest)
| Device | Size | Mount Point | Usage |
|---|---|---|---|
| sda | 1.2TB | / (root) |
System disk |
| sdb | 4.5TB | /media/extension |
Media storage (Jellyfin/Samba) |
| sdc | 3.4TB | /media/ssd |
Additional Samba shares |
Backup Strategies
Two scripts handle backups. Both must be run as root (sudo) because the backup destination is owned by root.
File Backup — backup.sh
Incremental rsync snapshot backup of /home/oster/server to the extension drive.
- Destination:
/media/extension/backup/ubuntu/ - Method: Hard-link incremental snapshots (
--link-dest) — each daily run creates a newYYYY-MM-DD/directory; unchanged files are hard-linked from the previous snapshot, so each snapshot looks complete but only new/changed files consume extra space. - Retention: Configurable at the top of the script:
readonly KEEP_DAILY=3 # keep this many daily snapshots readonly KEEP_WEEKLY=2 # keep this many weekly (Sunday) snapshots - Exclusions:
.cache,node_modules,*.tmp, and DB-related directories (postgresql,mysql,db,database) — those are handled separately bybackup-db.sh. - Locking: A lockfile at
/media/extension/backup/ubuntu/.backup.lockprevents concurrent runs. Stale locks (from crashed runs) are detected by PID check and removed automatically.
Run manually:
sudo ./backup.sh
Cron example (daily at 04:00, in root's crontab via sudo crontab -e):
0 4 * * * /home/oster/git/homeserver/backup.sh >> /var/log/backup.log 2>&1
Database Backup — backup-db.sh
Dumps all PostgreSQL databases from running Docker containers using pg_dumpall.
-
Destination:
/home/oster/server/backup/(on the system disk, picked up bybackup.shon the next run) -
Databases backed up:
Container DB User Label immich_postgrespostgresimmichauthentik-postgresql-1authentikauthentikpaperless-db-1paperlesspaperless -
Output format:
YYYY-MM-DD_HH:MM:SS-<label>.sql.gz(gzip-compressed SQL dump) -
Retention: Dumps older than 7 days are automatically deleted.
Run manually:
sudo ./backup-db.sh
Cron example (daily at 03:30, before the file backup):
30 3 * * * /home/oster/git/homeserver/backup-db.sh >> /var/log/backup-db.log 2>&1