In this tutorial, I will show you how to set up a superfast and high-performance WordPress blog with php 7.2 and nginx microcaching on ubuntu 16.04 / Debian 9 server.

What is Nginx Microcaching?

Microcaching is a method of caching dynamic content for a short period of time, Benefit of this method is Improved page load time and reduces server load on high traffic spikes.

VPS I am using:
Debian 9.3

This is the cheapest VPS available at

1. Update the system and install necessary packages

sudo apt -y update && sudo apt -y upgrade
sudo apt install apt-transport-https lsb-release ca-certificates wget git

2. Install MariaDB

sudo apt-get install mariadb-server

When the installation complete, run the following command to secure your DB Server


Now create mysql database and user for wordpress
mysql -u root -p yourmysqlpassword

3. Install Nginx

curl | apt-key add -

sudo sh -c 'echo "deb $(lsb_release -sc) nginx" > /etc/apt/sources.list.d/nginx-latest.list'

sudo apt update

apt-get install nginx

4. Install the latest version of PHP 7.2 and all necessary modules

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg

sudo sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

sudo apt update

sudo apt install git php7.2-common php7.2-readline php7.2-fpm php7.2-cli php7.2-gd php7.2-mysql php7.2-curl php7.2-mbstring php7.2-opcache php7.2-json php7.2-xml

5. Nginx Configuration

In this part we are going to use a forked version of Ashley Rich’s Nginx server configurations, It contains the best practices from various sources, including the WordPress Codex and H5BP.

Note: From now onwards you have to replace ‘‘ to your blog name in below commands

Create home directory for your wordpress installation
mkdir /var/www/

Backup any existing nginx config
sudo mv /etc/nginx /etc/nginx.backup

Clone the repo of nginx configurations
sudo git clone /etc/nginx

Symlink the default file from sites-available to sites-enabled, which will setup a catch-all server block. This will ensure unrecognized domains return a 444 response.

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

Copy example configuration from sites-available

sudo cp /etc/nginx/sites-available/ /etc/nginx/sites-available/

make necessary changes to config file accordingly, paying close attention to the server name and paths.
sudo nano /etc/nginx/sites-available/

symlink the configuration into the sites-enabled directory
sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

6. Test the nginx configuration for any syntax errors

sudo nginx -t

7. Create necessary directories and log files

mkdir /var/www/
mkdir /var/www/
mkdir /var/www/
touch /var/www/;
touch /var/www/;

8. Download and extract wordpress

cd /tmp
tar -xvzf latest.tar.gz
cd wordpress
mv * /var/www/
chown -Rf www-data:www-data /var/www/
nginx -t
service nginx restart

9. Complete the wordpress Setup

Now head over to your domain name and complete the wordpress setup
Voila! Thats it , Your superfast wordpress blog is ready.

Categories: Tutorials

shyam jos

My name is Shyam Jos, I am a passionate Linux system administrator from Kochi, India. I am a strong advocate of using Linux and Open-Source software.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.