How to Install WordPress on Ubuntu 16.04 VPS with Virtualmin & Nginx

Configure Unmanaged VPS with Virtualmin and Nginx, then install WordPress with Pretty Links

WordPress is currently the most popular CMS in the world. Millions of webmasters use it to create their websites. It is newbie friendly and has a very simple installation process. But things get little complicated on unmanaged VPS. If you’re planning to use an unmanaged VPS, you can use instructions on this page to install WordPress on Ubuntu 16.04 VPS with Virtualmin & Nginx

The WordPress setup this tutorial produce is focused on performance. We’ll be building a high performance web server with Virtualmin v6.03 GPL, Nginx v1.10.3, PHP v7.0.30 and MariaDB v10.0.36. It’s a well known fact that WordPress is faster on nginx. And Virtualmin gives a nice GUI to manage your VPS.

freelancer to install wordpressNot a tech guy? Rather have a freelancer install WordPress on VPS for you?
Hire me and have your WordPress ready within 24 hours!
Get WordPress Installed

Prerequisites

This tutorial requires you to have a Ubuntu 16.04 VPS. Which you can get from one of my recommended VPS providers. And then complete following steps,

Completing those steps build the environment for WordPress on your VPS. You may ignore optional steps. But I recommend completing them prior to installing WordPress.

Download WordPress

Assuming you have everything above in place , you can now install WordPress on your domain or subdomain. But to do so, you need to login to your VPS with domain’s admin user. Not the root user. Once logged in, run following command to change the current directory to domain’s web directory,

cd $HOME/public_html

Following commands will download and extract WordPress package,

wget http://wordpress.org/latest.tar.gz
tar --strip-components=1 -xvf latest.tar.gz
rm latest.tar.gz

WordPress should be ready to install now. But there’s one more thing we should do before installing it.

Add Nginx Rewrite Rules for WordPress

WordPress needs custom nginx rewrite rules for pretty links to work. You should add these rules to nginx configuration file for the domain. This needs to be done with the root user account of your VPS. So switch root account and open Nginx virtual host file for the domain,

nano /etc/nginx/sites-available/example.com.conf

Replace example.com with your domain name. Look for following line within the file (Ctrl+W).

fastcgi_param HTTPS $https;

Add this rule BELOW it,

location / {
                try_files $uri $uri/ /index.php?$args; 
        }

File should look like this,
nginx-config

Hit Ctrl+X to save changes and close the file. Finally restart Nginx,

service nginx restart

Your server is now fully configured for WordPress. You now run the WordPress install to complete the installation.

Install WordPress

This is where you actually install WordPress with Virtualmin & Nginx. Open your domain name in browser. You’ll be asked to select the language for your WordPress installation. Select it and continue till you see this page.
wp-admin-setup-config-php

Database name and username will be same as your admin username in most cases. You can find MySQL password in Virtualmin. Refer to Obtaining MySQL credentials for a domain from Virtualmin.

Copy password to the WordPress installer and click submit. You don’t need to change anything else on that page. Hard part of the installation is now over. Continue the final steps of the installer and complete the installation.

That concludes the instructions to install WordPress on Ubuntu 16.04 VPS with Virtualmin and Nginx. Create a topic on sysadmin forum if you have issues with the installation.

Tags
Show More

Tharindu

Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Related Articles

3 Comments

Leave a Reply

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

Close