Docker failing to create IP table rules

Thank you. sorry for the slow response. So we know now that you are using the official Docker CE on Ubuntu 22.04. That should work. There are newer versions which you can install to see if it was fixed. 28.0.4 is the latest. I tested only on Ubuntu 24.04. You could also check if you have an uptodate iptables.

But I think the error means that the DOCKER-FORWARD chain is missing from the rules so it cannot be updated when you add a new docker network and Docker Compose does it. The chain can be missing because another tool deletes it. It can be a virtualization software or firewall or any security tool.

You can read about iptables related topics in the documentation

Incorrect iptables rules are usually fixed when the docker daemon is restarted, since it generates new rules then, but if you had anything to change the rules, it will break that.

If you wan to check the current rules are, you can run

iptables -S

And this is how it looks like normally

-P INPUT ACCEPT
-P FORWARD DROP
-P OUTPUT ACCEPT
-N DOCKER
-N DOCKER-BRIDGE
-N DOCKER-CT
-N DOCKER-FORWARD
-N DOCKER-ISOLATION-STAGE-1
-N DOCKER-ISOLATION-STAGE-2
-N DOCKER-USER
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-FORWARD
-A DOCKER ! -i docker0 -o docker0 -j DROP
-A DOCKER-BRIDGE -o docker0 -j DOCKER
-A DOCKER-CT -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A DOCKER-FORWARD -j DOCKER-CT
-A DOCKER-FORWARD -j DOCKER-ISOLATION-STAGE-1
-A DOCKER-FORWARD -j DOCKER-BRIDGE
-A DOCKER-FORWARD -i docker0 -j ACCEPT
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
-A DOCKER-USER -j RETURN

And you can see the DOCKER-FORWARD chain there. I deleted the chain and tried to create a docker network and I got the same error as you.