Docker Compose returns error "networks have overlapping IPv4"

From the error you’ve shown here, it looks to me that docker is trying to create a network with bridge driver named br-791b388ece09, which then complains has an overlapping IP subnet with the bridge br-a675c47764eb.

So first check your available networks using:

$ docker network ls

If you see the bridge with the ID a675c47764eb, make sure this is deleted first before creating new one on the same subnet, for this use:

$ docker network rm a675c47764eb

Then rerun your docker setup for swarm, it should properly create the network.

Alternatively, you can use a different IP subnet. Replace 192.168.50.x with something like 192.168.51.x. This should solve your problem as well.


List all network

$ip a

If you see the bridge with br-a675c47764eb and its status is down,delete it

$brctl delbr br-a675c47764eb

Then restart docker

$service docker restart

Run docker-compose Again


If you run it on linux system, just confirm that your iptables has opened the port that your docker-compose need. Like this:

iptables -I INPUT -p tcp --dport 80 -s 0.0.0.0 -j ACCEPT

# or

vim /etc/sysconfig/iptables

# then

systemctl restart iptables

Then remove the conflict network on the same subnet:

docker network ls

docker network rm <id>

If above cant work, just restart docker, it should be all right.