5 Docker Setup
Drew edited this page 2026-05-02 01:52:01 -04:00

Docker Setup

Install Docker and Docker Compose on Debian/Ubuntu systems. Foundation for modern self-hosting and containerized applications.

Prerequisites

  • Fresh Debian/Ubuntu system
  • Sudo access
  • Basic terminal knowledge
  • Internet connection

Installing Docker

Install dependencies:

sudo apt -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common

Add the Docker repository key (modern keyring path — apt-key is deprecated):

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Add the Docker APT repository. Replace amd64 with arm64 if you're on an ARM CPU:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list

Install Docker Engine and the modern Compose plugin:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Note: The legacy docker-compose (v1, Python) package is end-of-life. Use the docker compose plugin (docker-compose-plugin) — invoke as docker compose up, not docker-compose up.

If you're running as a non-root user, add your user to the docker group:

sudo usermod -aG docker username

Log out and back in for the change to take effect.


Portainer

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

localhost:9443