In this article we will demonstrates the basic steps necessary to deploy Wordpress onto an Ubuntu VPS.
Create a server with an external IP address (the default). The gp.micro plan is suitable for a basic installation.
SSH to your new server. In this guide I will be using a command line SSH client with public key authentication, but the process is the same for Putty with password authentication.
Having SSH'd to your VPS, we can install MySQL server with the following commands:
apt-get update apt-get install -y mysql-server
You can leave the MySQL root password blank when prompted.
We need a Mysql account for Wordpress to connect to the database with. Start the MySQL command line client:
mysql -u root
Then enter the following commands:
create database wordpress; create user 'wordpress'@'%' identified by 'MyPassword!'; grant all privileges on wordpress.* to 'wordpress'@'%'; exit
To use Wordpress we need a suitable hosting environment, so we will install Apache, PHP, and the MySQL PHP driver library:
apt-get install -y apache2 libapache2-mod-php5 php5-mysql
Ubuntu puts the default web site into /var/www/html, so first we remove that and then download and install Wordpress:
cd /var/www/html rm index.html wget https://wordpress.org/latest.zip apt-get install -y unzip </dev/null unzip latest.zip mv wordpress/* . rmdir wordpress
chown www-data -R .
In your web browser, go to the web server's public IP as shown in mPanel and you will see the welcome screen:
Click 'Let's go!' and you will be given this database configuration screen:
Now make the following changes:
- Change the Username to wordpress
- Change the Password to the value you chose earlier when create the MySQL user account (MyPassword! in the example given)
- Change the Database Host to the internal IP of the database server (as shown in mPanel).
Click Submit, and your Wordpress install is ready for use.