This article will demonstrate the command line procedure to restart Docker on different operating systems.
What is the Command-Line Procedure to Restart Docker?
The procedure to restart Docker relies on the operating system. It can be done on various operating systems, such as:
How to Restart Docker Using Command Line on Windows?
To restart Docker using the command line on Windows, first, launch Windows PowerShell as an administrator. Then, stop the Docker Daemon using the “net stop docker” command and start it again via the “net start docker” command.
Follow the given-provided steps for a better understanding.
Step 1: Stop Docker Daemon
First, execute the provided command to stop the Docker Daemon:
In the above, Docker has been stopped.
Step 2: Restart Docker Daemon
Then, start the Docker Daemon again with the help of the below-listed command:
The above output indicates that Docker has been successfully restarted.
How to Restart Docker Using Command Line on Linux?
To restart Docker using the command line on Linux, first, launch the Ubuntu terminal as an administrator. Then, restart the Docker Daemon using the “sudo systemctl restart docker” command. Next, verify whether the Docker is running via the “sudo systemctl status docker” command.
Step 1: Restart Docker Daemon
Run the given-provided command to restart the Docker Daemon on Linux OS:
In this way, Docker has been restarted successfully.
Step 2: Verification
Then, ensure that the Docker is running by using the below-listed command:
As you can see Docker has been restarted successfully.
How to Restart Docker Using Command Line on Mac?
To restart Docker using the command line on Mac, first, open the terminal window. Then, execute the “killall Docker && open /Applications/Docker.app” command:
This command first stops the Docker daemon and then starts the Docker application.
Conclusion
To restart Docker using the command line on Windows, first, stop the Docker Daemon using the “net stop docker” command and start it again via the “net start docker” command. For Linux OS, utilize the “sudo systemctl restart docker” command. Moreover, use the “killall Docker && open /Applications/Docker.app” command on Mac OS. This article has demonstrated the command line procedure to restart Docker on different operating systems.