How to Install Docker and Run Containers on Your VPS

Docker lets you package and run applications in lightweight, isolated containers. Because JetHost VPS uses KVM with nested virtualization enabled, Docker, Podman and Kubernetes all work out of the box.

Installing Docker (Ubuntu/Debian)

Connect over SSH and install Docker from your distribution’s packages, then enable the service:

  • sudo apt update
  • sudo apt install docker.io
  • Start it on boot: sudo systemctl enable --now docker
  • Verify with sudo docker run hello-world

For the very latest release, follow the official Docker installation guide for your distribution instead of the packaged version.

Running your first container

For example, to run Nginx and expose it on port 80: docker run -d -p 80:80 --name web nginx. Your site is now served from the container. Add Docker Compose to define multi-container apps in a single docker-compose.yml file.

Going further with Kubernetes

For orchestration, lightweight k3s installs in one command and is perfect for a single VPS, while kubeadm supports full clusters. Portainer gives you a friendly web UI for managing containers.

JetHost Experts Tip

Open only the ports your containers actually need in the VPS firewall, and avoid publishing database ports to the public internet. Containers make it easy to expose services by accident.

Need More Help?

Docker turns your VPS into a flexible platform for shipping containers – no extra setup required. If you get stuck, the JetHost team is available 24/7 and usually answers in under five minutes – just contact us and we’ll help you sort it out. Explore our other VPS tutorials to get the most out of your server.