How to change port for lighttpd?

SO...to wrap it up ... WHAT is the preferred way of changing the port nr of lighttpd in 2025 ? Without too much, well, bashing about ?

That would be a question for lighttpd support.

Pi-hole 6 comes with its own embedded webserver - it does not use lighttpd.

2 Likes

Bucking_Horn beat me to it ... again.
But here is anyway :wink:

You dont bc with Pi-hole version 6, lighttpd isnt installed as dependency anymore as was with version 5.
The pihole-FTL binary has a web daemon embedded called civetweb:

$ pstree -pst $(pidof -s pihole-FTL)
systemd(1)───pihole-FTL(4960)─┬─{civetweb-master}(22653)
                              β”œβ”€{civetweb-timer}(22652)
                              β”œβ”€{civetweb-worker}(22654)
                              β”œβ”€{civetweb-worker}(22655)
                              β”œβ”€{civetweb-worker}(22656)
                              β”œβ”€{civetweb-worker}(22657)
                              β”œβ”€{civetweb-worker}(22658)
                              β”œβ”€{civetweb-worker}(22659)
                              β”œβ”€{civetweb-worker}(22660)
                              β”œβ”€{civetweb-worker}(22830)
                              β”œβ”€{civetweb-worker}(22831)
                              β”œβ”€{database}(22648)
                              β”œβ”€{dns-client}(22650)
                              β”œβ”€{housekeeper}(22649)
                              β”œβ”€{ntp-server4}(22646)
                              β”œβ”€{ntp-server6}(22647)
                              └─{timer}(22651)
$ sudo ss -nltp | grep 'State\|pihole-FTL'
State  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0      200          0.0.0.0:443       0.0.0.0:*    users:(("pihole-FTL",pid=4960,fd=39))
LISTEN 0      32           0.0.0.0:53        0.0.0.0:*    users:(("pihole-FTL",pid=4960,fd=23))
LISTEN 0      200          0.0.0.0:80        0.0.0.0:*    users:(("pihole-FTL",pid=4960,fd=38))
LISTEN 0      200             [::]:443          [::]:*    users:(("pihole-FTL",pid=4960,fd=41))
LISTEN 0      32              [::]:53           [::]:*    users:(("pihole-FTL",pid=4960,fd=25))
LISTEN 0      200             [::]:80           [::]:*    users:(("pihole-FTL",pid=4960,fd=40))

You can alter the ports for HTTP or HTTPS via de webGUI "Expert" settings or via shell eg:

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

o = optional
s = secured via TLS (HTTPS)

$ sudo pihole-FTL --config webserver.port '8080o,4433os,[::]:8080o,[::]:4433os'
8080o,4433os,[::]:8080o,[::]:4433os
$ sudo ss -nltp | grep 'State\|pihole-FTL'
State  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0      200          0.0.0.0:4433      0.0.0.0:*    users:(("pihole-FTL",pid=4960,fd=39))
LISTEN 0      32           0.0.0.0:53        0.0.0.0:*    users:(("pihole-FTL",pid=4960,fd=23))
LISTEN 0      200          0.0.0.0:8080      0.0.0.0:*    users:(("pihole-FTL",pid=4960,fd=38))
LISTEN 0      200             [::]:4433         [::]:*    users:(("pihole-FTL",pid=4960,fd=41))
LISTEN 0      32              [::]:53           [::]:*    users:(("pihole-FTL",pid=4960,fd=25))
LISTEN 0      200             [::]:8080         [::]:*    users:(("pihole-FTL",pid=4960,fd=40))

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