Skip to content

Docker Compose Stacks for Home Labs: Your Copy-Paste Blueprint

This page may contain affiliate links.

Ever found yourself juggling multiple applications on your home server, each with its own dependencies, conflicting ports, and installation headaches? You’re not alone. Building out a home lab can feel like a part-time job, but what if there was a way to deploy complex application stacks with just a few commands? Enter Docker Compose. This isn't just about running containers; it’s about orchestrating them, making your home lab deployments reproducible, scalable, and incredibly easy to manage. Forget endless setup guides – we're going for copy-paste simplicity to get your essential services up and running in minutes.

Why Docker Compose is Your Home Lab's Best Mate

Docker, at its core, allows you to package applications and their dependencies into lightweight, portable containers. But when you want to run several related containers – say, a media server, a download client, and a VPN – managing them individually can quickly become cumbersome. That's where Docker Compose shines. It's a tool for defining and running multi-container Docker applications. You describe your entire application stack in a single YAML file, and Compose does the heavy lifting, creating networks, attaching volumes, and spinning up all your services in the correct order.

Here’s why it’s a game-changer for home labs:

  • Simplicity: Define complex setups in one readable file.
  • Reproducibility: Recreate your entire lab environment on any Docker-enabled machine.
  • Isolation: Each service runs in its own container, preventing conflicts.
  • Easy Updates: Update an entire stack with a single command.
  • Portability: Move your services between different hosts with ease.

Getting Started: Prerequisites and First Steps

Before you can unleash the power of Docker Compose, you need Docker installed on your home lab server. This could be a dedicated mini-PC, an old desktop, or even a trusty Raspberry Pi 4 (with a fast external SSD for storage!).

Installing Docker and Docker Compose (Quick Guide)

Most Linux distributions can install Docker with a few commands. For a typical Ubuntu/Debian setup:

# Install Docker Engine
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y

# Add your user to the docker group to run without sudo (log out and back in after)
sudo usermod -aG docker $USER

# Install Docker Compose (as of Docker Engine 1.13.0, Compose V2 is included with Docker Desktop and CLI)
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose

# Verify installation
docker --version
docker compose version

Your First Compose Stack: Hello World!

To use Docker Compose, you typically create a directory for your project, then place a file named docker-compose.yml inside it. Here’s a basic example:

version: '3.8'
services:
web:
image: nginx:latest
ports:
- "80:80"

Save this as docker-compose.yml. Then, in the same directory, run:

docker compose up -d

This command builds, creates, starts, and attaches to containers for your service, running them in detached mode (-d) in the background. Navigate to your server's IP address in a browser, and you should see the Nginx welcome page!

To stop and remove the containers:

docker compose down

Essential Home Lab Stacks (Copy-Paste Ready)

Now for the good stuff! Here are some practical Docker Compose stacks you can copy, paste, and tweak for your own home lab.

1. Media Server Stack: Jellyfin & qBittorrent

This stack sets up a complete media solution: Jellyfin (a fantastic open-source media server, similar to Plex) and qBittorrent (a popular torrent client). Make sure to replace /path/to/jellyfin/config and /path/to/media with actual paths on your server where you want to store configuration and media files, respectively. You'll also need to find your PUID and PGID (usually 1000 for standard users) to ensure correct file permissions.

version: '3.8'

services:
jellyfin:
image: linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- JELLYFIN_PublishedServerUrl=http://your-server-ip:8096 # Optional: Set if behind a reverse proxy
volumes:
- /path/to/jellyfin/config:/config
- /path/to/media/tvshows:/data/tvshows
- /path/to/media/movies:/data/movies
- /path/to/downloads:/data/downloads # Link to qBittorrent downloads
ports:
- 8096:8096 # Web UI
- 8920:8920 # HTTPS (optional, if you enable it in Jellyfin)
- 7359:7359/udp # DLNA
- 1900:1900/udp # DLNA Discover
restart: unless-stopped

qbittorrent:
image: linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- WEBUI_PORT=8080
volumes:
- /path/to/qbittorrent/config:/config
- /path/to/downloads:/data/downloads # Same path as Jellyfin's download volume
ports:
- 8080:8080 # Web UI
- 6881:6881 # Torrent port
- 6881:6881/udp # Torrent port UDP
restart: unless-stopped

After saving as docker-compose.yml, run docker compose up -d. Access Jellyfin at http://your-server-ip:8096 and qBittorrent at http://your-server-ip:8080. The default qBittorrent credentials are admin for username and adminadmin for password.

2. Monitoring & Management: Portainer & Uptime Kuma

Keep an eye on your containers and services with this essential stack. Portainer provides a fantastic web-based GUI for managing your Docker environment, while Uptime Kuma is a self-hosted monitoring tool that sends notifications if your services go down.

version: '3.8'

services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /path/to/portainer/data:/data
ports:
- 9000:9000 # Portainer Web UI
- 8000:8000 # Edge agent
restart: unless-stopped

uptime-kuma:
image: louislam/uptime-kuma:latest
container_name: uptime-kuma
volumes:
- /path/to/uptime-kuma/data:/app/data
ports:
- 3001:3001 # Uptime Kuma Web UI
restart: unless-stopped

Deploy with docker compose up -d. Portainer will be at http://your-server-ip:9000 (you'll set up an admin user on first run), and Uptime Kuma at http://your-server-ip:3001. Start monitoring your critical home lab services!

Speaking of getting things done efficiently, building out and managing a home lab involves a lot of scripting, troubleshooting, and documentation. If you're looking for a shortcut to some of these more labour-intensive tasks, check out our Home Lab & Automation Pack. It offers ready-made AI prompts specifically designed to help you script, troubleshoot, and document your home lab setups more effectively, starting from just £9. It's the done-for-you version of streamlining your home lab efforts.

3. Network-Wide Ad Blocking: AdGuard Home

Ditch those pesky ads across your entire network with AdGuard Home. This DNS-based ad blocker is simple to set up and highly effective. You'll need to configure your router or individual devices to use your server's IP address as their primary DNS server after deployment.

version: '3.8'

services:
adguardhome:
image: adguard/adguardhome:latest
container_name: adguardhome
volumes:
- /path/to/adguardhome/work:/opt/adguardhome/work
- /path/to/adguardhome/conf:/opt/adguardhome/conf
ports:
- 53:53/tcp # DNS TCP
- 53:53/udp # DNS UDP
- 80:80/tcp # Web UI setup
- 443:443/tcp # Web UI (HTTPS, once configured)
- 3000:3000/tcp # Web UI (Fallback, in case 80/443 are busy)
restart: unless-stopped

After running docker compose up -d, navigate to http://your-server-ip:80 to complete the initial setup. Once configured, you can then point your network's DNS to your server's IP. Remember that port 80/443 might conflict with other services like Nginx or Apache if they are running directly on your host.

Next Steps: Customisation, Security, and the Open Road

These copy-paste stacks are just the beginning! Here are a few tips to take your Docker Compose game to the next level:

  • Volume Persistence: Always map volumes (like /path/to/config:/config) to store your application data outside the container. This ensures your data isn't lost if the container is recreated or deleted.
  • Environment Variables: Most Docker images use environment variables (e.g., PUID, PGID, TZ) for configuration. Check the image documentation on Docker Hub for a full list of options.
  • Custom Networks: For more complex setups, create dedicated Docker networks to isolate services or facilitate inter-container communication.
  • Reverse Proxy: For accessing multiple services on ports 80/443 with custom domains (e.g., jellyfin.mylabs.com), consider adding a reverse proxy like Nginx Proxy Manager or Traefik to your stack.
  • Security: Never expose unnecessary ports to the internet. If you need remote access, use a VPN or a secure reverse proxy.

Conclusion

Docker Compose transforms the daunting task of building a home lab into an enjoyable, efficient process. By leveraging these copy-paste stacks, you can quickly deploy powerful services, free up your time, and spend more energy experimenting with new technologies rather than troubleshooting installations. So go on, get stuck in, choose your next project, and watch your home lab flourish with the simplicity and power of Docker Compose!

Written by

Richard Tucker

View all posts →