In this article, I will show you How to set up WordPress With Redis, which can help you to boost performance on your WordPress blog or Woocommerce web-shop. But before that, let’s discuss what is Redis.
What is Redis
According to Wiki, Redis is an in-memory data structure project implementing a distributed, in-memory key-value database with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes.
So, now we know what is Redis, then let’s discuss how we can install it on Ubuntu and connect with WordPress.
How to Install Redis in Ubuntu
To install Redis in Ubuntu, please run the following commands one by one. I will give details explaining each command in a later section.
sudo apt-get update -y sudo apt-get install apache2 sudo apt-get install php php-mysql php-redis sudo apt-get install mysql-server sudo apt-get install redis-server
1. sudo apt-get update -y
The command written above sudo apt-get update is used to download package information from all configured sources. The sources often defined in /etc/apt/sources.list file and other files located in /etc/apt/sources.list.d/ directory. So when you run the update command, it downloads the package information from the Internet. It is useful to get info on an updated version of packages or their dependencies. So far, we have updated our packages, next we are going to run the command to install the Apache server.
2. sudo apt-get install apache2
This single line of code installs Apache web server in Ubuntu, which we will use for our WordPress setup.
3. sudo apt-get install php php-mysql
This single line of code installs PHP and MySQL extensions for PHP. We need PHP to set up WordPress.
4. sudo apt-get install mysql-server
There will be some options that will be displayed when you run the install command, choose the answer as displayed in the video below to avoid any further issues after installation.
As we have installed the MySQL server on Ubuntu, we need to secure the installation by running the below command. It will also ask you a few questions, which I have answered in the video below. There is another detailed article available on how to install MySQL on Ubuntu, which you can find here.
5. sudo apt-get install redis-server
This line of code installs the Redis server on your Ubuntu Machine.
Next, I have included the video where I have shown all the steps from my screen.
So in this article, we have seen how to install Redis in Ubuntu OS and then configure a WordPress site to use Redis. I hope this might helped you to start with AWS and Redis and if you stuck on any issues feel free to contact me via [email protected] or call me @ +8801554306975
1 thought on “How to setup WordPress With Redis”
Pingback: 14 Ways to Improve the Performance of Your WordPress Site - Top WordPress Tips