{"id":11796,"date":"2026-12-01T09:00:00","date_gmt":"2026-12-01T08:00:00","guid":{"rendered":"https:\/\/www.xitens.nl\/?p=11796"},"modified":"2026-11-30T06:00:04","modified_gmt":"2026-11-30T05:00:04","slug":"docker-vps","status":"publish","type":"post","link":"https:\/\/www.xitens.nl\/en\/docker-vps\/","title":{"rendered":"Docker on a VPS: Install It and Run Your First Containers"},"content":{"rendered":"<p><strong>You install Docker on a VPS with one official script, after which you run applications as separate containers: isolated, easy to update and identical everywhere.<\/strong> A VPS is ideal for this, because you have full root access and your containers stay online 24\/7. In this guide you install Docker on a Linux VPS, start your first container and learn how to use Docker securely.<\/p>\n\n<h2>What is Docker?<\/h2>\n<p>Docker is a platform for running applications in containers. A container holds an application with everything it needs, such as libraries and settings, but shares the kernel of the operating system. That makes containers lighter than virtual machines, lets you start them in seconds and makes an application on your VPS work exactly the same as on your own computer.<\/p>\n\n<h2>Why Docker on a VPS?<\/h2>\n<ul>\n<li><strong>Quick to install:<\/strong> you run databases, web servers and tools such as n8n with a single command.<\/li>\n<li><strong>Isolated:<\/strong> every application runs in its own container, without conflicts between versions.<\/li>\n<li><strong>Easy to update:<\/strong> pull a new version of the image and restart the container.<\/li>\n<li><strong>Reproducible:<\/strong> with Docker Compose you capture your entire environment in a single file.<\/li>\n<\/ul>\n\n<h2>Which VPS do you need for Docker?<\/h2>\n<p>For a few light containers, a VPS with 1 to 2 cores and 2 GB of memory is enough. If you run databases or several applications at the same time, choose 4 GB or more. An <a href=\"https:\/\/www.xitens.nl\/en\/nvme-vps\/\">NVMe VPS<\/a> is ideal for Docker: images, volumes and databases benefit directly from the fast NVMe storage. If you run production applications that must always be online, choose a <a href=\"https:\/\/www.xitens.nl\/en\/linux-vps\/\">Linux VPS<\/a> with high availability.<\/p>\n\n<h2>Step by step: installing Docker on a VPS<\/h2>\n<h3>Step 1: update your server<\/h3>\n<p>Log in via SSH to your VPS with Ubuntu or Debian and install the latest updates:<\/p>\n<pre data-no-translation=\"\"><code>apt update && apt upgrade -y<\/code><\/pre>\n<h3>Step 2: install Docker<\/h3>\n<p>Install Docker with the official installation script. It also installs Docker Compose:<\/p>\n<pre data-no-translation=\"\"><code>curl -fsSL https:\/\/get.docker.com | sh<\/code><\/pre>\n<h3>Step 3: check the installation<\/h3>\n<p>Start a test container. If you see a welcome message, Docker is working:<\/p>\n<pre data-no-translation=\"\"><code>docker run hello-world<\/code><\/pre>\n<h3>Step 4: start your first web server<\/h3>\n<p>Start an Nginx web server that is reachable on port 80 of your VPS:<\/p>\n<pre data-no-translation=\"\"><code>docker run -d --name web -p 80:80 --restart unless-stopped nginx<\/code><\/pre>\n<p>Open the IP address of your VPS in your browser and you will see the Nginx welcome page.<\/p>\n\n<h2>Docker Compose: multiple containers in one file<\/h2>\n<p>With Docker Compose you describe your entire environment in a single file. This example starts a web server and a database:<\/p>\n<pre data-no-translation=\"\" data-title=\"docker-compose.yml\"><code>services:\n  web:\n    image: nginx\n    restart: unless-stopped\n    ports:\n      - \"80:80\"\n  db:\n    image: postgres:16\n    restart: unless-stopped\n    environment:\n      - POSTGRES_PASSWORD=wijzig-dit-wachtwoord\n    volumes:\n      - db_data:\/var\/lib\/postgresql\/data\nvolumes:\n  db_data:<\/code><\/pre>\n<p>Start everything with a single command:<\/p>\n<pre data-no-translation=\"\"><code>docker compose up -d<\/code><\/pre>\n<p>You can find a practical example in our guide <a href=\"https:\/\/www.xitens.nl\/en\/n8n-self-hosted-vps\/\">How to Self-Host n8n on a VPS<\/a>.<\/p>\n\n<h2>Common Docker commands<\/h2>\n<pre data-no-translation=\"\"><code>docker ps\ndocker logs web\ndocker compose pull\ndocker compose up -d\ndocker system prune<\/code><\/pre>\n<p>With these you view the running containers, read the logs, update images and clean up unused data.<\/p>\n\n<h2>Using Docker securely<\/h2>\n<ul>\n<li><strong>Watch out with the firewall:<\/strong> Docker opens published ports outside UFW. That is why you only publish ports that really need to be public, and bind internal services such as databases to 127.0.0.1 or do not publish a port for them at all.<\/li>\n<li><strong>Use official images:<\/strong> choose images from the official maintainers and keep them up to date.<\/li>\n<li><strong>Store data in volumes:<\/strong> that way your data is kept when you replace a container, and backups are easy.<\/li>\n<li><strong>Secure the server itself:<\/strong> read our article <a href=\"https:\/\/www.xitens.nl\/en\/how-do-i-secure-my-linux-vps\/\">How to secure a Linux VPS<\/a> for the basic steps.<\/li>\n<\/ul>\n\n<h2>Hosting Docker at Xitens<\/h2>\n<p>Xitens has been a hosting provider in Amsterdam since 2014. Our VPS servers run in our own racks with our own network in a TIER III data centre in Amsterdam. You get full root access, choose your own operating system and can always reach your server via the noVNC console in the client area. All VPS plans offer 99.9% uptime, and our support engineers are available 24\/7 by ticket and email.<\/p>\n\n<p>Voor een paar lichte containers volstaat vaak al een <a href=\"https:\/\/www.xitens.nl\/en\/affordable-vps\/\">affordable VPS<\/a> met 2 GB werkgeheugen.<\/p>\n<h2>Frequently asked questions about Docker on a VPS<\/h2>\n<h3>What is the difference between Docker and a VPS?<\/h3>\n<p>A VPS is a virtual server with its own operating system. Docker runs inside it and divides your applications into lightweight containers. They complement each other: the VPS provides the computing power, Docker organises your applications.<\/p>\n<h3>How many containers can I run on a VPS?<\/h3>\n<p>That depends on the memory and processor of your VPS and on what the containers do. Lightweight containers often use only tens of megabytes, databases more.<\/p>\n<h3>Does Docker also work on a Windows VPS?<\/h3>\n<p>Docker draait ook op Windows, maar vrijwel alle images zijn gemaakt voor Linux. Een Linux VPS is daarom de standaard en meest stabiele keuze voor Docker-containers.<\/p>\n<h3>Can I also run Kubernetes on a VPS?<\/h3>\n<p>Yes. With lightweight distributions such as k3s you run Kubernetes on one or more VPS servers. For most projects, however, Docker Compose is simpler and more than sufficient.<\/p>","protected":false},"excerpt":{"rendered":"Install Docker on a VPS in a few steps: from installation and your first container to Docker Compose and secure use.","protected":false},"author":1,"featured_media":11798,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-11796","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/posts\/11796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/comments?post=11796"}],"version-history":[{"count":2,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/posts\/11796\/revisions"}],"predecessor-version":[{"id":12032,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/posts\/11796\/revisions\/12032"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/media\/11798"}],"wp:attachment":[{"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/media?parent=11796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/categories?post=11796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xitens.nl\/en\/wp-json\/wp\/v2\/tags?post=11796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}