Skip to content

Guide on Installing WordPress on Debian 12 using Apache, MariaDB, and PHP8.3 (LAMP Setup)

Instructions for setting up WordPress on Debian 12 utilizing Apache, MariaDB, and PHP 8.3. This LAMP stack setup guide offers a streamlined approach to a seamless WordPress installation.

Guide for Setting Up WordPress on Debian 12 Using Apache, MariaDB, and PHP8.3 (LAMP Stack...
Guide for Setting Up WordPress on Debian 12 Using Apache, MariaDB, and PHP8.3 (LAMP Stack Installation)

Guide on Installing WordPress on Debian 12 using Apache, MariaDB, and PHP8.3 (LAMP Setup)

Setting up a secure and high-performing WordPress site on Debian 12 involves installing and configuring compatible versions of Apache, MariaDB, and PHP, along with best practices for security and performance. This guide provides a step-by-step process to achieve an optimal WordPress setup on Debian 12.

  • Apache: Apache 2.4 (the default Apache version in Debian 12 repositories is 2.4, which is stable and fully compatible with WordPress).
  • MariaDB: MariaDB 10.11 series (Debian 12 ships with this or a similar stable MariaDB version, recommended over MySQL for performance and security).
  • PHP: PHP 8.2 (Debian 12 includes PHP 8.2 by default, which is optimal for WordPress 6.x for performance and compatibility).

These versions provide strong support for WordPress, including the latest PHP features and security improvements.

Step-by-Step Optimal Setup

  1. Update your system packages:

  1. Install Apache:

Verify Apache is running by visiting or your server IP.

  1. Install MariaDB:

Secure MariaDB by running:

  1. Install PHP and Required Extensions:

Debian 12 defaults to PHP 8.2; install PHP and WordPress extensions:

  1. Configure Apache for PHP:
  2. Enable the module for WordPress friendly URLs:
  3. Configure Apache virtual host for your WordPress site (example ):```apache```
  4. Enable the site and reload Apache:
  5. Download and Install WordPress:
  6. Download latest WordPress and extract it into .
  7. Set proper ownership:
  8. Create WordPress Database and User in MariaDB:

Security Best Practices

  • Keep software updated: Regularly update Debian, Apache, MariaDB, PHP, and WordPress to patch vulnerabilities.
  • Use HTTPS: Install and configure SSL certificates (e.g., via Let’s Encrypt).
  • Harden MariaDB: Use strong passwords, disable remote root logins, and keep MariaDB secured.
  • Set correct file permissions: Avoid using overly permissive file permissions on WordPress directories.
  • Disable directory browsing: Ensure Apache disables directory listing by default.
  • Limit PHP execution: Use settings like disabling unnecessary functions and setting restrictions.
  • Enable a firewall and intrusion prevention: Configure UFW (Uncomplicated Firewall) and Fail2Ban to protect your server.

Performance Optimization Tips

  • Enable Apache caching modules: Such as and to enhance asset delivery.
  • Use PHP Opcache: PHP 8.2 has Opcache enabled by default; verify and tune it for your workload.
  • Optimize MariaDB: Tune buffer sizes, query cache, and ensure proper indexing for WordPress tables.
  • Use a caching plugin: Implement WordPress caching plugins like WP Super Cache or W3 Total Cache.
  • Consider a CDN: Offload static assets to reduce server load and improve global load times.

In summary, on Debian 12, the optimal WordPress setup uses Apache 2.4, MariaDB 10.11 , and PHP 8.2, configured with security hardening and performance optimizations such as caching, HTTPS, proper permissions, and database tuning to ensure a stable, secure, and fast WordPress site. WordPress can be used for various purposes, including blogging platforms, e-commerce stores with WooCommerce, membership and subscription sites, multilingual websites with Polylang or WPML, and more. Debian 12 is a stable and long-term supported Linux distribution, making it a reliable choice for servers. The LAMP stack includes Linux (Debian 12), Apache, MariaDB, and PHP 8.3 for serving dynamic PHP applications like WordPress. A script is used to secure the MariaDB installation, including setting a root password and disabling remote root access.

  • Utilizing the latest technology in data-and-cloud-computing, this guide advocates the implementation of caching plugins like WP Super Cache or W3 Total Cache to enhance WordPress performance.
  • To foster a robust and secure environment for WordPress on Debian 12, it is essential to apply technology best practices such as regular software updates, the use of HTTPS, and optimal tuning of Apache, MariaDB, and PHP.

Read also:

    Latest