Tutorials

How to Install Docker Ubuntu VPS: A Step-by-Step Guide

S
Super Admin
May 18, 2026
How to Install Docker Ubuntu VPS: A Step-by-Step Guide

Docker simplifies application deployment by isolating software into lightweight containers. If you want to deploy modern applications efficiently, learning how to install docker ubuntu vps is a fundamental skill. This guide walks you through the official installation method using Docker's stable repository.

Prerequisites

Before diving in, ensure your environment meets these requirements:

  • An Ubuntu VPS (Ubuntu 20.04, 22.04, or 24.04).
  • A user account with sudo privileges.
  • An active SSH connection to your server.
  • ---

    Step 1: Update Your System

    First, update your existing package list to ensure all system components are up to date and to prevent version conflicts before you install docker ubuntu vps.

    bashsudo apt update && sudo apt upgrade -y

    Step 2: Install Required Dependencies

    Docker requires a few primitive packages to allow apt to utilize packages over HTTPS. Run the following command to install them:

    bashsudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg -y

    Step 3: Add Docker's Official GPG Key

    To ensure the integrity and authenticity of the software you are downloading, add the official Docker GPG key to your system:

    bashsudo install -m 0755 -d /etc/apt/keyrings
    curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    sudo chmod a+r /etc/apt/keyrings/docker.gpg

    Step 4: Set Up the Docker Repository

    Next, register the stable Docker repository with your system's package source list:

    bashecho \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

    After adding the repository, refresh your package index again to include Docker's packages:

    bashsudo apt update

    Step 5: Install Docker Engine

    Now, install the latest version of Docker Engine, CLI, and containerd:

    bashsudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

    Step 6: Verify the Installation

    Once the installation is complete, verify that the Docker service is running properly on your VPS:

    bashsudo systemctl status docker

    You should see an output indicating that the service is active (running). To double-check that the process to install docker ubuntu vps was successful, execute the classic hello-world image:

    bashsudo docker run hello-world

    If everything is configured correctly, Docker will download the test image, run it inside a container, print a confirmation message, and exit.

    ---

    Optional: Post-Installation Step (Run Docker Without Sudo)

    By default, running any docker command requires sudo privileges. If you prefer not to type sudo every time, add your current user to the docker group:

    bashsudo usermod -aG docker $USER

    Note: To apply these changes, log out of your VPS session and log back in, or run the following command to activate the group changes immediately:

    bashnewgrp docker
    Back to all articles
    Published with Nova System © 2026