Why does Pi-Hole use port 80 even when web UI is disabled?

Hi,

I'm trying to run nginx on the server but Pi-Hole keeps defaulting to port 80 after updating, even when I deselected the option to host a web UI during setup.

Is there a practical reason why Pihole uses port 80 apart from the web UI?

Yes and no.

It's the default port for http access and it's automatically set via the lighttpd.conf when installed.

One can change the port to anything (available) and if you're using nginx, you can create a config file in your sites-enabled to forward the request to the designated port, alongside everything else you might have there.

As for port 80, yes, that is build in the config file that gets overwritten at every update.

Most users do not have any type of server present on the machine and Pi-hole went with the default (80). If you are advanced enough to run something else (like nginx), changing the ports(s) should not be an issue.

Is there any effect on adblocking if port 80 is used for something else?

None.

Port 80 is used only for the web interface.

Port 53 is for DNS (where blocking happens).

Then when I choose to not install the web server, why does it install it?

Hello agneev,

If you need port 80 for your nginx, then consider to add a new static IP address on your network interface.
Then point your nginx virtual server to this new IP address and its free port 80.

Multiple IP addresses on the same physical interface is part of the GNU/Linux kernel since version 2.2, that's since December 1999, 20 years ago.

If your distro uses the package dhcpcd5, then /lib/dhcpcd/dhcpcd-hooks/ is the place to add your script that adds a new static IP address. Do $man dhcpcd-run-hooks

If your distro does not use the package dhcpcd5, then /etc/network/if-up.d/ is the place to add your script that adds a new static IP address.

Grtz, F.C.

It wouldn't be this complicated if Pi-Hole decided to not install lighttpd during installation, when I de-selected the option to enable the web server.

I appreciate your help nonetheless.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.