How can I change the default port of pihole? (changing lighttpd.conf not working)

Currently, I can access the admin console by going to "192.168.0.143/admin". However, I want to make it so I can only access it from "192.168.0.143:8000/admin". I've tried changing the default port in lighttpd.conf, from 80 to 8000 assigned "server.port := 8000" in external.conf, and restarted lighttpd between both changes, and restarted my raspberry pi overall. Every single time, I can still connect to "192.168.0.143/admin."

Should I be looking in another file to change this behavior? Is there some step that I'm missing?

Debug Token:
https://tricorder.pi-hole.net/ric4ne2pdv

server.port = 8088

in /etc/lighttpd/lighttpd.conf (not external.conf) does it for me (i have something else running on port 8000)

1 Like

Don't change that file, unless you are aware and willling to deal with the consequences.
Quoting directly from that file:

###############################################################################
#     FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE.     #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#              CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE:              #
#                         /etc/lighttpd/external.conf                         #
###############################################################################

What version of lighttpd are your running, pimonkey?

Your original description is a bit mangled, mentioning changing lighttpd.conf and external.conf alike.

For lighttpd version 1.4.46 or above, you should be able to overwrite the port from Pi-hole's lighttpd.conf in your external.conf like this:

server.port := 8000

Particularly note the := operator (which isn't supported in older versions of lighttpd ).

1 Like

well, I feel embarrassed. Turns out I had apache running on my pi as well, and even though I installed the lighttpd server, it was using apache. I confirmed this by uninstalling lighttpd, and I was able to change the port using apache.

I guess pihole will automatically use apache if you have it, even if you install lightttpd? Either way, the problem has been solved.

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