The Privacy Diet code · Part 3 — Your Home Network
Chapter 9 Self-Hosting: Owning Your Stack
Tutorials for this chapter: Docker and Compose, Properly Installed , Installing Ubuntu Server for a Home Lab , SSH: Key-Only Login and Sensible Hardening
Installing Docker
# p. 88
# On Debian/Ubuntu (recommended base OS for a homelab server):
curl -fsSL https://get.docker.com | sh
# Add your user to the docker group (so you don't need sudo):
sudo usermod -aG docker $USER
# Verify installation:
docker run hello-world Deploying Vaultwarden (Example)
# p. 88
In its own folder, e.g. ~/vaultwarden/.
# docker-compose.yml
services:
vaultwarden:
image: vaultwarden/server:latest
container_name: vaultwarden
restart: unless-stopped
volumes:
- ./vw-data:/data
environment:
- SIGNUPS_ALLOWED=true # set to false once your account exists
ports:
- 8080:80 Be Your Own Cloud, Chapter 11, has an updated version of this file →
# p. 89
# Start the service:
docker compose up -d
# View logs:
docker compose logs -f
# Update to latest version:
docker compose pull && docker compose up -d Backups: The Part Everyone Skips
# p. 90
# Install restic:
sudo apt install restic
# Initialise a backup repository (example: Backblaze B2):
restic -r b2:your-bucket-name init
# Run a backup:
restic -r b2:your-bucket-name backup /path/to/your/data # Schedule with cron (daily at 2am):
0 2 * * * restic -r b2:your-bucket-name backup /path/to/data >> /var/log/restic.log 2>&1 Be Your Own Cloud, Chapter 18, builds this into a full 3-2-1 backup script →
Reproduced exactly from The Privacy Diet, Chapter 9. The book explains what each line does and what to do when it doesn't work. About the book
Something here not working as the book describes? Tell the author.