
Docker is one of the most popular tools for deploying and managing applications in isolated environments called containers. With a Hosteons VPS, you have full root access and KVM virtualization โ making it perfect for running Docker!
In this guide, weโll show you how to install Docker on a VPS (Ubuntu/CentOS/AlmaLinux) and run your first container.
โ Prerequisites
- A Hosteons VPS with root access
- OS: Ubuntu 20.04/22.04 or CentOS 7/8 / AlmaLinux 8/9
- Updated system packages
๐ Step 1: Update Your VPS
Ubuntu/Debian:
sudo apt update && sudo apt upgrade -y
CentOS/AlmaLinux:
sudo yum update -y
# OR
sudo dnf update -y
๐ Step 2: Install Docker
For
Ubuntu
:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
For
CentOS/AlmaLinux
:
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io -y
For AlmaLinux 8/9, replace yum with dnf where needed.
๐ Step 3: Start and Enable Docker
sudo systemctl start docker
sudo systemctl enable docker
Check status:
sudo systemctl status docker
๐ Step 4: Run a Test Container
Run a basic hello-world container:
sudo docker run hello-world
If everything is set up correctly, youโll see a message from Docker saying your installation is working.
๐ Step 5: Run Any Container (Example: NGINX)
sudo docker run -d -p 80:80 nginx
Visit your VPS IP in a browser to see the default NGINX welcome page.
โก Bonus Tips
- Add your user to the docker group to avoid using sudo:
sudo usermod -aG docker $USER
Then log out and log back in.
- You can manage Docker containers using tools like Portainer for a web UI:
sudo docker volume create portainer_data
sudo docker run -d -p 9000:9000 --name=portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce
Access it at: http://your-server-ip:9000
๐ Ready to Deploy Containers with Power?
Hosteons VPS plans provide full KVM virtualization, root access, and 10Gbps ports โ ideal for Docker workloads.
๐ Order Budget VPS
๐ Order Ryzen VPS
๐ Order Ryzen VDS