This blog post teaches you how to install WordPress on Debian 13. WordPress is an open-source web content management system written in PHP that stores data in the MySQL database system. It is among the most popular content management systems used by nearly a quarter of the top one million websites. WordPress was created as a tool for publishing blogs but has evolved to support other web content, including more traditional websites. In this blog post, we will install WordPress with the LAMP stack.
Installing WordPress on Debian 13 with the LAMP stack is straightforward and may take up to 10 minutes. Let’s get started!
Table of Contents
Prerequisites
- A server running Ubuntu Debian 13 OS
- User privileges: root or non-root user with sudo privileges
- Valid domain name pointed to the server
Step 1. Update the system
Before installing WordPress, we must update the packages to the latest versions. To do that, execute the following command:
sudo apt update -y && sudo apt upgrade -y
Step 2. Install LAMP stack
The LAMP stack is a shortcut for Linux, Apache, MySQL, and PHP, and is very important for building web applications. First, the LAMP stack will be the Apache web server. To install the Apache web server, execute the following command:
sudo apt install apache2 -y
Once installed, start and enable the Apache service:
sudo systemctl start apache2 && sudo systemctl enable apache2
Check the status of the service:
sudo systemctl status apache2
You should get the following output:
root@host:~# systemctl status apache2 ● apache2.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled) Active: active (running) since Sun 2025-04-13 13:59:04 CDT; 10s ago Invocation: af1ccc94929345a4b48a69676b4e6198 Docs: https://httpd.apache.org/docs/2.4/ Main PID: 75656 (apache2) Tasks: 55 (limit: 4644) Memory: 5M (peak: 5.2M) CPU: 108ms CGroup: /system.slice/apache2.service ├─75656 /usr/sbin/apache2 -k start ├─75658 /usr/sbin/apache2 -k start └─75659 /usr/sbin/apache2 -k start Apr 13 13:59:04 host.test.vps systemd[1]: Starting apache2.service - The Apache HTTP Server...
Next in the LAMP stack will be the MariaDB database service. To install it, execute the command below:
sudo apt install mariadb-server -y
Once installed, start and enable the MariaDB service:
sudo systemctl start mariadb && sudo systemctl enable mariadb
Check the status of the service:
sudo systemctl status mariadb
You should get the following output:
root@host:~# sudo systemctl status mariadb ● mariadb.service - MariaDB 11.8.1 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: enabled) Active: active (running) since Sun 2025-04-13 14:03:09 CDT; 44s ago Invocation: 6dd07fd65dfe4458a03e9c4200ce29cb Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 76454 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 15 (limit: 30653) Memory: 303.8M (peak: 393.9M) CPU: 20.361s CGroup: /system.slice/mariadb.service └─76454 /usr/sbin/mariadbd
The last part of the LAMP stack will be the PHP and its extensions. To install PHP with the extensions, execute the following command:
sudo apt install php8.4 libapache2-mod-php8.4 php8.4-fpm php8.4-mysql php8.4-xml php8.4-mbstring php8.4-curl -y
Step 3. Create WordPress database and user
To create a WordPress database, WordPress user, and assign the correct permissions, execute the following commands:
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'YourStrongPassword'; CREATE DATABASE wpdatabase; GRANT ALL PRIVILEGES ON wpdatabase.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Step 4. Download and install WordPress
First, we need to download and extract the WordPress files:
cd /var/www/html wget https://wordpress.org/latest.zip unzip latest.zip rm latest.zip
Set the proper permissions on files and folders.
chown -R www-data:www-data wordpress/ find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \;
Next, we need to open the WordPress wp-config.php file and configure the database and user credentials we set in the previous step. To do that, first, rename the wp-config-sample.php
mv wp-config-sample.php wp-config.php
Open the wp-config.php file with your favorite editor and edit these lines of code to look like this:
// ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'wpdatabase' ); /** Database username */ define( 'DB_USER', 'wpuser' ); /** Database password */ define( 'DB_PASSWORD', 'YourStrongPassword' );
Save the file and close it.
Step 5. Create Apache Virtual Host File
To create an Apache configuration file, execute the following command:
sudo touch /etc/apache2/sites-available/wordpress.conf
Open the file and paste the following lines of code
<VirtualHost *:80> ServerName yourdomain.com DocumentRoot /var/www/html/wordpress <Directory /var/www/html/wordpress> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Save the file and close it.
Enable the Apache configuration files for WordPress along with the rewrite module.
sudo a2enmod rewrite sudo a2ensite wordpress.conf
Check the Apache2 syntax:
apachectl -t
You should receive the following output:
root@host:/var/www/html/wordpress# apachectl -t Syntax OK
If the syntax is OK, restart the Apache service.
systemctl restart apache2
That’s it. Now you can access and finish the WordPress installation at http://yourdomain.com
Congratulations! You successfully installed WordPress on Debian 13 OS.
Of course, if you have difficulties and are unfamiliar with Linux, you do not have to install it independently. Instead, you should sign up for one of our Linux VPS plans and submit a support ticket. Our admins are available 24/7 and will help you with installing WordPress.
If you liked this post on how to install WordPress on Debian 13, please share it with your friends or leave a comment below. Thanks.