Skip to download details
Install

Install Docker on a fresh VM

By Osiris83 Updated:
Install Docker on a fresh VM
Download AccessUse the destination selected by urZONE
Release DetailsSee the available product information
Original SourceReference listing linked below
Product OverviewRead the details before downloading

Overview & Details

Download AccessUse the destination selected by urZONE
Release DetailsSee the available product information
Original SourceReference listing linked below
Product OverviewRead the details before downloading

Overview & Details

Before you begin

Clean VM

Start with a fresh, 64-bit Ubuntu Server LTS virtual machine.
Check Docker’s
supported Ubuntu versions
before choosing your image. Remove any old or unofficial Docker
packages first.

Recommended resources

At least 2 vCPUs, 2 GB of RAM, and 20 GB of disk space. Images,
volumes, and logs grow quickly, so allow more disk for real workloads.

Run with care: Docker runs as root, and anyone in the
docker group effectively has root access to the VM. Use a
VM you control and take a snapshot first.

Step 01

Connect and update

Sign in to the VM as root and update its packages. Replace the example
IP address with your own.

Local terminal · SSH
ssh root@YOUR_SERVER_IP
Root terminal · Ubuntu
apt update && apt upgrade -y
Step 02

Remove conflicting packages

Ubuntu and third-party repositories ship unofficial Docker packages
that conflict with the official ones. This removes them if present;
it is safe if none are installed.

Root terminal · Cleanup
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do apt remove -y $pkg; done

Existing images, containers, and volumes in /var/lib/docker
are not removed by this command.

Step 03

Add Docker’s official repository

This downloads Docker’s signing key and registers its package
repository for your Ubuntu release.

Root terminal · Repository
apt install -y ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
tee /etc/apt/sources.list.d/docker.sources > /dev/null <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF
apt update
Step 04

Install Docker Engine

Install the engine, command-line tools, and the Buildx and Compose plugins.
The service starts automatically on Ubuntu.

Root terminal · Docker
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker
Step 05

Verify the installation

Run a test container. If Docker is working, it prints a short
confirmation message and exits.

Root terminal · Test
docker run --rm hello-world
docker compose version
Optional

Run Docker without root

To use Docker as a normal user, add that user to the docker
group. Replace YOUR_USERNAME, then log out and back in
for the change to apply.

Root terminal · Docker group
usermod -aG docker YOUR_USERNAME

Security note: Membership in the docker
group is equivalent to root access. Add only people you trust with
full control of this VM.

Keep building

Keep Docker and the operating system updated, remove unused images
with docker image prune, and back up your volumes. Note that
ports published by Docker bypass common host firewall rules such as
UFW, so publish only what you need.

References:
Install Docker Engine on Ubuntu
·
Post-installation steps
·
Docker Compose

Download Access

Download Install Docker on a fresh VM

Use the button below to open the download destination.