No KYC · KVM in Hong Kong, Tokyo and Singapore at one price · Pay in BTC, USDT, USDC, ETH, SOL, LTC, XMR
Language: English
Build a server

Guide · Debian 13 and Ubuntu 24.04 · checked 16 November 2026

How do you install Docker on a VPS?

This is how to install Docker on a VPS from Docker's own apt repository, on Debian 13 or Ubuntu 24.04, with Compose included.

Last updated: · 4 min read

Quick answer

How do you install Docker on a VPS?

To install Docker on a VPS, add Docker's GPG key and apt repository, then install docker-ce, the CLI, containerd and the Compose plugin, and run hello-world. It takes 6 steps. JadeKVM servers are KVM with their own kernel, so Docker runs as on any Linux machine. Bind published ports to 127.0.0.1, because Docker skips UFW.

In brief
  • Official repository: newer than the distro docker.io package and includes Compose v2.
  • KVM matters: Docker needs kernel features that container-based VPS often lack.
  • UFW warning: published ports skip UFW rules; bind them to 127.0.0.1.
  • Memory: 1 GB runs one small container; Bangle with 4 GB fits a stack.

How to install Docker on a VPS in 6 steps?

These commands follow Docker's install pages for Debian and Ubuntu, read on 16 November 2026.

  1. Remove old packages

    Remove docker.io, podman-docker or containerd from the distro if present.

  2. Add the GPG key

    Download Docker's key to /etc/apt/keyrings/docker.asc.

  3. Add the repository

    Write /etc/apt/sources.list.d/docker.sources in the deb822 format.

  4. Install the packages

    Install docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin and docker-compose-plugin.

  5. Test it

    Run sudo docker run hello-world. A greeting means the engine works.

  6. Allow your user

    Add your user to the docker group, then log out and back in.

Which JadeKVM plan fits which Docker workload?

JadeKVM plans for Docker workloads, with resources and the 12-month price per month
PlanResourcesPer month on 12 monthsFits
Bead1 vCPU / 1 GB / 20 GB$3.75One small container, with swap
Pendant1 vCPU / 3 GB / 45 GB$4.50An app and its database
Bangle2 vCPU / 4 GB / 80 GB$8.25A Compose stack of 4 to 6 services
Seal4 vCPU / 8 GB / 160 GB$13.50Build jobs and heavier stacks
Vessel4 vCPU / 16 GB / 200 GB$15.75Many stacks, or in-memory caches

How do you add the official Docker repository?

Fetch the key, write a deb822 sources file, then install the five packages. The block below reads your system ID and codename from /etc/os-release, so it fits Debian 13 and Ubuntu 24.04 alike. Docker supports Debian 13 (trixie) and Debian 12 on amd64 and arm64.

The docker group grants root-level power. Add only trusted users to it.

Docker Engine from download.docker.com
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
. /etc/os-release
sudo curl -fsSL https://download.docker.com/linux/$ID/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 > /dev/null <<EOF
Types: deb
URIs: https://download.docker.com/linux/$ID
Suites: $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 docker run hello-world
sudo usermod -aG docker $USER

Does Docker ignore the UFW firewall on a VPS?

Yes: Docker inserts its own iptables rules, so -p 8080:80 opens port 8080 to the world even if UFW denies it. Docker's documentation states this plainly. Publish on the loopback address instead, as 127.0.0.1:8080:80, and let nginx serve the public side.

The guide on how to set up a UFW firewall on a VPS covers the host rules. For an app behind nginx, see how to deploy a Node.js app.

compose.yaml with a loopback port
services:
  web:
    image: nginx:stable
    ports:
      - "127.0.0.1:8080:80"
    restart: unless-stopped

Which is the best VPS size for Docker in 2026?

Start with 4 GB for a Compose stack; 1 GB works for one light container with swap. Images, logs and volumes also eat disk, so watch docker system df. According to JadeKVM's survey of 2 November 2026, comparable 4 GB plans at 11 no-KYC crypto hosts in the three cities averaged $25.03 a month, against $8.25 for Bangle on 12 months.

On Bead, add swap first with how to add swap on a VPS. The 4 GB Asia VPS page compares that size in detail.

How do you keep containers running after a reboot?

Enable the docker service and give each container a restart policy. The package enables docker.service by default. restart: unless-stopped in Compose brings containers back after a reboot. Reboot, reinstall and delete requests are sent from the dashboard and carried out by a person; a reinstall wipes the disk, and containers return on their own afterwards.

Questions about Docker on a VPS

Should I use docker.io from apt or Docker's repository?

Docker's repository gives current releases and the Compose v2 plugin. The distro package lags behind.

Can Docker run on a 1 GB VPS?

Yes, for one small service. Add swap and avoid building large images on the server.

Does Docker work on any VPS?

It needs a full kernel. KVM servers such as JadeKVM run it; some container-based VPS cannot.

How do I update Docker?

Run apt update and apt upgrade. The repository delivers new engine versions like any other package.

Which is better for one server: Docker Compose or Kubernetes?

Compose. Kubernetes adds overhead that a single small server does not need.

Verdict
  • Install from Docker's own repository and get Compose v2 in the same step.
  • Publish ports on 127.0.0.1 behind nginx, since Docker skips UFW.
Sources (4)
  1. Install Docker Engine on Debian — Docker (read 2026-11-16)
  2. Install Docker Engine on Ubuntu — Docker (read 2026-11-16)
  3. Linux post-installation steps for Docker Engine — Docker (read 2026-11-16)
  4. Packet filtering and firewalls, Docker Engine documentation — Docker (read 2026-11-16)

Run your Compose stack in Asia

Bangle offers 2 vCPU / 4 GB / 80 GB for $8.25 a month on 12 months.

From $3.75/mo on 12 months · HK · TYO · SIN

Build