OneBite.Dev - Coding blog in a bite size

restart docker daemon

Simple docker step by step how to restart docker daemon with explanation

Restarting your Docker daemon can help solve problems and ensure optimal performance. This simple tutorial will guide you step-by-step on how to do it.

Introduction

Often, you might face certain issues with Docker, which can usually be fixed by restarting the Docker daemon. This guide provides straightforward instructions on how to accomplish this.

Step 1: Open Terminal

The first step is to open your terminal. This can be done by searching for ‘terminal’ in your computer’s search bar and clicking on the respective icon.

Step 2: Stop Docker Daemon

Next, you must stop the Docker daemon. To do this, type the following command into your terminal:

sudo service docker stop

Press enter to execute the command.

Step 3: Verify Daemon Stop Status

In order to make sure that the Docker daemon has stopped successfully, you can verify it by typing the below command in the terminal:

sudo service docker status

If the Docker service has stopped successfully, the status should show as ‘inactive’ or ‘stopped’.

Step 4: Start Docker Daemon

Once you have confirmed that the Docker daemon has stopped successfully, you can start it again. Enter the following command into the terminal:

sudo service docker start

Press enter to execute the command.

Step 5: Verify Daemon Start Status

Similar to the way you confirmed that the Docker daemon had stopped, you should verify if it has started properly too. The following command should help:

sudo service docker status

This time, the status should show as ‘active’ or ‘running’.

And there you have it - a simple way to restart your Docker daemon. Executing these steps from time to time can help ensure your Docker service runs without a hitch.

docker