How To Install Wordpress on Kali Linux

Published: July 19, 2017 (Updated: Jul 19, 2017)

Enjoying this content? Subscribe to the Channel!

Mastering Your Lab: How to Install WordPress on Kali Linux (The Ultimate Setup Guide)

Hello, tech enthusiasts, and welcome back to Darren’s Tech Tutorials!

If you’ve been following along with our Kali Linux series, you know we’ve been laying the groundwork for some seriously powerful security testing. We’ve successfully installed Kali on VMWare and configured our tools. Now, it’s time for the crucial next step: setting up a target environment.

In this guide, we’re walking through the precise steps required to install WordPress—the world’s most popular CMS—directly onto your Kali Linux machine. Why? Because we need a safe, controlled environment to practice our security auditing and ethical hacking skills for our next video: How to Hack WordPress using Kali Linux!

Ready to build your digital target range? Let’s dive in!


Quick Tip: Before we start, if you need help mastering the Linux terminal, grab your free Linux cheat sheet here: http://eepurl.com/dkRNM9

Prerequisites & Series Context

This is the third video in our series. If you haven’t yet set up your virtual environment, make sure you check out these foundational tutorials first:

  1. How To Install Kali Linux On VMWare Workstation
  2. How To Install VMWare Tools On Kali Linux

Assuming you have a fully updated and running Kali Linux installation, we can now proceed to install the necessary components for a functioning web server (the famous LAMP stack).

## Phase 1: Installing Apache, MariaDB, and PHP (The LAMP Stack)

WordPress requires a web server (Apache), a database system (MariaDB), and a scripting language (PHP) to function. We start by installing these core services using the apt-get command.

1. Install Core Services

Execute these commands in your Kali terminal:

apt-get install apache2
apt-get install php
apt-get install mariadb-server
apt-get install mariadb-client

2. Start the Required Services

After installation, we need to ensure both the web server and the database are running:

service apache2 start
service mariadb start

## Phase 2: Configuring the MariaDB Database

Now that our database engine is running, we need to create a dedicated database and a user for our WordPress installation.

1. Log into MariaDB

Log in as the root user. You will be prompted for your MariaDB root password (which you likely set during the initial installation or first run).

mysql -u root -p

2. Create the Database and User

Once inside the MariaDB prompt, run the following SQL commands sequentially. These steps create a database named wordpress and establish a user named darren who can access it locally (localhost) using the password password123.

Security Note: In a live environment, always use a strong, unique password instead of ‘password123’!

create database wordpress;
show databases; 
-- Verify that the 'wordpress' database was created.

grant all on wordpress.* to 'darren'@'localhost' identified by 'password123';
-- This gives our new user full privileges over the new WordPress database.

Type exit; to leave the MariaDB shell.

## Phase 3: Downloading and Placing WordPress Files

Next, we need the actual WordPress files. You should already have downloaded the WordPress .tar.gz file (we’ll assume version 4.8 as noted in the source commands, but the process works for current versions).

1. Move the WordPress File

Navigate to your Downloads directory, move the compressed file into your web server’s root folder (/var/www/html), and then switch into that directory.

cd /Downloads
mv wordpress-4.8.tar.gz /var/www/html
cd /var/www/html

2. Extract the Files

Use the tar command to extract the contents of the file. The -zxvf flags ensure it decompresses, extracts, is verbose (shows files), and specifies a file name.

tar -zxvf wordpress-4.8.tar.gz

This action extracts a new folder named wordpress inside /var/www/html.

## Phase 4: Configuring Apache and Finalizing Installation

Apache needs to know where to look for our new WordPress site. We achieve this by editing the default configuration file.

1. Edit the Default Configuration File

Navigate to the Apache configuration directory and open the default virtual host file using your preferred text editor (here we use vi):

cd /etc/apache2/sites-available
vi 000-default.conf

Note: You will need to edit this file to correctly point the DocumentRoot to your /var/www/html/wordpress directory, ensuring Apache knows where to serve the files from.

2. Restart Apache

For the configuration changes to take effect, we must restart the Apache service:

service apache2 restart

Wrapping Up and What’s Next!

Congratulations! You have successfully installed all the necessary components for running WordPress on your Kali Linux environment.

At this point, you should be able to navigate to your Kali machine’s IP address in a web browser and complete the famous five-minute WordPress installation process using the database credentials we set up in Phase 2 (darren/password123).

This environment is now perfectly set up for testing, learning, and, most importantly, preparing for the final video in this series: How to Hack WordPress using Kali Linux! That tutorial will be dropping shortly, so make sure you are ready!

If this guide helped you set up your lab, please hit the Like button, Subscribe to Darren’s Tech Tutorials for more clear and actionable guides, and drop a comment below letting us know what other targets you want to see!

Happy hacking (ethically, of course)!