HostingBaba

Docker VPS guide

Run Docker on a VPS.
Step by step.

Docker runs apps in containers, so you can start a database, a website, a bot or a self-hosted tool with one command and move it between servers easily. This guide installs Docker and Docker Compose on your own HostingBaba Linux VPS.

What you need

A Linux VPS with Ubuntu 24.04 LTS (choose it on the order form) and SSH access from your own computer. Our smallest VPS plan has 4 vCPU and 8 GB of memory. Check what your apps need and watch memory use with docker stats; if your apps wait on the disk, the NVMe guide helps you decide whether an NVMe plan is worth it.

Step 1: install Docker

Log in to the server over SSH as root with the details from your dashboard. Update it, then install Docker and the Compose plugin from Docker's own package repository, as Docker's guide for Ubuntu describes:

apt update && apt -y upgrade
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
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Check that it works:

docker run --rm hello-world

Step 2: start an app with Compose

Each app gets a folder with a compose.yaml file that describes its containers. This example runs a small web server that answers only on the server itself (127.0.0.1), which is the safe default:

mkdir -p /opt/web && cd /opt/web
nano compose.yaml
services:
  web:
    image: nginx:stable
    restart: unless-stopped
    ports:
      - "127.0.0.1:8080:80"
docker compose up -d
curl http://127.0.0.1:8080

restart: unless-stopped brings the container back after a reboot. To see logs, run docker compose logs -f in the app's folder.

Step 3: firewall

Turn on the firewall for SSH. If you use a different SSH port, allow that one instead of OpenSSH. Ports published by Docker bypass this firewall, so publish a port to the internet only when you mean to: write \"80:80\" to make it public, or \"127.0.0.1:8080:80\" to keep it on the server.

ufw allow OpenSSH
ufw enable

Step 4: updates and backups

To update an app, read its release notes, make a backup, then pull the new image and restart:

cd /opt/web
docker compose pull && docker compose up -d

Your data lives in Docker volumes or in folders you mount. Use each app's own backup or export procedure, or stop the app before copying its data, so databases are not copied half-written. Store backups off the server, for example with scp or rsync, and test that you can restore them. We do not back up your server by default.

What is not allowed

Everything your containers do must follow our Acceptable Use Policy: no spam, phishing, malware, attacks, scanning systems you are not allowed to test, or Tor exit nodes.

Prices

Monthly price on a 1-month term, in our EU region. Other locations add a small monthly extra. Longer terms may be discounted; the discount and the exact total are shown on the order form before you pay.

PlanCPUMemoryStoragePort EU region Order
VPS 4 4 vCPU 8 GB 100 GB SSD 200 Mbit/s $16.50 / mo Order
VPS 6 6 vCPU 12 GB 200 GB SSD 300 Mbit/s $22.50 / mo Order
VPS 8 8 vCPU 24 GB 300 GB SSD 600 Mbit/s $42.00 / mo Order
VPS 12 12 vCPU 48 GB 400 GB SSD 800 Mbit/s $75.00 / mo Order
VPS 16 16 vCPU 64 GB 500 GB SSD 1 Gbit/s $111.50 / mo Order
VPS 18 18 vCPU 96 GB 600 GB SSD 1 Gbit/s $147.00 / mo Order
NVMe 4 4 vCPU 8 GB 150 GB NVMe 500 Mbit/s $33.50 / mo Order
NVMe 6 6 vCPU 12 GB 300 GB NVMe 500 Mbit/s $47.00 / mo Order
NVMe 8 8 vCPU 24 GB 450 GB NVMe 1 Gbit/s $85.00 / mo Order
NVMe 12 12 vCPU 48 GB 600 GB NVMe 1 Gbit/s $143.50 / mo Order
NVMe 16 16 vCPU 64 GB 750 GB NVMe 1 Gbit/s $191.50 / mo Order
NVMe 18 18 vCPU 96 GB 900 GB NVMe 1 Gbit/s $239.50 / mo Order

Also available: Dedicated CPU · Storage VPS · Windows VPS · all nine locations

Questions

Does Docker work on every Linux VPS plan?

Every Linux VPS is a full virtual machine with root access, and Docker runs on the Linux systems it supports. This guide covers Ubuntu 24.04.

Can I run Docker on Windows plans?

Our Windows plans are for Windows software. For Docker, choose a Linux VPS: it costs less and leaves more of the server for your containers.

Do you manage my containers?

No. We provide and support the server; you run and update your own containers. If something on the server itself does not work, open a support ticket.

Related