Published on

How to Set Up a Docker Home Server: A Beginner’s Guide

Docker allows you to set up a home server by creating isolated environments called containers that run specific software like media servers or file storage. By following a standard installation on a modern Linux system, you can deploy your first application in less than 15 minutes without worrying about conflicting software dependencies. This setup provides a stable foundation for hosting private clouds, home automation, and development environments on a single piece of hardware.

What are the prerequisites for a Docker home server?

Before starting, you need a computer to act as your server. While many people use a Raspberry Pi 5, any old laptop or desktop with at least 4GB of RAM will work perfectly.

You should have the following ready:

  • A clean installation of Ubuntu 26.04 LTS (a popular, beginner-friendly Linux operating system).
  • A stable internet connection.
  • Basic comfort using the Terminal (the text-based interface for giving commands to your computer).

How do you install Docker on Ubuntu 26.04?

Setting up Docker involves adding the official software repository (a digital storage location for software packages) to your system. This ensures you receive the latest security updates directly from the developers.

Step 1: Update your system packages. Open your terminal and run the following command to make sure your existing software is current.

# Update the list of available packages and upgrade them
sudo apt update && sudo apt upgrade -y

Step 2: Install necessary helper tools. Docker requires a few small utilities to manage secure connections and software certificates.

# Install tools for handling HTTPS and certificates
sudo apt install ca-certificates curl gnupg -y

Step 3: Add Docker’s official GPG key. A GPG key (GNU Privacy Guard - a way to verify that software is authentic) ensures you aren't downloading malicious code.

# Create a directory for keys and download Docker's key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Step 4: Set up the repository. This command tells your computer exactly where to look for Docker Engine version 30.x or higher.

# Add the Docker repository to your system sources
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 5: Install Docker Engine. Now you can install the actual Docker software.

# Update the package list again and install Docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

How do you verify the installation?

It is normal to feel uncertain if everything worked correctly. You can check the status of Docker by running a small test image (a lightweight, read-only template used to create a container).

Run this command:

# Run the hello-world test container
sudo docker run hello-world

If you see a message saying "Hello from Docker!", your installation is successful. This confirms that the Docker Engine successfully contacted the Docker Hub (a massive online library of container images) and ran the software.

Why should you use Docker Compose?

Docker Compose is a tool that lets you define and run multi-container applications using a simple text file. Instead of typing long, complex commands every time you want to start a service, you list your settings in a YAML file (Yet Another Markup Language - a human-readable format for configuration).

We've found that using Compose is the best way to keep your home server organized as you add more services. It allows you to track exactly which folders on your hard drive are linked to which containers.

How do you run your first home server app?

Let's set up a dashboard called "Homepage." This will give you a nice visual interface to view all the services running on your server.

Step 1: Create a project folder. Keeping your files organized is vital for a stable server.

# Create a directory for your dashboard and move into it
mkdir ~/homelab && cd ~/homelab
mkdir homepage && cd homepage

Step 2: Create the configuration file. You will create a file named docker-compose.yml. You can use a text editor like Nano to do this.

# Open a new file in the Nano text editor
nano docker-compose.yml

Step 3: Paste the configuration. Copy and paste the following code into the editor.

services:
  homepage:
    image: ghcr.io/gethomepage/homepage:latest # Use the latest version of Homepage
    container_name: homepage
    ports:
      - 3000:3000 # Maps port 3000 on your server to port 3000 in the container
    volumes:
      - ./config:/app/config # Saves your settings in the local 'config' folder
    restart: unless-stopped # Automatically restarts the app if the server reboots

Step 4: Start the application. Press Ctrl+O then Enter to save, and Ctrl+X to exit Nano. Now, tell Docker to start the service.

# Start the container in detached mode (running in the background)
sudo docker compose up -d

Step 5: Access your dashboard. Open a web browser on any computer in your house. Type in the IP address of your server followed by :3000 (for example, http://192.168.1.50:3000). You should see your new home server dashboard.

What are some common troubleshooting tips?

Don't worry if things don't work on the first try. Most issues are caused by small syntax errors or permission problems.

  • Permission Denied: If you get an error when running Docker commands, make sure you are using sudo at the start of the command.
  • Port Already in Use: If an app fails to start, another program might be using that port. You can change the first number in the ports: section of your YAML file to something else, like 8080:3000.
  • YAML Indentation: YAML files are very picky about spaces. Ensure you use spaces, not tabs, and that the indentation matches the example exactly.

How do you manage your containers?

You don't need to be a coding expert to keep your server running smoothly. There are a few basic commands you will use frequently to check on your apps.

To see what is currently running, use:

# List all active containers
sudo docker ps

To stop your application, run this from inside your project folder:

# Stop and remove the containers defined in the Compose file
sudo docker compose down

To update your software to the newest version, you simply "pull" the new image and restart the container:

# Download the latest version and restart the service
sudo docker compose pull
sudo docker compose up -d

Next Steps

Now that your foundation is built, you can start adding more "containers" to your docker-compose.yml file. You might consider adding Pi-hole for network-wide ad blocking or Nextcloud for your own private file storage.

The most important thing is to experiment one service at a time. Once you feel comfortable with the dashboard, try looking for other "Dockerized" apps on Docker Hub that match your interests.

For more detailed guides, visit the official Docker documentation.


Read the Home Documentation