Containers

Best Docker Containers for Home Server

Many are delving into learning containers and Kubernetes. With this, having your own home lab environment is especially valuable in tinkering and setting up an environment for learning. This post will focus on the best Docker containers for home server environments and see which solution provides an easy way to get up and running with Docker containers to learn.

What are containers?

Even though containers have been around for quite some time in the Linux world, there started to be huge interest, and an uptick in container adoption after the virtualization and physical to server consolidation movement started to slow. Also, the huge adoption of cloud and cloud-native processes and applications created a shift among enterprises to rearchitect their monolithic applications and transition to microservices. Microservices allow developers to more aggressively release application enhancements as larger overall applications are broken into individual services. These are most often run inside containers.

Unlike virtual machines, containers are fully contained application environments that have all the dependencies rolled up inside the container so the application can run without any other requirements using the container. With this advantage, containers running on one system can be moved to another without worrying about the dependencies being met.

Containers are also more DevOps friendly as, due to their smaller size, they can be instantiated much more quickly than virtual machines and allow introducing idempotency for lifecycle management. Containers can be spun up, serve their purpose, and destroyed without worry about upgrades and other lifecycle operations with virtual machines.

What is Docker?

Docker is arguably the de facto standard in container technology and is THE solution that is most often used in containerized environments.

It is an open platform for developing, shipping, and running applications, allowing you to separate applications from your infrastructure. As mentioned earlier, this allows delivering software quickly. Docker provides an implementation of containers with a rich toolset that allows:

  • Developing your application and supporting components
  • Distribute and test your applications
  • Allows implementing containers easily as part of your CI/CD pipeline

Note the following architecture and Docker components:

Docker architecture and components
Docker architecture and components

What is Kubernetes?

We can’t have a post about Docker and containerization without mentioning Kubernetes. What is Kubernetes, and why should you care when thinking about the best Docker containers for home server? Kubernetes is a container orchestration platform that takes care of your containerized applications’ management and high availability.

When you learn containers and get started with the best Docker containers for home server, your journey will probably not stop there. You will want to not only run containers, but at some point, you will want those containers to have all the features and capabilities found in enterprise environments for business-critical workloads.

Kubernetes provides container orchestration
Kubernetes provides container orchestration

Although there are vast technical differences, I like to conceptually think about Kubernetes benefits as similar to an enterprise hypervisor (which it is not). However, the similarities with Kubernetes in my mind come with the management and orchestration your enterprise hypervisor does today, like resource scheduling and availability, which are part of what Kubernetes brings to the table with your containers.

Keep in mind that containers in an of themselves are not highly available or orchestrated in any way. So, if the host goes down where the container is running, your containers will go down as well along with it. Kubernetes creates a cluster of resources that schedules and watches containers ensuring there are multiple replicas and these are orchestrated by the Kubernetes control plane.

Best Docker Containers for Home Server Infrastructure

In thinking about the best docker containers for home server, take note of my recommendations on running Docker containers for home server environments. These are the easiest ways to run your Docker containers.

  1. Docker Desktop or Windows Subsystem for Linux (WSL)
  2. Standalone virtual machine with Docker installed
  3. Virtual Machine with Portainer
  4. Kubernetes cluster using Rancher and Rancher Desktop
  5. Synology NAS

1. Docker Desktop or Windows Subsystem for Linux (WSL)

Docker Desktop provides a super easy way to run Docker containers on a workstation machine. You can simply install Docker Desktop and use it for a graphical interface for running your Docker containers in Windows, Linux, or macOS.

You can think of Docker Desktop like running VMware Workstation on your desktop. It provides an easy way to download, configure, and play around with Docker containers in an environment that is intuitive and easy to use. It includes a graphical GUI wrapper to interact with your containers.

Learn more about Docker Desktop here and download it for your operating system:

On Windows machines, another great tool is installing Docker in Windows Subsystem for Linux (WSL). WSL is built into Windows 10 & 11 and can easily be used to house Docker. Note my post here:

2. Standalone virtual machine with Docker installed

One of the easiest ways to play around with Docker is running a standalone virtual machine with Docker installed. This is a great option, especially if you have a lab environment you run 24x7x365 or an environment where you want to run your Docker environment more than you run your workstation.

With VMs, you also have access to virtual machine snapshots which are a great tool in the learning environment. They provide an easy point-in-time to roll back to when needed.

At this point, in my home lab, I have upgraded my Packer template to Ubuntu 22.04. I am using Ubuntu with Docker installed. You can take a look at some of my relevant posts below:

Once you have your virtual machine up and running, it is as simple as getting Docker installed. You can find the relevant post covering installing Docker in Ubuntu here:

3. Virtual machine with Portainer

Another great option for best Docker containers for home server environments is using Docker installed and then using Portainer to manage your Docker environment. Portainer itself runs as a Docker container. So the workflow is to install your virtual machine, then Docker, and then install Portainer as a container to manage the environment. Portainer is open source and free with the community edition

Read my full walkthrough of installing Ubuntu 22.04 prerequisites and installing Portainer. I also covered how to upgrade your existing Portainer installation here:

4. Kubernetes cluster using Rancher and Rancher Desktop

Rancher is another really great free open source solution that allows having a solution to easily spin up Kubernetes clusters to manage your Docker containers. With Rancher, you have a fully GUI-driven web interface allowing you to create and manage your Docker containers and Kubernetes clusters.

In addition to a full server installation, Rancher has a Rancher Desktop tool that is new. It is the equivalent to Docker Desktop. However, it is only in the early stages of development so is a bit shy on features at this time. However, it will undoubtedly become better and better as a local development tool.

Read my Rancher and Rancher Desktop posts here:

5. Synology NAS

If you are like me, you didn’t even realize you had the ability to run Docker on your Synology NAS device. However, it is a real thing and you can easily install the Synology Docker app and use this to create and manage your Docker containers on your Synology NAS device. If you are already running a Synology NAS at home, you can use it for Docker. For many, this may be the best docker containers for home server solution.

Below, you can see the Docker app displayed in the Synology Package Center.

Install Docker on your Synology NAS device
Install Docker on your Synology NAS device

Best Containers for home server – Top Picks

Let’s look at a few Docker containers with Docker compose examples to show how to easily spin these up and spin up multiple containers at once on your Docker host. Note the following:

  1. Pi-Hole or Adguard
  2. Portainer
  3. Traefik or other reverse proxy
  4. Nginx Proxy Manager
  5. VPN container
  6. Media Server containers (Plex media server, etc)
  7. Home Assistant
  8. Watchtower
  9. Homarr or Dashy dashboard
  10. Ansible Semaphore

There are many other docker containers you can run. These are just a list of common and excellent solutions to get started with for home server beginners. Remember to troubleshoot your code if any failures happen, check container logs, including Docker logs for errors, etc.

The following code may need to be tweaked for your environment, but the Compose code shows the Docker images for self-hosting the containers inn your environment.

1. Pi-hole or Adguard

Running Pi-hole or Adguard allows quickly squashing ads and other unwanted network traffic in your home network or home lab. Note the following Docker run command to spin up Adguard:

version: '3.8'
services:
  adguard:
    image: adguard/adguardhome
    container_name: adguard
    restart: always
    network_mode: host
    volumes:
      - /path/to/adguard/config:/opt/adguardhome/work
    environment:
      - TZ=<your_timezone> # Set your timezone, e.g., "America/New_York"

For Pi-hole, note the following Docker Compose code for your own server (your Docker server)

 pihole:
    image: pihole/pihole:latest
    container_name: pihole
    ports:
      - "53:53/tcp"
      - "53:53/udp"
    dns:
      - 127.0.0.1
      - 1.1.1.1
    environment:
      TZ: 'America/New York'
      WEBPASSWORD: 'password'
      PIHOLE_DNS_: 1.1.1.1;9.9.9.9
      DNSSEC: 'false'
      WEBTHEME: default-dark
    volumes:
      - '~/pihole/pihole:/etc/pihole/'
      - '~/pihole/dnsmasq.d:/etc/dnsmasq.d/'
    restart: always

2. Portainer

Portainer is arguably the best Docker container management solution. Use the following code for spinning up a new Portainer Community Edition instance:

version: "3"
services:
  portainer:
    image: portainer/portainer-ce:latest
    ports:
      - 9443:9443
      volumes:
        - data:/data
        - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped
volumes:
  data:

3. Traefik or other reverse proxies

Using a reverse proxy is a great way to secure your Docker environment and even manage certificates. To spin up the well-known Traefik solution, use the following:

version: '3.3'

services:
  traefik2:
    image: traefik:latest
    restart: always
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=true"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    container_name: traefik

4. Nginx Proxy Manager

Nginx Proxy Manager is another great reverse proxy solution that also allows you to manage certificates and has a really great WebUI for managing your web server configuration. Use the following code to spin up a new Nginx Proxy Manager instance:

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

5. VPN container or other VPN solution

Running your VPN solution in a container is a great way to quickly spin up a VPN solution for your home lab for remote access. There are many solutions out there. One in particular you can easily spin up is Tailscale.

services:
    tailscale: 
      container_name: tailscale 
      hostname: tailscalehost 
      image: tailscale/tailscale:stable 
      volumes: 
        - ./tailscale:/var/lib # State data will be stored in this directory 
        - /dev/net/tun:/dev/net/tun
      cap_add: 
        - net_admin 
        - sys_module 
      command: tailscaled 
      privileged: true 
      restart: unless-stopped

6. Media Server container

Many run media servers as part of their home network. Plex Media Server is a great solution. You can spin up a Plex server via Docker compose this way:

version: '3.8'
services:
  plex:
    image: plexinc/pms-docker
    container_name: plex
    restart: always
    network_mode: host
    environment:
      - PLEX_CLAIM=<your_plex_claim_token>
      - PLEX_UID=<your_desired_plex_uid>
      - PLEX_GID=<your_desired_plex_gid>
    volumes:
      - /path/to/plex/config:/config
      - /path/to/plex/data:/data
      - /path/to/plex/transcode:/transcode

7. Home Assistant

Home Assistant is a great solution for home automation and Smart Home technology. You can spin it up this way:

version: '3.8'
services:
  homeassistant:
    image: homeassistant/home-assistant
    container_name: home_assistant
    restart: always
    network_mode: host
    volumes:
      - /path/to/homeassistant/config:/config
    environment:
      - TZ=<your_timezone> # Set your timezone, e.g., "America/New_York"

8. Watchtower

Watchtower is a management container that watches other containers and when new versions arrive, it automatically stops existing containers and spins up new containers with the newest image using the existing configuration.

version: '3.8'
services:
  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --cleanup --interval 3600

9. Homarr or Dashy Dashboard

Home lab dashboards are a great way to see and visualize services running in the home lab. Two of my favorites are Homarr and Dashy.

Homarr can be provisioned by the following:

version: '3'
#---------------------------------------------------------------------#
#     Homarr - A simple, yet powerful dashboard for your server.     #
#---------------------------------------------------------------------#
services:
  homarr:
    container_name: homarr
    image: ghcr.io/ajnart/homarr:latest
    restart: always
    volumes:
      - ./homarr/configs:/app/data/configs
      - ./homarr/icons:/app/public/icons
    ports:
      - '7575:7575'

Dashy is configured using:

---
# Welcome to Dashy! To get started, run `docker compose up -d`
# You can configure your container here, by modifying this file
version: "3.8"
services:
  dashy:
    container_name: Dashy

    # Pull latest image from DockerHub
    image: lissy93/dashy

    # To build from source, replace 'image: lissy93/dashy' with 'build: .'
    # build: .

    # Or, to use a Dockerfile for your archtecture, uncomment the following
    # context: .
    # dockerfile: ./docker/Dockerfile-arm32v7

    # You can also use an image with a different tag, or pull from a different registry, e.g:
    # image: ghcr.io/lissy93/dashy or image: lissy93/dashy:arm64v8

    # Pass in your config file below, by specifying the path on your host machine
    # volumes:
      # - /path/to/my-config.yml:/app/public/conf.yml
      # - /path/to/item-icons:/app/public/item-icons

    # Set port that web service will be served on. Keep container port as 80
    ports:
      - 4000:80

    # Set any environmental variables
    environment:
      - NODE_ENV=production
    # Specify your user ID and group ID. You can find this by running `id -u` and `id -g`
    #  - UID=1000
    #  - GID=1000

    # Specify restart policy
    restart: unless-stopped

    # Configure healthchecks
    healthcheck:
      test: ['CMD', 'node', '/app/services/healthcheck']
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s

10. Ansible Semaphore

Ansible Semaphore is a solution I recently discovered that provides an excellent GUI dashboard for Ansible. It allows running automated tasks, etc, for your Ansible environment.

services:
  # uncomment this section and comment out the mysql section to use postgres instead of mysql
  #postgres:
    #restart: unless-stopped
    #ports:
      #- 5432:5432
    #image: postgres:14
    #hostname: postgres
 #volumes:
    #  - semaphore-postgres:/var/lib/postgresql/data
    #environment:
    #  POSTGRES_USER: semaphore
    #  POSTGRES_PASSWORD: semaphore
    #  POSTGRES_DB: semaphore
 # if you wish to use postgres, comment the mysql service section below
  mysql:
    restart: unless-stopped
    ports:
      - 3306:3306
    image: mysql:8.0
    hostname: mysql
    volumes:
      - semaphore-mysql:/var/lib/mysql
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
      MYSQL_DATABASE: semaphore
      MYSQL_USER: semaphore
      MYSQL_PASSWORD: 'password'
  semaphore:
    restart: unless-stopped
    ports:
      - 3000:3000
    image: semaphoreui/semaphore:latest
    environment:
      SEMAPHORE_DB_USER: semaphore
      SEMAPHORE_DB_PASS: 'password'
      SEMAPHORE_DB_HOST: mysql # for postgres, change to: postgres
      SEMAPHORE_DB_PORT: 3306 # change to 5432 for postgres
      SEMAPHORE_DB_DIALECT: mysql
      SEMAPHORE_DB: semaphore
      SEMAPHORE_PLAYBOOK_PATH: /tmp/semaphore/
      SEMAPHORE_ADMIN_PASSWORD: changeme
      SEMAPHORE_ADMIN_NAME: admin
      SEMAPHORE_ADMIN_EMAIL: [email protected]
      SEMAPHORE_ADMIN: admin
      SEMAPHORE_ACCESS_KEY_ENCRYPTION: <encryption key>
      SEMAPHORE_LDAP_ACTIVATED: 'no' # if you wish to use ldap, set to: 'yes'
      SEMAPHORE_LDAP_HOST: dc01.local.example.com
      SEMAPHORE_LDAP_PORT: '636'
      SEMAPHORE_LDAP_NEEDTLS: 'yes'
      SEMAPHORE_LDAP_DN_BIND: 'uid=bind_user,cn=users,cn=accounts,dc=local,dc=shiftsystems,dc=net'
      SEMAPHORE_LDAP_PASSWORD: 'ldap_bind_account_password'
      SEMAPHORE_LDAP_DN_SEARCH: 'dc=local,dc=example,dc=com'
      SEMAPHORE_LDAP_SEARCH_FILTER: "(\u0026(uid=%s)(memberOf=cn=ipausers,cn=groups,cn=accounts,dc=local,dc=example,dc=com))"
    depends_on:
      - mysql # for postgres, change to: postgres
volumes:
  semaphore-mysql: # to use postgres, switch to: semaphore-postgres

Best Docker containers for Home Server FAQs

  • What are containers? Containers are self-contained application environments that are small in size, flexible, easily to install, and portable. They provide many benefits over virtual machines in enterprise environments.
  • What is Docker? Docker is arguably the dominant leader in production container technology and ran in more data centers than any other container platform. They are the most mature container technology on the market and provide the most capabilities and tools for development and infrastructure.
  • What is Kubernetes? Kubernetes is the premiere container orchestration platform used today. It has undoubtedly won the lion’s share of the container orchestration market and is THE technology to use to orchestrate and manage your containerized workloads.
  • What is the best Docker containers for home server? This is up to you. There are many options available that allow running containers on a local workstation environment (Docker Desktop, WSL2, and Rancher Desktop). There are also many server technologies that allow running Docker containers and provide feature-rich capabilities. These include Portainer, Rancher, and others.

Wrapping Up

Hopefully this look at the best Docker containers for home server post will help any get started in working with and using containers if you haven’t already spun up an environment to do so. The five options I presented in the post are by no means the only options out there. They are options I have used personally and have had good success with. If you have other technologies you like to use, please let me and others know in the comments section.

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com and has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family.

Related Articles

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.