Is it possible to install with IPv6 disabled? (Spoiler: I don't think so)

I see in the web template where it checks to see if /proc/net/if_inet6 exists and turns off the listen for [::]:80, but there’s still one in the default nginx file.

I added these to try to fix that:

  - exec: sed -i '/listen \[::\]:80 default_server;/d' /etc/nginx/sites-available/default
  - exec: sed -i 's/listen 80 default_server;/listen 0.0.0.0:80 default_server ipv6only=off;/' /etc/nginx/sites-available/default
  - exec: sed -i 's/listen 80 default_server;/listen 0.0.0.0:80 default_server ipv6only=off;/' /etc/nginx/conf.d/discourse.conf

But I still see this in the logs:

2025/09/02 21:34:29 [emerg] 359#359: socket() [::]:80 failed (97: Address family not supported by protocol)
2025/09/02 21:34:34 [notice] 3240#3240: signal process started
2025/09/02 21:34:34 [error] 3240#3240: open() "/run/nginx.pid" failed (2: No such file or directory)

A long time ago, it seemed impossible:

Has anyone actually made Discourse work with IPv6 disabled at the kernel level?

(Why? Because the VM someone supplied has IPv6 turned off. It took months for them to provision a VM that they would let me access.)

Doubtful. I’ve also recently removed a similar line in the ssl file recently with some eyes by @schleifer - just hadn’t gotten to the web template yet.

IPv6 support is pretty baked into our package, so it’s fairly difficult to rip out cleanly everywhere, and provide verification/support for it.

1 Like

Thanks so much for the quick confirmation! I was pretty sure that was the case, and am relieved that I hadn’t overlooked some obvious simple solution.