Debian LAMP Setup and WordPress Install: A Step-by-Step Tutorial

Setting up a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) on Debian 12 and installing WordPress can be a straightforward process when you follow the right steps. This guide will walk you through it with minimal explanations.

While performing a minimal install of Debian 12, I’ve opted to select the web server and ssh server options.

If you haven’t installed Apache, then use these commands:

Step 1: Install MariaDB

First, install MariaDB, which will serve as the database for WordPress:

Step 2: Secure MariaDB

After installing MariaDB, it’s crucial to secure it. Run the secure installation script:

Important: If this is your first time securing MySQL, then don’t rush this step as you will want to enter a root password so that you can log in later when you use phpmyadmin.

Step 3: Install PHP

WordPress requires PHP to run. Install PHP and necessary extensions:

Step 4: Install phpMyAdmin

phpMyAdmin is a web-based tool to manage your MariaDB databases. Install it with:

During the installation, you’ll be asked to configure the database for phpMyAdmin. Choose Yes to use the existing MariaDB database

Step 5: Install WordPress

Now, install WordPress. Download the latest WordPress package and extract it:

Step 6: Configure Apache

Set up Apache to serve your WordPress site. Create a new virtual host configuration file:

Add the following configuration:

Enable the new site configuration and restart Apache:

Step 7: Complete WordPress Installation

Navigate to http://localhost/websitename in your browser and follow the WordPress installation wizard to complete the setup.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.