Self hosted WordPress instance

I have  created a short guide for newbies that want to experience and learn about wordpress,
for that you don’t need to purchase hosting services, or create a domain, all you need is an ubuntu virtual machine.

Download & install UBUNTU

first download UBUNTU .iso file and create a virtual machine out of it,
in the video i set the machine with 2 processors and 3 GB of ram, but that is only for the installation step, after it installs you could reset the processors to 1 processor and reduce the RAM to 2 GB, that will be enough for starting,
wordpress (at least on basic levels) doesn’t so resource hungry.

Install LAMP stack.

let’s open a terminal and run some commands:
it is recommended to update your system first

sudo apt update && sudo apt upgrade -y

first we install apache2

sudo apt install apache2

make sure apache is running by checking it’s status

sudo systemctl status apache2

second we install mariadb

sudo apt install mariadb-server mariadb-client

after completing the installation run the following, to complete the installation

sudo mysql_secure_installation

and then third we install PHP

sudo apt install php php-mysql

To confirm that PHP is installed , created a info.php file at /var/www/html/

sudo nano /var/www/html/info.php

add the following code, save and go to “localhost/info.php to make sure it’s installed succesfully

and append the following:

Create a database for WORDPRESS

After installing mysql we will create the wordpress database, for that matter we need to log in to mysql

sudo mysql
CREATE DATABASE wordpress_db;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON wordpress_db.* TO 'wp_user'@'localhost' IDENTIFIED BY 'password';

Download WORDPRESS to VM

after installing ubuntu we will procceed to downloading the latest wordpress version, now let’s open a terminal and go over the commands…
1. change directory to ‘tmp’ and download latest wordpress.
2. unzip the file.
3. copy the wordpress folder to ‘/var/www/html/’.
4. change ownership of wordpress folder.
5. change permissions to wordpress folder.
6. create ‘uploads’ folder.
7. change permissions of ‘uploads’ folder.
now you can go to http://localhost/wordpress and start configuring wordpress.


Brows to ‘http://localhost/wordpress’ and a setup page will appear