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

**URL:** <https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560>\
**Category:** Community Help\
**Created:** [June 9, 2021, 9:25pm UTC](https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560 "2021-06-09T21:25:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pimonkey](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/cdc98d/32.png) [@pimonkey](https://discourse.pi-hole.net/u/pimonkey)\
**Post date:** [June 9, 2021, 9:25pm UTC](https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560/1 "2021-06-09T21:25:35Z")

</div>

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](https://tricorder.pi-hole.net/ric4ne2pdv)

---

<div class="post-metadata">

**Author:** ![lupinehorror](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/lupinehorror/32/24394_2.png) [@lupinehorror](https://discourse.pi-hole.net/u/lupinehorror)\
**Post date:** [June 11, 2021, 4:02pm UTC](https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560/2 "2021-06-11T16:02:28Z")

</div>

server.port = 8088

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

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [June 11, 2021, 8:23pm UTC](https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560/3 "2021-06-11T20:23:13Z")

</div>

> [@lupinehorror](#):
>
> /etc/lighttpd/lighttpd.conf

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

```auto
###############################################################################
# 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](https://redmine.lighttpd.net/projects/1/wiki/docs_configuration) from Pi-hole's `lighttpd.conf` in your `external.conf` like this:

```auto
server.port := 8000

```

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

---

<div class="post-metadata">

**Author:** ![pimonkey](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/cdc98d/32.png) [@pimonkey](https://discourse.pi-hole.net/u/pimonkey)\
**Post date:** [June 11, 2021, 9:10pm UTC](https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560/4 "2021-06-11T21:10:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [July 2, 2021, 9:10pm UTC](https://discourse.pi-hole.net/t/how-can-i-change-the-default-port-of-pihole-changing-lighttpd-conf-not-working/47560/5 "2021-07-02T21:10:28Z")

</div>

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