How to start the docker daemon
Starting the Docker daemon can be done in a few different ways, depending on your operating system and what you're trying to achieve. Let's walk through the steps to get the Docker daemon up and running.
First off, in most cases, the Docker daemon is automatically started by your operating system when you boot up your machine. This is usually handled by something called a system utility, which makes life easier because Docker will start without you having to do anything manually.
However, if you find yourself in a situation where you need to start Docker manually, or if you're just curious about how it works, here's what you can do.
Starting Docker with Docker Desktop
If you're using Docker Desktop the Docker daemon is started automatically when you start Docker Desktop! So simply make sure Docker Desktop is running. If you need to install it first, check out this guide: How to install Docker Desktop.
Starting Docker with systemd
If you're using an operating system like Ubuntu or Debian, Docker might already be set up to start automatically. But if it's not running, you can start it manually with a simple command. Open up your terminal and type:
sudo systemctl start docker
This command tells your system to start the Docker daemon. If you want Docker to start every time you boot your computer, you'll need to configure it to do so. You can find instructions on how to do this on the Docker website.
Running Docker Manually
If you're not using a system utility, or if you just want to see what happens when you start Docker yourself, you can use the dockerd
command. Depending on your system settings, you might need to add sudo
before the command. So, in your terminal, you'd type:
sudo dockerd
When you start Docker this way, it runs in the foreground, which means you'll see all its activity and logs right there in your terminal. It's a good way to get a feel for what Docker is doing behind the scenes.
To stop Docker when you've started it manually, just press Ctrl+C
in your terminal. This will interrupt the process and stop Docker from running.
So, whether you're letting your system handle starting Docker or you're doing it manually, these are the basics of getting the Docker daemon up and running.