CMS Ubuntu Linux

Install WordPress with Lighttpd on Ubuntu 24.04

Richard
Written by
Richard
Mar 10, 2025 Updated Mar 20, 2026 8 min read
Install WordPress with Lighttpd on Ubuntu 24.04

This article explains how to install WordPress with Lighttpd support on Ubuntu 24.04.

Lighttpd is a lightweight web server designed for high-performance environments. It is particularly well-known for its efficient handling of many concurrent connections, making it an excellent choice for serving static content and dynamic applications with fast response times.

WordPress is a content management system (CMS) for creating and managing websites, and is suitable for blogs, business websites, e-commerce stores, and much more.

Installing WordPress with Lighttpd on Ubuntu combines the benefits of both: the efficiency of Lighttpd as a web server and the flexibility and functionality of WordPress as a CMS.

Install Lighttpd

Lighttpd packages are available in the default Ubuntu repositories and require no additional installations.

Run the command below to install Lighttpd.

🐧Bash / Shell
sudo apt update
sudo apt install lighttpd

Once installed, the commands below can be used to start and enable the Lighttpd server services.

🐧Bash / Shell
sudo systemctl start lighttpd
sudo systemctl enable lighttpd

Now that Lighttpd is installed, continue to install a database server below.

Install MariaDB

You will need a database server to run WordPress. A good open-source database is MariaDB.

Run the command below to install it.

🐧Bash / Shell
sudo apt install mariadb-server

After installing the MariaDB database server, use the commands below to stop, start, and enable the MariaDB server to start when the server boots automatically.

🐧Bash / Shell
sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to validate and test if the MariaDB database server is installed successfully.

🐧Bash / Shell
sudo mariadb

After executing the commands above, you will be logged into the MariaDB console, and a message similar to the one below will be displayed.

💻Code
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you that the server is installed successfully.

Create a WordPress database

Upon successfully installing the MariaDB database server, create a blank database on the server specifically for the WordPress application.

As part of the setup, we will create a database named ‘wordpressdb ‘and a corresponding user account called ‘wordpressdbuser ‘.

Finally, we’ll grant the wordpressdbuser full access to the wordpressdb database.

All the database steps above can be done using the commands below:

But first, log on to the MariaDB database server:

🐧Bash / Shell
sudo mariadb

Then run the commands below to complete the steps:

💻Code
CREATE DATABASE wordpressdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER wordpressdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON wordpressdb.* TO wordpressdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

Ensure to replace ‘type_your_password_here‘ with your password.

Install PHP-FPM

The final component required to run WordPress is PHP-FPM. As a PHP application, WordPress supports the latest versions of PHP.

Run the commands below to install PHP-FPM.

🐧Bash / Shell
sudo apt install php-fpm php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-json php-sqlite3 php-soap php-zip

Additional help on installing PHP

How to install PHP on Ubuntu Linux

After installing PHP-FPM, run the command below to enable PHP support for Lighttpd.

🐧Bash / Shell
sudo lighty-enable-mod fastcgi fastcgi-php-fpm
sudo systemctl restart php8.3-fpm

Next, open the Lighttpd PHP configuration file [/etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf] and edit the PHP block to turn it on.

🐧Bash / Shell
sudo nano /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf

Change the highlighted block to turn on PHP support and specify the PHP version [8.3] to use.

🐘PHP
## Use PHP-FPM service for PHP via FastCGI
fastcgi.server += ( ".php" =>
((
"socket" => "/run/php/php8.3-fpm.sock",
"broken-scriptfilename" => "enable"
))
)

Restart Lighttpd.

🐧Bash / Shell
sudo systemctl restart lighttpd

Set up WordPress vhost

You are now ready to set up your WordPress virtual host file.

Run the command below to create a virtual host directory and put the WordPress vhost file [wordpress.conf] in it.

🐧Bash / Shell
sudo mkdir /etc/lighttpd/vhosts.d
sudo nano /etc/lighttpd/vhosts.d/wordpress.conf

Copy and paste the block below into the file. Update the domain name to match yours.

PowerShell
$HTTP["host"] =~ "(^|.)wordpress.example.com$" {
server.document-root = "/var/www/wordpress"
server.errorlog = "/var/log/lighttpd/wordpress.local-error.log"
accesslog.filename = "/var/log/lighttpd/wordpress.local-access.log"
}

Save and exit the file.

Next, open the main Lighttpd configuration file.

🐧Bash / Shell
sudo nano /etc/lighttpd/lighttpd.conf

Then, add the line below into the file to include all virtual hosts in the vhost directory.

💻Code
#Include the vhosts directory
include "/etc/lighttpd/vhosts.d/*.conf"

Save and exit the file.

Restart Lighttpd.

🐧Bash / Shell
sudo systemctl restart lighttpd

Download WordPress

Let’s begin downloading and configuring the WordPress files on Ubuntu Linux.

First, navigate to the /tmp/ directory and download WordPress files. After unzipping the file, move the content into the WordPress folder in the Nginx root directory.

The final step is to change the permissions. This will allow the Nginx web server to safely interact with the files, ensuring a secure environment for your WordPress installation.

Command Prompt
cd /tmp/
wget https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz
sudo mv wordpress /var/www/wordpress
sudo chown -R www-data:www-data /var/www/wordpress/

After that, open your web browser and browse to the domain name configured above to begin setting up WordPress.

💻Code
http://wordpress.example.com

A WordPress installation wizard page should appear. Select the installation language and continue to the next page.

WordPress installation language selection screen

Next, click the Let’s go button to begin the installation process.

Beginning the WordPress installation process

Type the database name, account name, and password on the next screen. Then, click Submit.

Setting up database connection for WordPress

Next, click the “Run the installation” button to install WordPress files.

Configuring initial setup for WordPress installation

Next, type in the site title, admin account, email address, and password. Then, click “Install WordPress.”

Installing WordPress on Lighttpd server

Your WordPress site should be set up and ready to use.

WordPress installation setup complete confirmation

Set up HTTPS

If you want to use HTTPS for your WordPress site, you can do that using the steps below.

First, go and obtain an SSL certificate for your server. If you don’t already have one, use the post below to learn how to get a Let’s Encrypt SSL certificate.

Generate a free Let’s Encrypt SSL certificate

After obtaining your certificate, open the WordPress virtual host file to edit it.

🐧Bash / Shell
sudo nano /etc/lighttpd/vhosts.d/wordpress.conf

Then, add the highlighted portion to the file.

PowerShell
$HTTP["scheme"] == "http" {
$HTTP["host"] == "wordpress.example.com" {
url.redirect = ("/.*" => "https://wordpress.example.com$0")
}
}

$SERVER["socket"] == ":443" {
ssl.engine = "enable"

ssl.pemfile = "/etc/letsencrypt/live/srv1.example.com/fullchain.pem"
ssl.privkey = "/etc/letsencrypt/live/srv1.example.com/privkey.pem"

server.name = "wordpress.example.com"
server.document-root = "/var/www/wordpress"
server.errorlog = "/var/log/lighttpd/wordpress.local-error.log"
accesslog.filename = "/var/log/lighttpd/wordpress.local-access.log"
}

Finally, enable the SSL module and restart Lighttpd.

🐧Bash / Shell
sudo lighty-enable mod ssl
sudo systemctl restart lighttpd

That should do it!

Conclusion:

In summary, installing WordPress with Lighttpd on Ubuntu 24.04 is a straightforward process that combines the efficiency of a lightweight web server with the flexibility of a robust CMS. Here are the key takeaways:

  • Efficiency: Lighttpd handles concurrent connections effectively, making it suitable for high-performance websites.
  • Database Setup: MariaDB is a reliable database solution for managing WordPress data.
  • Flexible Configuration: Easy configuration of PHP with PHP-FPM allows for optimal performance of WordPress applications.
  • Virtual Hosting: Setting up virtual hosts in Lighttpd facilitates managing multiple sites on a single server.
  • User-Friendly Installation: The WordPress installation wizard simplifies the setup process for users, guiding them through necessary configurations.
  • Customization: WordPress offers extensive themes and plugins for customization, catering to various website needs.

Following the above steps ensures a successful WordPress installation that leverages the strengths of both Lighttpd and Ubuntu. Enjoy building your new website.

Frequently Asked Questions

How do I install Lighttpd on Ubuntu 24.04?

To install Lighttpd on Ubuntu 24.04, open your terminal and run the command 'sudo apt update' followed by 'sudo apt install lighttpd'. Once installed, you can start the Lighttpd service using 'sudo systemctl start lighttpd' and enable it to start on boot with 'sudo systemctl enable lighttpd'.

What database server is recommended for WordPress on Lighttpd?

MariaDB is a recommended database server for running WordPress on Lighttpd. You can install it by running 'sudo apt install mariadb-server' in your terminal, and then manage the service with systemctl commands.

How do I create a database for WordPress in MariaDB?

To create a database for WordPress in MariaDB, first log into the MariaDB console using 'sudo mariadb'. Then, run the command 'CREATE DATABASE wordpressdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' to create a new database specifically for your WordPress installation.

Can I use Lighttpd for a high-traffic WordPress site?

Yes, Lighttpd is designed for high-performance environments and can efficiently handle many concurrent connections, making it suitable for high-traffic WordPress sites. Its lightweight nature allows for fast response times, especially when serving static content.

What are the benefits of using Lighttpd with WordPress?

Using Lighttpd with WordPress combines the efficiency of a lightweight web server with the flexibility of WordPress as a CMS. This setup can lead to improved performance, faster loading times, and better resource management, especially for dynamic applications.

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, the owner and lead writer at Geek Rewind, is a tech enthusiast passionate about simplifying complex IT topics. His years of hands-on experience in system administration and enterprise IT operations have honed his ability to provide practical insights and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

2468 articles → Twitter

📚 Related Tutorials

How to Install NetData on Ubuntu 24.04
Ubuntu Linux How to Install NetData on Ubuntu 24.04
How to Install Emby Media Server on Ubuntu 24.04
Ubuntu Linux How to Install Emby Media Server on Ubuntu 24.04
How to Set System Locale on Ubuntu 24.04
Ubuntu Linux How to Set System Locale on Ubuntu 24.04
How to Install PhpStorm on Ubuntu 24.04
Ubuntu Linux How to Install PhpStorm on Ubuntu 24.04

Leave a Reply

Your email address will not be published. Required fields are marked *