Docker logodocker Get Docker →
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli \
    containerd.io docker-compose-plugin
Setting up docker-ce …
Created symlink docker.service

$ sudo docker run hello-world
Hello from Docker!
Docker install guide

Docker install, the right way for your system

There are three common ways to install Docker. Choose one based on where it will run, follow the matching steps and finish with a quick health check.

Choose your Docker install method

Each path ends with a working docker command. They differ in what else comes along.

Laptops

Docker Desktop

A graphical app for macOS, Windows and Linux desktops. Best for development and learning.

Servers

Engine from a repository

Add the Docker package repository to Linux and install with apt or dnf. Easy to update and audit.

Quick tests

Convenience script

A single script installs the latest Engine. Handy for throwaway VMs, not recommended for production.

Ubuntu / Debian

Install Docker Engine on Linux

Remove any old docker.io packages first, then add the repository key and source. After that, installation is one apt command.

sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

On Fedora and RHEL the flow is the same with dnf and the matching repository file.

Fast path

Install with the convenience script

Download the script, read it if you like, then run it with root rights. It detects your distribution automatically.

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

After the Docker install

A few small tweaks make daily work more comfortable on Linux.

  1. Skip sudo

    Run sudo usermod -aG docker $USER, then log out and in again.

  2. Start on boot

    Enable the service with sudo systemctl enable docker.

  3. Limit logs

    Set a max log size in daemon.json so containers do not fill the disk.

  4. Keep it updated

    Docker updates arrive with your regular apt or dnf upgrades.

Confirm the Docker install

Run docker run hello-world. If you see a greeting, the engine, network and image pulls all work.

Verification tips

Docker install questions

Should I install docker.io or docker-ce?

docker.io comes from your distribution and can lag behind. docker-ce comes from Docker’s own repository and gets new features first.

Can I install Docker without root?

Yes, rootless mode runs the daemon as a normal user. It has some networking limits but improves isolation on shared machines.

How do I uninstall Docker?

Remove the packages with apt or dnf purge, then delete /var/lib/docker if you also want to erase images and volumes.

Does the install include Compose?

Yes, when you add docker-compose-plugin. Use it as docker compose, with a space.