Skip to content
Follow
CMS Ubuntu Linux

Install Drupal with Lighttpd on Ubuntu 24.04

Richard
Written by
Richard
Mar 11, 2025 Updated Jul 15, 2026 9 min read
Install Drupal with Lighttpd on Ubuntu 24.04
Install Drupal with Lighttpd on Ubuntu 24.04

Installing Drupal with Lighttpd on Ubuntu 24.04 creates a fast and efficient web server for your website.

⚡ Quick Answer

Install Lighttpd using `sudo apt install lighttpd`. Then, install MariaDB with `sudo apt install mariadb-server`. Finally, install PHP-FPM and related modules via `sudo apt install php-fpm php-intl php-mysql php-curl`.

Lighttpd is a web server known for its speed and ability to handle many visitors at once. Drupal is a powerful, free website-building tool called a Content Management System (CMS).

This guide shows you how to set up Drupal version 10.x on Ubuntu 24.04 using the Lighttpd web server.

📋 Quick Steps
  1. First, install the Lighttpd web server on your Ubuntu 24.04 system using the command: sudo apt update && sudo apt install lighttpd. Then, start and enable the service with: sudo systemctl start lighttpd and sudo systemctl enable lighttpd.
  2. Next, install MariaDB, a database server, with: sudo apt install mariadb-server. Start and enable it using: sudo systemctl start mariadb and sudo systemctl enable mariadb.
  3. Create a database and user for Drupal. Log into MariaDB with sudo mariadb, then run: CREATE DATABASE drupaldb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER drupaldbuser@localhost IDENTIFIED BY 'your_password'; GRANT ALL ON drupaldb.* TO drupaldbuser@localhost WITH GRANT OPTION; FLUSH PRIVILEGES; exit. Remember to replace ‘your_password’.
  4. Install PHP-FPM and necessary extensions with: 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.
  5. Enable PHP support for Lighttpd by running: sudo lighty-enable-mod fastcgi fastcgi-php-fpmsudo systemctl restart php8.3-fpm. Then, edit the PHP configuration file /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf to enable the PHP block. Finally, restart Lighttpd: sudo systemctl restart lighttpd.
  6. Set up a virtual host for Drupal. Create a directory /etc/lighttpd/vhosts.d/ and a file /etc/lighttpd/vhosts.d/drupal.conf with your domain details. Include this directory in /etc/lighttpd/lighttpd.conf and restart Lighttpd.
  7. Download Drupal to /tmp/, extract it, and move the files to /var/www/drupal/. Set ownership to www-data:www-data with sudo chown -R www-data:www-data /var/www/drupal/.
  8. Access your site via your web browser at your configured domain to complete the Drupal installation wizard, including database connection and site setup.

Install Lighttpd

To run your Drupal site, you need to install the Lighttpd web server on Ubuntu 24.04. After installing, start the Lighttpd service and make sure it runs automatically. This prepares it to handle requests for your Drupal Lighttpd Ubuntu 24.04 setup.

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 installing the database server below.

Install MariaDB

MariaDB is a great open-source database choice for Drupal, and installing it on Ubuntu 24.04 is straightforward. Once installed, you can manage the MariaDB server, including starting it and setting it to launch automatically when your server boots up, getting it ready for your Drupal site.

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 Drupal database

With MariaDB installed, you need to create a dedicated database and user for your Drupal site. This involves setting up a database named ‘drupaldb’ and a user called ‘drupaldbuser’, giving them full control over the ‘drupaldb’ database. This allows Drupal to store its information correctly.

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

Finally, we’ll grant the drupaldbuser full access to the drupaldb 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 drupaldb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER drupaldbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON drupaldb.* TO drupaldbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

⚠️Warning
Ensure to replace ‘type_your_password_here‘ with your password.

Install PHP-FPM

PHP-FPM is necessary for running Drupal on Ubuntu 24.04, supporting the latest PHP versions. Installing it with a simple command also brings in needed PHP extensions like php-intl, php-mysql, and php-curl, which Drupal requires to work properly.

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 Drupal vhost

Setting up a Drupal virtual host file for Lighttpd on Ubuntu 24.04 lets you manage your site’s specific configurations. You will create a directory for these virtual host files and then make a new configuration file named ‘drupal.conf’ to add your site’s details for the Drupal Lighttpd Ubuntu 24.04 setup.

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

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

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

PowerShell
$HTTP["host"] =~ "(^|.)drupal.example.com$" {
server.document-root = "/var/www/drupal"
server.errorlog = "/var/log/lighttpd/drupal.local-error.log"
accesslog.filename = "/var/log/lighttpd/drupal.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 Drupal

⚠️Warning
You need to download the Drupal files to your Ubuntu 24.04 server, usually placing them in the /tmp/ directory first. After unzipping these files, move them to the correct web server folder. Ensure the web server has the right permissions to access them for your Drupal site to work.

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

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

🐧Bash / Shell
sudo mkdir -p /var/www/drupal
cd /tmp/
wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
tar -xvf drupal.tar.gz
sudo mv drupal-*/* /var/www/drupal
sudo chown -R www-data:www-data /var/www/drupal/

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

💻Code
http://drupal.example.com

A new Drupal installation wizard will appear. Choose the site’s language and continue.

Drupal installation language selection screen on Ubuntu
Drupal installation language selection screen on Ubuntu

Next, select the installation profile.

Drupal installation profile selection during setup on Ubuntu
Drupal installation profile selection during setup on Ubuntu

Next, confirm all requirements are met and continue.

Then, type in the database name, username, and password created above.

Database entries configuration for Drupal on Ubuntu
Database entries configuration for Drupal on Ubuntu

Finally, set up your site name and create an admin account to log in.

Site configuration settings for Drupal installation on Ubuntu
Site configuration settings for Drupal installation on Ubuntu

Your new Drupal site should be created and ready to use.

Completion screen of Drupal installation on Ubuntu
Completion screen of Drupal installation on Ubuntu

Set up HTTPS

Securing your Drupal site with HTTPS on Ubuntu 24.04 is very important for keeping visitors safe. This involves getting an SSL certificate, often from Let’s Encrypt, and then telling your Lighttpd web server to use it. This makes sure all data sent to and from your Drupal site is encrypted.

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 Drupal virtual host file to edit it.

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

Then, add the highlighted portion to the file.

PowerShell
$HTTP["scheme"] == "http" {
$HTTP["host"] == "drupal.example.com" {
url.redirect = ("/.*" => "https://drupal.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 = "drupal.example.com"
server.document-root = "/var/www/drupal"
server.errorlog = "/var/log/lighttpd/drupal.local-error.log"
accesslog.filename = "/var/log/lighttpd/drupal.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:

By following the steps outlined in this guide, you have successfully installed Drupal with Lighttpd on your Ubuntu 24.04 server. Here are the key takeaways:

    • Lighttpd Installation: You installed Lighttpd, a high-performance web server, to handle your web traffic efficiently.

    • MariaDB Setup: You configured MariaDB as your database server, creating a dedicated database and user for Drupal.

    • PHP-FPM Configuration: You installed and configured PHP-FPM to enable PHP processing, which is essential for running the Drupal application.

    • Drupal Setup: You downloaded and properly configured Drupal, ensuring the necessary permissions for web server access.

    • HTTPS Security: You enhanced your site’s security by setting up HTTPS, protecting data transmitted between the server and users.

Your Drupal site, installed with Lighttpd on Ubuntu 24.04, offers improved performance and security. This specific setup enhances your website’s user experience by delivering these benefits.

What PHP version is required for Drupal 10?

PHP version: Drupal 10 requires at least PHP 8.1. PHP 8.1. 6 is recommended.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips 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.

📚 Related Tutorials

How to Install WordPress with Lighttpd on Ubuntu 24.04
CMS How to Install WordPress with Lighttpd on Ubuntu 24.04
How to install Drupal with Nginx on Ubuntu 24.04
CMS How to install Drupal with Nginx on Ubuntu 24.04
How to Install Drupal Locally with XAMPP on Windows 11
Windows How to Install Drupal Locally with XAMPP on Windows 11
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

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