Starting the Docker service on Ubuntu only for systemctl start docker to fail with the systemd status: “Job for docker.service failed” and journal logs displaying: “failed to start daemon: Error initializing network controller: list bridge addresses failed: no available IPv4 addresses on this host’s interfaces” prevents running containers and halts deployment pipelines. In Linux, Docker engine (dockerd) establishes virtual Ethernet pairs, network namespaces, and default software bridge interfaces (docker0) managed through kernel netlink and iptables rules. When existing subnet ranges collide, corrupted local network state databases lock libnetwork, or iptables backend switches disrupt IP forwarding, the Docker daemon refuses to boot. This guide outlines how to purge conflicting bridge interfaces, reset Docker network state, and restore dockerd on Ubuntu.
Why Does the Network Controller Initialisation Fail?
The Docker network controller manages virtual bridge interfaces and IP address pools. Common triggers for startup failures include:
- Subnet Pool Exhaustion or IP Collision: The default Docker pool (
172.17.0.0/16) overlapping with a local LAN subnet, VPN virtual interface, or host route. - Corrupted Libnetwork Local Database: Damaged network state records stored inside
/var/lib/docker/network/files/local-kv.db. - Stale docker0 Bridge Device: Orphaned bridge interfaces created by previous Docker crashes that fail kernel netlink validation.
- iptables / nftables Backend Incompatibilities: Ubuntu 22.04 or 24.04 utilizing
nftableswhile Docker expects legacyiptables-legacybinaries. - IPv4 Forwarding Disabled in Kernel: Missing sysctl configurations preventing packet forwarding between host and bridge network namespaces.
Method 1: Delete the Corrupted docker0 Bridge Interface
Removing the orphaned software bridge device allows the Docker daemon to recreate a clean interface during startup.
- Open your terminal and bring down the existing bridge interface:
sudo ip link set dev docker0 down - Delete the bridge device using the ip utility:
sudo ip link delete docker0(Or use
sudo brctl delbr docker0if bridge-utils is installed.) - Attempt to start the Docker daemon:
sudo systemctl start docker - Confirm that the service is active:
sudo systemctl status docker
Method 2: Remove the Corrupted Libnetwork State Database
If Docker crashed during a network creation event, its internal key-value store can prevent network controllers from initializing.
- Ensure Docker is stopped:
sudo systemctl stop docker.service docker.socket - Delete or move the local network database file:
sudo rm -rf /var/lib/docker/network/files/local-kv.db - Restart the service:
sudo systemctl start docker - Docker will automatically rebuild a clean key-value database schema.
Method 3: Configure a Custom Bridge Subnet in daemon.json
If your local enterprise Wi-Fi or VPN uses the 172.17.x.x or 172.18.x.x IP ranges, assign Docker an alternate RFC 1918 private subnet.
- Edit Docker’s daemon configuration file:
sudo nano /etc/docker/daemon.json - Add or update the
bip(Bridge IP) declaration to use a non-conflicting subnet:{ "bip": "192.168.240.1/24", "default-address-pools": [ { "base": "192.168.241.0/20", "size": 24 } ] } - Save changes (Ctrl + O, then Enter) and exit (Ctrl + X).
- Restart the Docker daemon:
sudo systemctl restart docker
Method 4: Switch to iptables-legacy Backend
Modern Ubuntu installations default to iptables-nft, which can cause socket errors in Docker versions expecting standard netfilter tables.
- Configure Ubuntu alternatives to use legacy iptables:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy - Restart Docker:
sudo systemctl restart docker
Method 5: Enable IPv4 Packet Forwarding
Ensure that Linux kernel networking is configured to allow packet forwarding between network adapters:
- Edit
/etc/sysctl.conf:sudo nano /etc/sysctl.conf - Uncomment or add the following line:
net.ipv4.ip_forward=1 - Apply changes immediately without rebooting:
sudo sysctl -p