Configure Lighttpd Port: A Comprehensive Guide

Mississauga Jul 01, 2026

Lighttpd, a lightweight web server, is renowned for its speed, security, and flexibility. Configuring Lighttpd to use a specific port is a common task, as it allows you to run multiple web servers on the same system. By default, Lighttpd listens on port 80 for HTTP and 443 for HTTPS. However, you might want to change these to other ports for various reasons, such as running multiple web servers or complying with specific network policies.

the tcp / ip model is shown in this diagram
the tcp / ip model is shown in this diagram

In this guide, we'll walk you through the process of configuring Lighttpd to use a different port. We'll cover both the configuration file method and the command-line method for your convenience.

Configuring and Implementing Linux's iptables - Part 1
Configuring and Implementing Linux's iptables - Part 1

Configuring Lighttpd Port via Configuration File

Modifying the Lighttpd configuration file is the most reliable and recommended method to change the port. This method ensures that the changes persist even after server restarts.

a close up of a computer with wires connected to it
a close up of a computer with wires connected to it

Here's a step-by-step guide to configuring Lighttpd port via the configuration file:

Accessing the Configuration File

Do You Know?
Do You Know?

First, you need to locate the Lighttpd configuration file. By default, it's located at `/etc/lighttpd/lighttpd.conf`. You can use a text editor like nano or vim to open the file:

$ sudo nano /etc/lighttpd/lighttpd.conf

Modifying the Port Settings

Once you're in the configuration file, look for the following lines:

the back side of a flyer for an event with information about its locations and features
the back side of a flyer for an event with information about its locations and features

server.port = 80
server.https.port = 443

To change the ports, simply replace the numbers with your desired ports. For example, to use ports 8080 for HTTP and 8443 for HTTPS, change the lines to:

server.port = 8080
server.https.port = 8443

After making the changes, save and close the file. Then, restart Lighttpd to apply the new settings:

$ sudo /etc/init.d/lighttpd restart

Configuring Lighttpd Port via Command Line

a notepad with a pen on top of it
a notepad with a pen on top of it

For quick changes or testing purposes, you can configure Lighttpd port directly from the command line. This method is convenient but does not persist across server restarts.

Here's how to configure Lighttpd port via the command line:

the port address translation pat is shown in this graphic above it's description page
the port address translation pat is shown in this graphic above it's description page
Learn how to copy a directory on Linux
Learn how to copy a directory on Linux
How to access virtual COM port from UWP app | Microsoft Community Hub
How to access virtual COM port from UWP app | Microsoft Community Hub
Key Components of Port Operations | Abdijabar Hajimustaf
Key Components of Port Operations | Abdijabar Hajimustaf
@r1pnc0
@r1pnc0
a young woman sitting on the floor next to a table and chair in a restaurant
a young woman sitting on the floor next to a table and chair in a restaurant
What Is UPnP (Universal Plug and Play)? Get Its Info Now - MiniTool
What Is UPnP (Universal Plug and Play)? Get Its Info Now - MiniTool
Tutorial: Secure TLS Communication with MQTT using mbedTLS on top of lwip
Tutorial: Secure TLS Communication with MQTT using mbedTLS on top of lwip
ibess
ibess
OpenVPN Windows PC Client Configuration Steps
OpenVPN Windows PC Client Configuration Steps
IP Address Explained: Public vs Private + Static vs Dynamic (Visual Map)
IP Address Explained: Public vs Private + Static vs Dynamic (Visual Map)
a small boat floating on top of a large body of water under a cloudy sky
a small boat floating on top of a large body of water under a cloudy sky
Cute Couple Selfies, Asian Beauty, Rpw Background Template, Julia Barretto Necklace, Elise Joson Port, Julia Baretto Aesthetic, Aesthetic Women
Cute Couple Selfies, Asian Beauty, Rpw Background Template, Julia Barretto Necklace, Elise Joson Port, Julia Baretto Aesthetic, Aesthetic Women
This is the best companion app for the Linux terminal on Android
This is the best companion app for the Linux terminal on Android
a woman sitting on top of a bed next to a black purse and holding her arm behind her head
a woman sitting on top of a bed next to a black purse and holding her arm behind her head
an info sheet describing the different types of computers and their functions to operate them on
an info sheet describing the different types of computers and their functions to operate them on
🔁 Pivoting with Ligolo-MP — Multi-User Tunneling & Pivoting

Use Ligolo-MP to create authenticated, multi-user tunnels for controlled pivoting in authorized red-team labs and complex network exercises — always in isolated testbeds and with written permission. ⚠️🔐

#LigoloMP #Pivoting #RedTeam #PenTesting #EthicalHacking #NetworkSecurity #InfoSec #CyberSecurity
🔁 Pivoting with Ligolo-MP — Multi-User Tunneling & Pivoting Use Ligolo-MP to create authenticated, multi-user tunnels for controlled pivoting in authorized red-team labs and complex network exercises — always in isolated testbeds and with written permission. ⚠️🔐 #LigoloMP #Pivoting #RedTeam #PenTesting #EthicalHacking #NetworkSecurity #InfoSec #CyberSecurity
the diagram shows how ledap works
the diagram shows how ledap works
a computer screen with an image of a network on the bottom and words above it
a computer screen with an image of a network on the bottom and words above it
🚀 TCP/IP Model Made Easy | 4 Layers Every Computer Science Student Must Know
🚀 TCP/IP Model Made Easy | 4 Layers Every Computer Science Student Must Know

Using the lighttpd -f Option

The `-f` option allows you to specify a configuration file to use. You can create a temporary configuration file with your desired port settings and pass it to Lighttpd:

$ sudo lighttpd -f /path/to/your/configfile.conf

Using the lighttpd -p Option

The `-p` option lets you specify the port directly from the command line. This is useful for quick tests:

$ sudo lighttpd -p 8080

To use this method, you'll need to run the command each time you start Lighttpd. For persistent changes, use the configuration file method.

In conclusion, configuring Lighttpd to use a different port is a straightforward process. Whether you choose to modify the configuration file or use the command line, you can easily run Lighttpd on your desired port. Always remember to restart Lighttpd after making changes, and ensure that the port you choose is not already in use by another service. Happy configuring!