How to Install Docker and Run Containers on a Hosteons VPS

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.