How to Install Docker on a Linux VPS
Docker is a platform that lets you run applications inside an isolated environment called a Container.
With Docker, you can run a Discord bot, a website, or a game server without worrying about program version conflicts or operating system errors. In short: run a single command, and your application is up and running!
Here is the fastest way to install Docker on a Linux VPS (Ubuntu / Debian):
Before running the installation commands below, make sure your VPS is running a clean (Fresh Install) operating system.
Do not use a VPS that already has a web server or another panel installed, such as Apache, Nginx, XAMPP, CyberPanel, or aaPanel. Those applications will compete for network access (Ports 80 and 443) with Pterodactyl, which will cause the installation to fail.
If your VPS already has various applications installed, it is strongly recommended to Reinstall the OS (choose Ubuntu or Debian) from the Install OS menu in your VPS Panel dashboard before continuing.
Step 1: Update & Upgrade the System
Before installing a large application like Docker, it is strongly recommended to update your server's system package list so you get the latest, bug-free versions.
- Open a Terminal / VS Code and make sure you are connected to the VPS over SSH (as
root). - Type the following command and press Enter:
sudo apt update && apt upgrade -y - Wait for the process to finish (usually 1-3 minutes).
If a red/purple pop-up appears during the process asking which services you want to restart, just press Enter (select Ok).
- Restart the VPS from the VPS VM website
Step 2: Install Docker
We will use the official installation script provided directly by the Docker developers. This is the easiest method because the script will detect and install the Docker version that best fits your VPS automatically.
- Type the following command and press Enter:
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh - The system will download and install Docker automatically. Please wait a moment while it downloads Docker's core files.
Step 3: Verify the Installation
Once the process above is complete and the Terminal shows the command prompt again, let's make sure Docker was installed correctly.
- Type this command to check the Docker version:
docker --version
(If successful, the screen will show text such as Docker version 24.0.x, build...)
- Type this command to make sure the Docker service is running:
systemctl status docker
(If successful, you will see green text reading active (running). To exit this status view, just press the letter q on your keyboard).
Optional Extra Step
To make Docker start automatically every time your VPS is rebooted (or powered back on from the panel), run this command:
systemctl enable docker
Done! Your VPS now has Docker installed and is ready to host your favorite applications or bots.