I have Debian 11 with installed docker. After successful installation, docker service could not started.
sudo systemctl start docker
output:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
sudo systemctl status docker.service
output:
soft@p633466:~$ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-10-05 19:00:05 MSK; 41s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 9932 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 9932 (code=exited, status=1/FAILURE)
journalctl -xe
output:
soft@p633466:~$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.
Oct 05 18:07:49 p633466.vps systemd[8931]: var-lib-docker-overlay2-metacopyx2dcheck139345502-merged.mount: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit UNIT has successfully entered the 'dead' state.
Oct 05 18:07:54 p633466.vps sudo[9109]: pam_unix(sudo:session): session closed for user root
Oct 05 18:08:09 p633466.vps systemd[8931]: var-lib-docker-overlay2-checkx2doverlayfsx2dsupport2562965269-merged.mount: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit UNIT has successfully entered the 'dead' state.
Oct 05 18:08:16 p633466.vps systemd[8931]: var-lib-docker-overlay2-metacopyx2dcheck750605051-merged.mount: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit UNIT has successfully entered the 'dead' state.
Oct 05 18:58:55 p633466.vps su[9860]: (to root) soft on pts/0
Oct 05 18:58:55 p633466.vps su[9860]: pam_unix(su:session): session opened for user root(uid=0) by soft(uid=1000)
Oct 05 18:59:47 p633466.vps su[9860]: pam_unix(su:session): session closed for user root
Oct 05 18:59:56 p633466.vps sudo[9871]: soft : TTY=pts/0 ; PWD=/home/soft ; USER=root ; COMMAND=/bin/systemctl start docker
Oct 05 18:59:56 p633466.vps sudo[9871]: pam_unix(sudo:session): session opened for user root(uid=0) by soft(uid=1000)
Oct 05 18:59:57 p633466.vps systemd[8931]: var-lib-docker-overlay2-metacopyx2dcheck941122558-merged.mount: Succeeded.
Linux kernel version:
soft@p633466:~$ uname -a
Linux p633466.vps 4.19.0 #1 SMP Tue Jun 9 12:58:54 MSK 2020 x86_64 GNU/Linux
Debian version:
soft@p633466:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
I tried reinstall docker and etc. Also rebooted server multiple times, didnt help
2
Answers
Run from the root cli:
/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Post the log if the error is not clear
I was having an issue like this on Debian and found that it was caused by Docker using iptables for network address translation (NAT) while Debian wants to use nftables.
The fix was to setup Debian to use the legacy iptables like so:
Followed by restarting the Docker daemon (dockerd)