Back to site

Install Docker and Docker Compose

Install Docker Engine from the official repository and the Docker Compose plugin on a HolyCloud Linux VPS (Ubuntu/Debian).

Install Docker and Docker Compose

Docker isolates your applications (API, databases, workers) on a HolyCloud Linux VPS without extra machines. This guide follows the official Docker repository and installs the Compose V2 plugin (docker compose), recommended for production.

Prerequisites

  • HolyCloud VPS Ubuntu 22.04/24.04 or Debian 12, 2 GB RAM minimum for light workloads
  • sudo access, up-to-date system
  • Optional domain name (to expose services behind Nginx + TLS)

Step 1: dependencies and official repository

sudo apt update
sudo apt install -y ca-certificates curl gnupg
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

Debian: replace ubuntu with debian in the GPG URL and repository below.

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
sudo apt update

Step 2: install packages

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

Step 3: user and service

Add your user to the docker group (SSH re-login required):

sudo usermod -aG docker $USER
newgrp docker

Start on boot:

sudo systemctl enable --now docker
sudo systemctl status docker --no-pager

Step 4: quick test

docker run --rm hello-world
docker compose version

Minimal compose.yaml example:

mkdir -p ~/demo && cd ~/demo
cat > compose.yaml <<'EOF'
services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
EOF
docker compose up -d
curl -sI http://127.0.0.1:8080 | head -1
docker compose down

Step 5: HolyCloud firewall

Expose only required ports:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# évitez d'ouvrir 2375/tcp (API Docker non sécurisée)

Prefer publishing apps via Nginx reverse proxy on 443 rather than random ports.

Verification

docker info | grep -E 'Server Version|Storage Driver'
docker ps
docker compose ls

Updates:

sudo apt update && sudo apt upgrade -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

Need help?

  • Cannot connect to the Docker daemon: check sudo systemctl start docker and docker group membership
  • Low RAM: reduce limits in compose.yaml or upgrade the VPS plan in the customer area
  • Support: docker info output and journalctl -u docker -n 30