How to Install WordPress on Debian 12 Bookworm
In this step-by-step guide, we take you through the process to install WordPress on Debian 12 "Bookworm".
In the next few minutes, let's see how:
- Install the L.A.M.P. stack: Apache2, MySQL and PHP on our Linux server
- Configure the MySQL database
- Download from the official website and configure WordPress.
Installing WordPress on Debian 12 Bookworm
WordPress is an extremely popular open source blogging platform and Content Management System (CMS) used by millions of websites worldwide. Its ease of use, flexibility and wide range of plugins and themes make it an ideal choice for beginners and experts alike.
Debian is a Linux distribution, open source operating system, known for stability and security is one of the best choices for servers and containers. "Bookworm" is currently the latest released stable version of Debian.
Thanks to Long Term Support (LTS), the support and life cycle of stable Debian versions is guaranteed for at least 5 years.
Prerequisites WordPress
Before you get started, make sure you have the following:
- An up-to-date Debian Bookworm server connected to the Internet
- A user with
sudo
privileges orroot
access - Optional: A registered domain (recommended for a public website)
Installing Apache2
Apache2 is an open source web server that will serve WordPress files to your browser. Follow these steps to install it:
sudo apt update && sudo apt install apache2
After installation, start and enable Apache2 service:
sudo systemctl start apache2
sudo systemctl enable apache2
Installing PHP 8.2
PHP is a server-side scripting language that WordPress uses to generate dynamic web pages. It installs PHP 8.2 and the necessary modules:
sudo apt-get install php-pear libapache2-mod-php \
php8.2-{mysql,curl,gd,intl,imap,mcrypt,ps,pspell,snmp,sqlite,tidy,xmlrpc,xsl}
sudo systemctl restart apache2
Installing MariaDB
MariaDB is an open source relational database that will be used to store WordPress data. It is the best alternative to MySQL. Let's install MariaDB and start the service:
sudo apt install mariadb-server
sudo systemctl start mariadb
Install WordPress in Debian
Install wget
if it is not present, and download the latest version of WordPress in the /tmp
sudo apt install wget
cd /tmp
wget https://wordpress.org/latest.tar.gz
Decompress the archive
tar -xf latest.tar.gz
Move WordPress to the /var/www/html
directory, default for Apache2 web files.
sudo mv wordpress /var/www/html
sudo chown www-data:www-data /var/www/html -R
Create database user and password
Create a new user and password for accessing the WordPress database, remember to replace password
with a secure password and possibly change the username and database
sudo mysql -e "CREATE DATABASE wordpress;"
sudo mysql -e "GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'password';"
sudo mysql -e "SHOW databases;"
The server will show us the databases present, including the newly created wordpress
DB
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
Do you want Support in Production? We'll take care of it
Contact Us Now! Free 30m Analysis with a Experienced Linux System Builder to Optimize Your System
Complete Installation via Web Interface
Open a web browser and access your server using its IP address or domain name, followed by /wordpress
. For example http://IPWEBSERVER/wordpress
. Follow the on-screen instructions to finish installing WordPress on Debian 12 Bookworm, choosing the website name, username, and administrator password.
On completion of this step we will have a working WordPress installation on our Debian server