Skip to content

Install Docker on Linux

Installing Docker on Linux is usually done through the terminal. Don’t worry, it’s very straightforward! 🐧

Step 1: Update your system

First, make sure your computer’s list of software is up to date. Open your terminal and type:

Terminal window
sudo apt update

Step 2: Install Docker

To install Docker, run this command:

Terminal window
sudo apt install docker.io -y

Step 3: Start Docker

Now, make sure the Docker service is running:

Terminal window
sudo systemctl start docker
sudo systemctl enable docker

Step 4: Verify the installation

Check if Docker is correctly installed by asking for its version:

Terminal window
docker --version

If you see a version number like Docker version 24.0.5, you are good to go! 🎉


Tip for Linux Users

By default, you might need to use sudo before every docker command. To fix this and run docker without sudo, you can add your user to the docker group:

Terminal window
sudo usermod -aG docker $USER

(You will need to log out and log back in for this to work.)