How to Create a Local WordPress Installation on Linux Mint

In this quick tutorial, I’m assuming that you have already installed and configured the Apache2, MariaDB and PHPMyAdmin packages.

1. Create a new container folder for WordPress.

cd /var/www/html/
sudo mkdir WEBSITE_FOLDER

2. Download WordPress from wordpress.org

3. … and extract its contents to the folder you’ve just created.

4. Open Terminal and make sure that you have the correct ownership and permissions set for the entire folder:

sudo chown -R www-data:www-data ./WEBSITE_FOLDER
sudo chmod -R 755 ./WEBSITE_FOLDER

5. Within WEBSITE_FOLDER, rename wp-config-sample.php to wp-config.php.

6. Open wp-config.php and add your database settings under /** The name of the database for WordPress */

You need a DB_NAME, a DB_USER and its PASSWORD. If you don’t want to use any existing user, you can make these up.

You might also need to add these two lines under /* Add any custom values between this line and the "stop editing" line. */

define('WP_ALLOW_REPAIR', true);
define('FS_METHOD', 'direct');

7. Open Terminal and enter MySQL:

mysql -u root -p

If you have created a password for your root at MariaDB’s setup, you will need to enter it next. Otherwise, simply press enter at password prompt.

Then run the following SQL commands on MariaDB:

create database DB_NAME;
grant all privileges on DB_NAME.* TO 'DB_USER'@'localhost' identified by 'PASSWORD';
flush privileges;
exit

8. Open your browser and navigate to localhost/WEBSITE_FOLDER to go through the installation process of WordPress. You will need to come up with an admin name, password and email address.

9. You can now log in to your new WordPress site at localhost/WEBSITE_FOLDER/wp-login.php.

Leave a Reply

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