Recommended VPS Complete list of best VPS hosting providers.

How to Install WordPress on Nginx + HHVM VPS

Just a short tutorial with pictures about how to install a WordPress on Ubuntu VPS running Nginx, HHVM and MySQL. Using HHVM replacing PHP is somehow believed can server website faster and it is very lightweight for server’s resources. While not many PHP scripts are made compatible, WordPress is claimed compatible with HHVM (since version 3.9). So if you want to build fast-loading a WordPress blog using bleeding edge technology, try running it with HHVM.

Building HHVM + Nginx Server

Step 1 – Follow all steps in my previous tutorial and make sure you have installed it correctly.

How to Install Nginx, HHVM and MySQL on Ubuntu 15.04

Step 2 – Create new web directory for you WordPress blog. In this example I use my a sub-domain (coz I have no spare idle domain), feel free to replace it with your own.

mkdir -p /var/www/
chmod -R 755 /var/www/
chown -R www-data:www-data /var/www/

Replace with your own domain / subdomain name, in my case it looks like this:


Step 3 – Now let’s create new virtual hosts file for your upcoming WordPress site:

nano /etc/nginx/sites-available/

then copy paste this configuration:

server {
  listen 80;
    include hhvm.conf;
    access_log   /var/log/nginx/access.log;
    error_log    /var/log/nginx/error.log;
    root /var/www/;
    index index.php;
    location / {
        try_files $uri $uri/ /index.php?$args; 

In my case it looks like this:


Now save changes and exit the editor (in Nano it is Control+O to save then Control+X to exit).

Step 4 – Now we need to create symbolic link to the new virtual hosts file so it can be enabled:

ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Next, restart Nginx:

service nginx restart
service hhvm restart



Install WordPress

Step 1 – Obviously we have to firstly download WordPress to our vps:



Step 2 – Now copy latest.tar.gz file to your web directory and extract the main WordPress files inside that package while also removing the wordpress directory using this command:

cp latest.tar.gz /var/www/
cd /var/www/
tar -xzvf latest.tar.gz --strip-components=1

Step 3 – Login to MySQL as root then create new user, password and database name:

mysql -u root -p

then issue these command lines replacing “wordpress”, “dbuser” and “pass123456” with your own:

CREATE USER dbuser@localhost;
GRANT ALL PRIVILEGES ON wordpress.* to dbuser@localhost IDENTIFIED BY 'pass123456';



Step 4 – Rename wp-config-sample.php file to wp-config.php then edit it using your favorite editor like Nano:

mv wp-config-sample.php wp-config.php
nano wp-config.php

then provide new MySQL credentials you’ve just created, here’s the example of mine:


Step 5 – Open up your favorite web browser and navigate to your domain which in my case is and proceed with the installation procedure:


Hit the continue button then fill in all required fields:


That’s it. You can now login to WordPress Dashboard.


Enjoy your newly built WordPress site. Do not forget to follow me on Twitter or subscribe to my newsletter (via FeedBurner) so you’ll get noticed about new articles faster.


Add a Comment

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

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.