Nanohost logo
PricingFAQ
Log inSign Up

How to install docker on Ubuntu

Tutorials

5 Aug 2025

How to install docker on Ubuntu full

If you're new to Linux or servers and want to run applications in containers, Docker is one of the best tools out there. In this guide, I’ll walk you through how to install Docker on Ubuntu step-by-step — no advanced knowledge required.

What is Docker?

Docker lets you run apps in "containers", which are like mini virtual machines, but faster and lighter. It’s great for developers, sysadmins, and anyone managing software on servers.

What You’ll Need

  • A computer or VPS running Ubuntu 22.04 (or 20.04)
  • Access to the terminal (either directly or via SSH)
  • A user with sudo privileges (admin rights)

If you need an virtual server for Docker, check out nanohost.org. We offer fast and reliable servers starting at $8/month.

Step-by-Step Installation Guide

1. Update your system.

Open the terminal and run:

sudo apt update && sudo apt upgrade -y

This makes sure everything is up to date.

2. Install required packages

You will needa a few extra tools to install Docker properly. Run:

sudo apt install ca-certificates curl gnupg lsb-release -y

3. Install Docker

Now for the main event:

curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh

Docker should start automatically. You can check with:

sudo systemctl status docker

4. Test if Docker works

Run the classic test:

docker run hello-world

You should see a message saying Docker is working.

You're Done!

Docker is now installed on your Ubuntu machine. You can start pulling and running containers from Docker Hub.

Bonus: Most common commands

docker pull ubuntu           # Download an Ubuntu image
docker run -it ubuntu bash  # Run Ubuntu container with interactive shell
docker ps                   # Show running containers
docker stop             # Stop a container
docker rm               # Remove a container

Summary

Installing Docker on Ubuntu is easier than it seems. Whether you're building apps, learning DevOps, or just exploring containers, Docker is an essential tool.

dockerhow-tolinux

Read also

How to Reboot Linux Now (Safely): systemctl reboot, shutdown -r now, and Force-Reboot Options

How to Reboot Linux Now (Safely): systemctl reboot, shutdown -r now, and Force-Reboot Options

Tutorials

Whether you’re applying kernel updates, clearing a stuck device, or finishing a configuration change, a reboot is sometimes the cleanest fix. This guide shows beginner-friendly and safe ways to restart Linux immediately (“reboot now Linux”), plus how to force reboot if the system is unresponsive. We’ll cover desktops, servers, and remote machines over SSH.

Linux Navigation and File Management

Linux Navigation and File Management

Tutorials

Learning how to move around and manage files and folders in the Linux filesystem is one of the most important skills for working with any computer. On cloud servers, these tasks are usually done through the terminal using well-known Linux shells and standard commands. This guide will walk you through some of the essential skills needed to work with files and directories from the terminal.

Linux Essentials: Step-by-Step Guides

Linux Essentials: Step-by-Step Guides

Tutorials

Learn the basics of the Linux terminal — what it is, how the shell and command prompt work, and how to run your first commands.

Products

Server in the United StatesServer in the United KingdomServer in NetherlandsServer in SingaporeServer in Poland

NOVPS CLOUD LTD ©2025