Speed up WordPress on VPS – Step by Step Guide 2020

Foreword: We might hear about page speed will affect your website ranking. So now, I will show you how to optimize WordPress speed with a detailed guide and real actionable checklists, to make sure your website will get higher ranking for superspeed.

This article is recommended to the persons who already knew about VPS, SSH and terminal commands.

Speed up WordPress on VPS – Step by Step Guide 2020

Speed up Explained

Before getting optimize for your WordPress website, we need to understand clearly how does a website work, what’s behind the website and what’s truly make your WordPress website slow.

Get on the train, fellas!

How does a website work?

A website will be running on a computer, turned on 24/24, anyone can access it.

It’s like your machine is a public computer, anyone can access, open, use it anytime they want.

How do the VPS specs effect to your page speed

Imagine that you downloaded a video game and you could not play it, or jerky, due to the weak configuration of your device.

It’s the same with the website, as the website also runs on the computer too.

Example: A computer can do 10 maths per minute, and your website needs to do 20 maths than the leftovers will wait until the first 10 is done.

If your hosting is too weak, and your website demands more resources than your hosting can provide, it will slow down.

How do the themes and plugins affect your page speed

Each interface or plugins are developed to serve certain needs.

They will carry the resources they need to use themselves, so when these plugins are abusive or improperly done, they can cause loopholes that difficult to detect, but directly impact the speed of your website.

How does the distance affect the real feel

The Internet basically is a bunch of wire connected together.

If you are from the United States and want to connect to the United Kingdom, you will need longer wire to connect. Also, the time to transfer the data between you and your destination will be longer.

So, if you are planning to sell the product to the UK, you should choose the hosting that has a location in the UK, so the potential customers can load your webpage faster.

Install LEMP Stack with aaPanel

This is the most important part. We already understand the aspects that impact your website speed.

Therefore, I will guide you to the next part, where we can choose the suitable VPS Provider as well as the software that we install on the VPS, to make WordPress load faster.

To run the website and expose it to the world, you will need some tools, we call the tools as a stack.

Prerequisite – The tools

Assume that you already had a VPS, knowing the simple Linux command, here’s the list of tools you might want to use.

  • Termius: Alternative to Putty, help you connect to SSH easily, manage your VPS under one dashboard.
  • Cloudflare: The CDN service and Caching at the DNS level.

Install aaPanel – Fast & Free Control Panel

You can install the services one by one, but it would take time and have some risks. So, we will use the software, called “aaPanel“, to install the services for us.

aaPanel can help us manage the services and website via User Interface, which will easier for non-tech people.

Install the necessary packages

Centos/Debian/Fedora:

yum install nano mlocate -y
yum groupinstall "Development tools" -y

Ubuntu:
apt-get install nano mlocate -y
apt-get groupinstall "Development tools" -y

Install aapanel

Centos/Debian/Fedora:
yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh

Ubuntu:
wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && sudo bash install.sh 

The result on the terminal screen will provide the URL and username/password to login to continue to the next step.

aaPanel installation terminal result

After the installation, you would need to go to the aaPanel and log in with the information you got on the terminal screen.

Install LEMP Stack

Install LEMP Stack with aaPanel for better website speed

On the first login, you will see the popup to let you choose which stack to install.

You can select as mine above

Install Redis, memcache & OPcache

To serve the website better and faster, we will use the cache engines to save the queries that have been executed and reused them for later if someone uses the same query.

To install the apps, you can navigate to the App Store to install the necessary cache engines.

Add website, free SSL certification and rewrite rules

Next, add your website to aaPanel and create the free SSL certification with Let’s Encrypt.

WordPress Cache & Minify

So now, our website is up and running perfectly, but it still slows a little bit, as we did not config our website to serve cache.

WordPress running on aaPanel is kinda easy to setup and config, as well as support the caching plugins out of the box.

Install W3 Total Cache

Why W3 Total Cache you ask?

Simple, instead of installing a bunch of plugins to serve our purpose, only 1 plugin to make it, it would save more time and more consistent.

Different from WP-Rocket, it doesn’t support caching engines, that makes you install other plugins like OPCache or Redis for WordPress.

Config W3 Total Cache

I should have written the instruction for it, but I think you should use the same config with mine, it will be faster and easier.

Install Autoptimize

Autoptimize is the best minify CSS & JS at the moment, it will help you minify the codes and merge files into one.

Cloudflare – Content Delivery Network

Cloudflare is the service to speed up your website via tools like Content Delivery Network, DNS and Caching.

To get started with Cloudflare, you can watch this video:

Cloudflare Option: Speed optimization

At your domain name management, navigate to the Speed tab and select like the video showed.

Cloudflare Option: Page rules

Page Rules help you enable the cache level for all of your pages.

My rule:

https://hqhow.com/*
Cache Level: Cache Everything

0 Shares:
2 comments
Leave a Reply

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

You May Also Like