How to install Docker on a Linux VPS

Print
  • 0

Docker lets you run applications in containers. It is commonly used for bots, web apps, databases, dashboards, and some self-hosted game tooling. Do not install Docker if a game guide tells you to use a normal native server install instead.

Take a backup before installing Docker on a VPS that already hosts live services. Docker can create networks, firewall rules, volumes, and service files.

  1. Connect to the VPS with SSH.
  2. On Ubuntu or Debian, update packages and install Docker:
    sudo apt update
    sudo apt install docker.io docker-compose-v2
    sudo systemctl enable --now docker

    Linux VPS terminal showing Docker installed and docker version output

  3. On AlmaLinux, Rocky Linux, Oracle Linux, or CentOS-style images, install Docker if it is available from your enabled repositories:
    sudo dnf install docker docker-compose-plugin
    sudo systemctl enable --now docker
  4. If your distribution does not provide Docker in its default repositories, use Docker's official installation documentation for that distribution.
  5. Test Docker:
    sudo docker run hello-world
  6. Optionally allow your normal user to run Docker, then log out and back in:
    sudo usermod -aG docker yourusername

 

Useful Docker commands

CommandWhat it does
docker psShows running containers.
docker ps -aShows all containers, including stopped ones.
docker logs container_nameShows logs for a container.
docker compose up -dStarts a Compose stack in the background.

Docker containers can expose ports, write files, and consume disk space quickly, so keep backups of important data volumes.


Was this answer helpful?

Related Articles

« Back

Follow us on Social Media

Stay in the loop! Follow our social media accounts and stay up-to-date with the latest news, announcements, tips & tricks and behind-the-scenes insights!