Are these the 4 options to fix Conflict of Both Docker & LXD using Port 8443 "by default"?

As most know, if you use LXD and later install Docker on the LXD Host then LXD starts having problems.

Are these the Four Options to resolve this Conflict?

1 - Edit docker-compose.yml and Change 8443 to whatever you like in
line 156 in docker-compose.yml

change:

   - 8443:443

to:

   - 8447:8447

2 - uninstall Docker
cmd on LXD Host:

sudo snap remove Docker

3 - change LXD’s Port use from 8443 to say 8447 (don’t use 8445 because Incus uses that)
cmd on LXD Host:

lxc config set core.https_address :8447

4 - enable “port forwarding” on the LXD Host
cmd on Host:

sudo echo “net.ipv4.conf.all.forwarding=1” > /etc/sysctl.d/99-forwarding.conf
sudo systemctl restart systemd-sysctl

Note about #4:

From what I understand (and perhaps I’m wrong here) the Docker & LXD 8443 Conflict occurs because Docker starts before LXD.

When Docker starts, it configures ip-tables to “disable IP Forwarding” which… LXD requires !

By configuring (in the LXD/Docker Host) “net.ipv4.conf.all.forwarding=1it prevents Docker from
disabling “ipv4 forwarding”

Is there a better solution to this Port “use” Conflict between Docker & LXD ?

2 Likes

Hi @bmullan,

Here is some documentation that may help: https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker

You can change port forwarding rules in your compose file to whatever you like. You can also set the port that LXD listens on to whatever you like, as long as it doesn’t conflict with another port that is in use.

Thanks.

2 Likes

@markylaing
Thanks … yes thats great that it was documented somewhere. I dug most of the same info up a couple Hours of googling & piecing together various support forum threads, reddit etc.

2 Likes