Docker runs on any KVM root server with Debian or Ubuntu in five minutes: add the Docker package sources, install Docker Engine and Compose, add your user to the "docker" group, done. The KVM root server is important, because in LXC containers Docker only runs with restrictions.
Requirements
- A KVM root server with Debian 12 or Ubuntu 22.04 or 24.04. Container vServers (LXC) are not suitable for Docker.
- At least 2 GB of memory, for several containers 4 GB or more.
- A user with sudo rights and SSH access.
- An up-to-date system: run "apt update" and "apt upgrade" first.
Installation in five steps
- Install dependencies: apt install ca-certificates curl gnupg
- Load the Docker GPG key to /etc/apt/keyrings/docker.gpg and add the Docker package source for your distribution to /etc/apt/sources.list.d/docker.list.
- Update package lists and install: apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
- Add your user to the group: usermod -aG docker youruser, then log in again.
- Test: docker run hello-world
Docker Compose: several containers as one project
With Compose you describe an application including database, cache and reverse proxy in one file "compose.yaml" and start everything with "docker compose up -d". Create a separate directory per project, then volumes, networks and updates stay cleanly separated.
Security: ports, updates, root
- Only publish ports that must be reachable from outside. "127.0.0.1:8080:80" instead of "8080:80" keeps services local.
- Docker writes its own firewall rules. After installation, check whether your ufw rules still apply.
- Keep images up to date: "docker compose pull" and "docker compose up -d" at regular intervals.
- Include volumes in your backup, containers themselves are replaceable.
Which server for Docker?
For a few services a KVM root server with 4 GB RAM is enough. Databases, build pipelines or many parallel containers benefit from more cores, the EPYC line fits here. If you run an entire stack for a team and want to virtualise yourself, take a dedicated server with Proxmox and Docker VMs inside.
KVM root server for Docker
Own kernel, dedicated cores and RAM, NVMe storage. Debian or Ubuntu installed in minutes, Docker in five more.