No KYC · seven Linux VPS plans, one price in six cities · Pay in BTC, USDT, USDC, ETH, SOL, LTC, XMR
Language: English
Configure a VPS

Guide · containers · checked 16 November 2026

How do I install Docker on a VPS?

Last updated: · 4 min read

Quick answer

How do I install Docker on a VPS?

To install Docker on a VPS, remove any distro Docker packages, add Docker's signing key and apt repository, then install docker-ce with the Compose plugin and run hello-world. It takes about 6 commands on Ubuntu or Debian. A SaltVPS Crystal server (2 vCPU / 6 GB / 120 GB) is sized for several containers.

In brief
  • Source: Docker's own repository at download.docker.com, not the older docker.io package.
  • Packages: docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, docker-compose-plugin.
  • Compose: now a plugin, called as docker compose with a space.
  • Trap: ports published by Docker skip ufw rules unless you bind them to 127.0.0.1.
  • Systems: Ubuntu and Debian use apt; AlmaLinux and Rocky Linux use Docker's RHEL repository.

How do you install Docker on an Ubuntu or Debian VPS?

Run these as root, or prefix each with sudo. Replace ubuntu with debian in the URLs on a Debian server.

  1. Remove old packages

    Run apt remove docker.io docker-compose docker-doc podman-docker containerd runc. It is fine if apt says none are installed.

  2. Install the prerequisites

    Run apt update then apt install ca-certificates curl.

  3. Add Docker's signing key

    Run install -m 0755 -d /etc/apt/keyrings, then curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc, then chmod a+r /etc/apt/keyrings/docker.asc.

  4. Add the repository

    Create the Docker source file in /etc/apt/sources.list.d/ exactly as shown on docs.docker.com for your system. It names your release codename and the key file.

  5. Install Docker Engine

    Run apt update, then apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin.

  6. Test it

    Run docker run hello-world. A greeting message means the engine pulled and ran a container. Check Compose with docker compose version.

How does the Docker install differ between systems?

SaltVPS offers Debian 13, Debian 12, Ubuntu 24.04 LTS, Ubuntu 22.04 LTS, AlmaLinux 10, Rocky Linux 10; Docker publishes packages for each family.

Docker Engine install method by Linux system offered on SaltVPS servers
SystemPackage managerDocker repositoryStarts on its own
Ubuntu 24.04 / 22.04 LTSaptdownload.docker.com/linux/ubuntuYes, after install
Debian 13 / 12aptdownload.docker.com/linux/debianYes, after install
AlmaLinux 10 / Rocky Linux 10dnfdownload.docker.com/linux/rhelNo: run systemctl enable --now docker

How do you install Docker on AlmaLinux or Rocky Linux?

Add Docker's RHEL repository with dnf, install the same five packages, then start the service.

  • dnf -y install dnf-plugins-core
  • dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
  • dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  • systemctl enable --now docker

Accept the GPG key fingerprint when dnf asks, after checking it against the one printed on docs.docker.com.

Why can Docker ports get past the ufw firewall?

Docker writes its own iptables rules, and a published port is reachable even when ufw denies it. Docker's documentation states this plainly. A container started with -p 8080:80 answers on the public IP whatever ufw says.

Two safe habits help. Bind private services to localhost, as in -p 127.0.0.1:8080:80, and put a reverse proxy in front. Or only publish ports you mean to expose. The ufw guide covers the rest of the firewall setup.

Which VPS size is best for Docker?

It depends on the containers, not on Docker itself, which adds little overhead. SaltVPS checked its plan list on 16 November 2026: RAM runs from 2 GB on Grain to 32 GB on Dome, all on NVMe disks. A single small app fits Grain. Crystal (6 GB, 120 GB NVMe) leaves room for a database, a reverse proxy and a few services at $6.75 a month on 12 months.

Images and volumes fill disks quietly; docker system df shows the space used. The Docker VPS comparison goes deeper, and running a trading bot is a worked Compose example.

Docker on a VPS: questions

Can I run Docker without sudo?

Add your user to the docker group with usermod -aG docker youruser, then log out and back in. That group has root-level power on the host, so give it only to admins.

Should I use the convenience script from get.docker.com?

Docker says it is meant for test and development setups. On a server you keep, the repository method is easier to audit and update.

Does Docker work on a KVM VPS?

Yes. KVM gives the server its own kernel, so Docker runs as it would on a physical machine.

How do I update Docker later?

With the normal system updates: apt upgrade or dnf upgrade pulls new Docker packages from the repository.

Is docker-compose the same as docker compose?

docker compose is the current plugin. The older docker-compose tool is no longer maintained by Docker.

Verdict
  • Install Docker on a VPS from Docker's own repository, then test with hello-world.
  • Bind private ports to 127.0.0.1, because published ports skip ufw rules.
Sources (4)
  1. Install Docker Engine on Ubuntu — Docker (2026-11-16)
  2. Install Docker Engine on Debian — Docker (2026-11-16)
  3. Install Docker Engine on RHEL — Docker (2026-11-16)
  4. Packet filtering and firewalls (Docker with ufw) — Docker (2026-11-16)

A KVM server ready for containers

Crystal pairs 6 GB of RAM with 120 GB NVMe, with root over SSH and a dedicated IPv4.

From $2.25/mo on 12 months · no KYC

Configure