Skip to content
Follow
CMS Ubuntu Linux

How to Install WordPress with Lighttpd on Ubuntu 24.04

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

Advertisement

Install PHP-FPM

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site’s PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

Advertisement

Run the commands below to install PHP-FPM.

Advertisement
🐧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-sqlite3 php-soap php-zip

Additional help on installing PHP

Advertisement

How to install PHP on Ubuntu Linux

Advertisement

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

Advertisement

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.

Advertisement
🐧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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

📝Good to KnowCopy 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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

📝Good to KnowFirst, 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.

Create a WordPress database

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

📝Good to KnowCopy 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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

📝Good to KnowFirst, 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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

📝Good to KnowCopy 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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Set up WordPress vhost

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install PHP-FPM

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Create a WordPress database

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Set up WordPress vhost

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Create a WordPress database

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install PHP-FPM

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Create a WordPress database

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Set up WordPress vhost

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install PHP-FPM

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Create a WordPress database

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Lighttpd running WordPress on Ubuntu 24.04 creates a fast web server setup that uses much less memory than Apache. Lighttpd is a high-speed web server designed to handle busy websites without slowing down, while WordPress powers over 40% of all sites on the internet.

This combination gives you a lean hosting environment that loads pages quickly on lower-spec hardware. Ubuntu 24.04 provides the stable Linux foundation you need to run both programs smoothly together.

The setup has three parts: install the Lighttpd web server, install a database server, then add PHP and WordPress. This part covers Lighttpd and the start of the database setup. You need an account that can use sudo and a working internet connection on the server.

⚡ Quick Answer

Install Lighttpd on Ubuntu 24.04 by running sudo apt update, then sudo apt install lighttpd, and start it with sudo systemctl start lighttpd. Lighttpd comes from Ubuntu's default software lists, so no extra repositories are needed. Browse to your server's IP address to confirm the default placeholder page loads.

Advertisement

Install Lighttpd

Lighttpd is in Ubuntu's default software lists, so you do not need to add any extra repositories. Installing it means your server can host and serve web pages to visitors. The package manager downloads the web server and its dependencies, then gets the system ready to host websites.

  1. Open Terminal. On Ubuntu Desktop, press Ctrl+Alt+T. On a server, log in over SSH or at the console.
  2. Update your package list by running sudo apt update. This makes sure you get the current Lighttpd version from Ubuntu's lists. You should see a list of repositories being checked, ending with a line about how many packages can be upgraded.
  3. Install the web server by running sudo apt install lighttpd. Run the command below to do this. Type your password if prompted, and press Y if apt asks you to confirm.

🐧Bash / Shell
sudo apt update
sudo apt install lighttpd

When the install finishes, you are returned to the prompt with no errors. Ubuntu normally starts Lighttpd on its own right after installation. The commands below start the service anyway and enable it, so it also starts every time the server boots.

  1. Run the commands below to start and enable the Lighttpd service.
  2. Check that it works by opening a browser and going to your server's IP address. You should see the default Lighttpd placeholder page. If the page does not load, check that no other web server, such as Apache, is already using port 80. Also check that your firewall allows web traffic on that port.

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

If you want to undo this later, you can stop the service and remove the package with apt. Your site files are not part of that, so they stay on disk unless you delete them.

Now that Lighttpd is installed, continue to install a database server below. WordPress stores its posts, pages and settings in the database, so it has to be in place before you install WordPress itself.

Download WordPress

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Set up WordPress vhost

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install PHP-FPM

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Create a WordPress database

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Install MariaDB

MariaDB installation on Ubuntu 24.04 provides the database system required to store your WordPress content, user details, and site settings. You install MariaDB by running the standard package manager command in your terminal. Run sudo apt install mariadb-server to download and set up the database server on your system.

Setting up MariaDB on Ubuntu 24.04 is straightforward, making it a great database choice for your WordPress site. You can install the MariaDB server using a single command directly from Ubuntu's software lists, which provides the essential database system.

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

Creating a WordPress database gives your new site a secure place to store posts, pages, and plugin data inside MariaDB. You set up this database and a user account by logging into the MariaDB command line interface and running SQL queries. This step links your future WordPress installation to the database backend.

Once MariaDB is set up, you need to create a dedicated database and user for your WordPress site. This guide shows you how to create a database named 'wordpressdb' and a user called 'wordpressdbuser' with the correct permissions for your WordPress installation.

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

Granting `wordpressdbuser` full access to the `wordpressdb` database ensures that your WordPress installation can create, read, update, and delete necessary data for your website to function correctly. This step is vital for the successful setup of your WordPress site on Ubuntu 24.04 with Lighttpd.

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

PHP-FPM (a tool that processes PHP code for web servers) runs the underlying programming language that WordPress needs to function properly. You install PHP-FPM along with common modules to ensure your Lighttpd server can load dynamic web pages. Run the apt install command with the required PHP extensions to add this capability to your Ubuntu server.

PHP-FPM is crucial for WordPress as it processes your site's PHP code, especially with newer versions. Installing PHP-FPM and the common PHP extensions WordPress needs is done with a single command, preparing your server to run your website smoothly.

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

Setting up a WordPress vhost (a configuration that tells your web server how to handle a specific website domain) lets Lighttpd serve your WordPress site correctly. You create this virtual host by adding a new configuration file to your server that points to your website files. This file defines how Lighttpd handles incoming traffic for your domain.

Setting up a virtual host for WordPress on Lighttpd involves creating a specific directory and a configuration file. This file, named [wordpress.conf], tells Lighttpd how to display your WordPress site, making sure it's accessible correctly.

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

Downloading WordPress places the core website files onto your Ubuntu 24.04 server so visitors can view your pages. You fetch these files directly from the official WordPress source, extract them to a temporary folder, and move them to your web root directory. This gives Lighttpd access to the files it needs to display your site.

Downloading the latest WordPress files onto your Ubuntu 24.04 server is the next step in setting up your site. You will download the files to a temporary location, move them to the correct web folder, and ensure the server has the necessary permissions to run WordPress.

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
WordPress installation language selection screen

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

Beginning the WordPress 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
Setting up database connection for WordPress

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

Configuring initial setup for WordPress installation
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
Installing WordPress on Lighttpd server

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

WordPress installation setup complete confirmation
WordPress installation setup complete confirmation

Set up HTTPS

Setting up HTTPS encrypts the traffic between your visitors and your WordPress site to protect sensitive data like passwords. You secure your server by obtaining an SSL certificate (a digital file that enables a secure connection) and applying it to your Lighttpd configuration. This step changes your site address to start with https:// and shows a padlock icon in browsers.

Securing your WordPress site with HTTPS is vital and requires an SSL certificate. If you don't have one, you can get a free one from Let's Encrypt, and the first step is installing this certificate on your server to protect your site and user data.

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.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

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

Leave a Comment

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