Read the message literally: systemd has no unit called docker.service on this machine, which almost always means Docker Engine is not installed as a system service. Run systemctl list-unit-files | grep -i docker and which docker to see which Docker package, if any, you have. The fix depends on the answer: install Docker Engine from Docker’s own repository, manage a snap with snap commands, unmask a masked unit, or turn on systemd in WSL.
What “Unit docker.service not found” actually means
systemd starts services from unit files. When you type sudo systemctl start docker, systemd looks for a file named docker.service in its unit directories. The systemctl manual lists not-found as one of the load states, and defines the not-found state as “The unit file does not exist.” So the error is not a crash or a permissions problem inside Docker. Nothing called docker.service was ever installed, or it was installed under a different name.
That happens in a handful of predictable situations: Docker Engine was never installed (only the docker command-line client came in with another package), Docker came from a snap, you are on an RPM distribution where a different package answers to the name “docker”, you are inside WSL with systemd off, or you installed Docker Desktop for Linux, which runs as a per-user service with a different name.
Check how Docker got onto this machine
Run these three commands and match the output to the table below:
systemctl list-unit-files | grep -i dockerwhich dockersnap list 2>/dev/null | grep docker

| What the commands show | Most likely cause | Go to |
|---|---|---|
No Docker unit files and no docker command |
Docker Engine is not installed | Ubuntu and Debian, or Fedora, RHEL and CentOS section |
which docker prints a path under /snap/bin |
Docker is a snap package | Snap section |
docker works but no docker.service unit |
Only the client is installed, or it talks to Docker Desktop or a remote host | Repository install or Docker Desktop section |
You are in WSL and systemctl itself fails |
systemd is not enabled in that distribution | WSL section |
docker.service is listed with the state masked |
The unit exists but was masked | Masked unit section |
Install Docker Engine from Docker’s repository (Ubuntu and Debian)
This is the fix for most people who see the error. Docker publishes these steps on its Install Docker Engine on Ubuntu page, and the Debian version of the page is the same apart from the URLs. If apt stops at “Waiting for cache lock” during any step, deal with that first using the cache lock fix for Ubuntu.
- Remove the unofficial packages Docker says conflict with its own (Docker lists
docker.ioamong them):sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc docker-buildx podman-docker containerd runc | cut -f1) - Install the tools for the signing key and download Docker’s key:
sudo apt updatesudo apt install ca-certificates curlsudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc - Add the repository. Docker now writes it as a file named
/etc/apt/sources.list.d/docker.sources. Copy that block straight from Docker’s page for your distribution, because it fills in your release codename and changes from time to time. Older one-linedocker.listentries from earlier tutorials are the previous format. - Install Docker Engine and its plugins:
sudo apt updatesudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - Check the service. Docker’s page says to run
sudo systemctl status docker, and if Docker is not running, start it withsudo systemctl start docker.
On Debian, the key and repository URLs use linux/debian instead of linux/ubuntu. Docker says installing on Ubuntu derivatives such as Linux Mint is not officially supported (though it may work). Its Debian page notes that on Debian testing or a derivative such as Kali Linux you may need to put the codename of the matching Debian release in the repository block.
Docker also offers a convenience script. In Docker’s words it “isn’t recommended for production environments”, and Docker tells you to examine any script downloaded from the internet before you run it. Use the repository steps above on anything that matters.
Fedora, RHEL and CentOS: install, then enable the service
On these distributions, Docker Engine comes from Docker’s own repository, not from the distribution’s default packages. Docker’s pages for Fedora and RHEL (and the matching CentOS page) start by removing older packages; on RHEL that list includes podman and runc.
- Remove the packages Docker lists for your distribution (the exact list is on its page).
- Add Docker’s repository with the
dnf config-managerline from the page for your distribution. - Install:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - Start Docker now and at every boot:
sudo systemctl enable --now docker
That last step matters here. Unlike on Debian and Ubuntu, the service is not started for you after installation on these distributions, so a fresh install can look broken until you enable it.
If Docker came from a snap
The docker snap is, in its listing’s words, “built by Canonical based on source code published by Docker, Inc.” and “not endorsed or published by Docker, Inc.” Snaps run their services as their own systemd units named after the snap (Snapcraft’s service guide uses snap.lxd.daemon.service as an example), not as docker.service, so tools or tutorials that call systemctl start docker will fail. Use snap’s own service commands for it (snap services lists them, and snap start, snap stop and snap restart control them), or, if you need the standard service, remove the snap with sudo snap remove docker and follow the repository steps above. Back up anything you need from the snap before removing it.
If the unit is masked or systemd has not caught up
A masked unit gives a different message: systemctl reports the unit as masked rather than not found. The systemctl manual explains that mask links unit files to /dev/null, “making it impossible to start them”, and that unmask “will undo the effect of mask”.
- Unmask the service and its socket:
sudo systemctl unmask docker.service docker.socket - Reload systemd’s configuration after installing or changing unit files:
sudo systemctl daemon-reload - Start it and turn it on at boot:
sudo systemctl enable --now docker
The manual notes that enable on its own does not also start a unit, which is why --now is there.
Docker inside WSL on Windows
In a WSL distribution, systemctl only works when systemd is on. Microsoft’s systemd in WSL page says to add this to /etc/wsl.conf inside the distribution:
[boot]systemd=true
Then run wsl.exe --shutdown from PowerShell, reopen the distribution and confirm with systemctl list-unit-files --type=service. Microsoft notes that systemd is already the default for the current Ubuntu installed with wsl --install, and that it needs a recent WSL release, so run wsl --update if the setting has no effect. Install Docker Engine inside the distribution with the repository steps above. If WSL itself is the problem, see restarting WSL on Windows 11 after changing the file.
The other route is Docker Desktop for Windows. With it, you do not run docker.service inside WSL at all. Docker’s WSL 2 backend page says to select Use WSL 2 based engine on the General tab, then go to Settings > Resources > WSL Integration to turn on your distribution. Docker also says to uninstall any Docker Engine or CLI you installed directly inside the distribution before you install Desktop, so pick one approach.
Starting from scratch? See installing and using WSL on Windows 11 or installing WSL2 on Windows 10, and the ways to run Linux on Windows 10 if you are still choosing between WSL and a virtual machine.
Docker Desktop for Linux uses a different service name
Docker Desktop for Linux runs Docker inside its own virtual machine and is controlled as a user service. Docker’s Docker Desktop for Ubuntu page gives the commands:
- Start it:
systemctl --user start docker-desktop - Start it at sign-in:
systemctl --user enable docker-desktop - Stop it:
systemctl --user stop docker-desktop
So if you only have Desktop, sudo systemctl start docker has nothing to start. Desktop also creates its own dedicated context so it does not clash with a local Docker Engine. If you want the system service as well, install Docker Engine from the repository; containers in one will not appear in the other.
Using docker without sudo
Docker’s Linux post-installation steps cover running docker as a normal user. Read Docker’s warning first: “The docker group grants root-level privileges to the user.” Add only accounts you would trust with root, and consider Docker’s rootless mode if that is a concern.
- Create the group if it does not exist:
sudo groupadd docker - Add your account:
sudo usermod -aG docker $USER - Log out and back in, or run
newgrp dockerto apply the change in the current shell.
The same page notes that Docker starts on boot by default on Debian and Ubuntu; on other systemd distributions it gives sudo systemctl enable docker.service and sudo systemctl enable containerd.service.
Confirm Docker Engine is running
systemctl status dockershould report the service as active (running).sudo docker run hello-world(ordocker run hello-worldafter the group step) downloads a test image and prints a confirmation message, which is the check Docker’s own pages use.
With Docker working, a reverse proxy is a common next container; Nginx Proxy Manager custom locations shows how to route paths to separate containers.
docker.service unit answers
Why does “sudo service docker start” say unrecognized service?
It is the same problem in older wording. The service command looks for the same Docker service, and there is none until Docker Engine is installed as a service.
Should I use docker.io or docker-ce?
Docker’s install page lists docker.io among the unofficial packages to remove before installing Docker Engine. Packages shipped by a distribution are maintained by that distribution, not by Docker. The steps above use Docker’s docker-ce packages.
Can I run Docker without systemd?
Yes, for testing. Docker’s Start the daemon page says you can run dockerd manually (with sudo if your system needs it); it then runs in the foreground and sends its logs to the terminal, and Ctrl+C stops it. It will not start at boot that way.
Can I run Docker Desktop and Docker Engine on the same Linux PC?
Docker generally recommends stopping Docker Engine while you use Docker Desktop. The two keep separate contexts, images and containers.
Planning a different Ubuntu release for this server first? See downgrading Ubuntu 22.04 to 20.04 and its alternatives, and if an old web server is still holding port 80 before your first container, removing Apache2 from Ubuntu clears it out.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.