Skip to content

Debian / Ubuntu

Install Docker on a Debian or Ubuntu server in preparation for running Bearicorn.

Requirements

  • Debian 12 (bookworm) or 13 (trixie), or Ubuntu 22.04/24.04 LTS
  • A user with sudo privileges

Installation

Step 1 - Install Docker

The steps below follow the official Docker Engine installation guide for Debian and Ubuntu.

On Debian:

bash
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker "$USER"

On Ubuntu:

bash
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker "$USER"

WARNING

Log out and back in before proceeding. The usermod command above adds your user to the Docker group, which only takes effect after a fresh login.

Verify the installation:

bash
docker version
docker compose version

Step 2 - Configure the firewall

bash
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable

INFO

Docker can bypass UFW rules. If running on AWS or DigitalOcean, use their cloud-level firewall (Security Groups / Cloud Firewall) as the primary control.

Step 3 - Install required tools

bash
sudo apt install -y git openssl

Next Steps

Continue to choose and deploy your stack.