How to install WordPress

This post will help you get wordpress and its required MySQL databases set up.


  • Have a working LAMP server setup (Tutorial for that HERE).
  • root ssh access to the server.

Step 1 — Creating a MySQL Database and User for WordPress

The first thing we need to do is set up a database for our website with MySQL so that WordPress can save and store its data, to do this we will login to the server via ssh, once connected type the following in the terminal

mysql -u root -p

You will be prompted for the password you set for the MySQL root account when you installed LAMP in step two of the tutorial HERE.

once logged into the mysql terminal we will create a database called wordpress (remember the name we will need it later), type the following into the terminal


This will create a database for our website to connect to called wordpress.

Next we will create a MySQL user that can access the database by typing the following into the terminal

CREATE USER 'wordpressuser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

replace 'password'with a

  • GRANT ALL ON wordpress.* TO ‘wordpressuser’@‘%’;

password you will remember we will need it later.

You now have a database and user account, each made specifically for WordPress. We need to flush the privileges so that the current instance of MySQL knows about the recent changes we’ve made:


Then finally after that tpye the following command in the terminal to exit and save the changes


Step 2 — Installing Additional PHP Extensions

Next up we will update the system and install the extra PHP modules we need, enter the following commands into the terminal

sudo apt update
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
sudo systemctl restart apache2

Next we will enter the directory where will install wordpress type the following into the terminal

cd /var/www/html

Now we will download and extratc the files needed for wordpress, type the following commands into the terminal

sudo curl -O https://wordpress.org/latest.tar.gz

once this is done we will extract the downloaded files by typing 

sudo tar xzvf latest.tar.gz

Step 3 — final settings for setup

Next we change the ownership and permissions of the files so our server can use them, type the following into the terminal

sudo chown -R www-data:www-data /var/www/html

sudo find /var/www/html/ -type d -exec chmod 750 {} \;
sudo find /var/www/html/ -type f -exec chmod 640 {}

Great all the terminal stuff is done, well now setup the front end.

Now open a web browser of your choice such as google an enter your servers IP address,

select your desired language and click continue.


Next we will configure the website to use the MySQL user and database we setup earlier in step one of this guide :

  • Database Name : wordpress
  • Username : wordpressuser
  • Password : the password we made in step one of this guide (if you just copy and pated everything it will be password).


Now we will give our site a name by typing it in the Site Title and making our first admin account, just remember the username and password you made here.

You will see this screen upon success.

Click login to start customizing your wordpress website!


Complete— You now have a fully working LAMP server with wordpress installed!!

Add Comment