Ability to change the GUI port

Hello to everyone!

Is it possible to implement a form that give the Pihole admin to change the GUI port?
Indeed, in the case of an application must use the port 80 (for example a reverse proxy), it will conflict with the Pihole GUI port.

Many thanks in advance!

Is this a request for an option to expose an "easy" way to change the port or are you seeking help how to change the port.

For the latter have a look here:

This is indeed a request to "easy" change the port from the GUI (like we can find in OPNsense)
As far as I have found, this is possible to change the port by modifying some files in CLI but after a Pihole update, the default port will revert to 80 :frowning:

You can do this with modifying the lighttpd config file. I don't think it is reset on updates but this should be answered by a developer.

It should not, see here

But if you try it and it does change the port back to 80, please file a bug report as this might be a regression.

Thanks for the advice, I will modify the port and report back if it will be revert after an update.

Just for your info:

The lighttpd config file IS pulled "fresh" from github and no prior (local) changes to it are saved/restored, during an update/repair.

The PR specified above, pertains only to the Web interface (and its ability to handle different ports).

The installer/updater does not check for any custom ports. It pulls a pre-configured file on port 80 and overwrites the existing one.

2 Likes

Pi-hole v6 will allow to change the GUI port from the web interface itself.

2 Likes

Pi-hole v6 will allow to change the GUI port from the web interface itself.

If you don't have Web UI installed or it is inaccessible, you can find webserver.port configuration in /etc/pihole/pihole.toml

1 Like

was looking all over and this was the only thing that worked, thank you

If you want to change ports via command line, use:

sudo pihole-FTL --config webserver.port '80o,443os,[::]:80o,[::]:443os'

Note:

  • add the o flag to make the port optional (the server will start even if this port is in use);
  • add the s flag to make the port secure (used for https);
  • add the r flag to force redirect to secure port ('80r,443s' will redirect port 80 to 443);
  • [::]: are used to configure IPv6 ports. This is optional;
  • You can add an IP to bind the port to that IP ('192.168.0.100:80' will bind port 80 only for this IP).