This page looks best with JavaScript enabled

How to install Docker

 ·  ☕ 4 min read  ·  🐧 sysadmin

Exercises to complete:

  1. Update your system
  2. Add the Docker repository and refresh repositories if needed
  3. Install Docker
  4. Enable and start Docker service
  5. Verify the Docker installation

To install Docker, you can follow these steps. Please note that you need to have sudo privileges or root access.

SLES 15 / openSUSE Leap 15.4

  1. Update your system:

Firstly, make sure your package list and the system is up to date.

1
2
sudo zypper refresh
sudo zypper update
  1. Install Docker:

Now, you can install Docker with the following command.

1
sudo zypper install docker
  1. Enable and start Docker service:

After the installation, you need to start Docker and enable it to start at boot.

1
2
sudo systemctl enable docker
sudo systemctl start docker
  1. Verify the Docker installation:

To ensure Docker has been installed correctly, you can check the installed version of Docker.

1
docker --version

This should display the version of Docker installed on your system. You can also run a simple Docker command such as:

1
sudo docker run hello-world

This command downloads a test image and runs it in a container. If it runs without errors, it’s a good indication that Docker is functioning correctly.

Remember, in order to run Docker commands as a non-root user without prepending sudo, you need to add the user to the docker group:

1
sudo usermod -aG docker $USER

Then you need to log out and log back in so that your group membership is refreshed.

That’s it! You have successfully installed Docker.

Support the author with

sysadmin
WRITTEN BY
sysadmin
QA & Linux Specialist