Even Drupal, a CMS known for speed, get slow as the size of the website increases beyond a manageable size. This is when the visitors start to notice the lag-ridden performance of the Drupal 7 website.
An important way of ensuring the speed of a Drupal 7 is to use a caching technology that reduces the load on the server. One of the most popular caching methods is Redis. The good news is that Cloudways allows 1-click installation of Redis on your server.
In this tutorial, I will show you how to install Redis on your Drupal website hosted on Cloudways Platform. The process involves the following steps:
- Go to your server
- Navigate to Settings & Packages
- Install Redis on the server
- Ensure Redis is active on the server
- Download and install Redis Module on your Drupal website
- Edit settings.php
- Check whether Redis is working correctly.
Nothing as Easy as Deploying Drupal Apps on Cloud
With Cloudways, you can have your Drupal apps up and running on managed cloud servers in just a few minutes.
Go to the Server
Login to the Cloudways Platform and select the server on which you wish to install Redis.
Navigate to Settings & Packages > Packages
Next, click the Settings & Packages button in the left panel.
Navigate to the Packages section at the top.
Install Redis on the Server
Click the Install button beside the Redis subheading to start the installation process.
The process is usually over within minutes.
Ensure Redis is Active on the Server
Now click the Manage Services button on the left panel and scroll down to the Redis subheading. Check the status to confirm that the Redis service is active.
At this point, you have successfully installed Redis on your server. The next step is the activation of Redis on your Drupal website. The following steps will take you through the process.
Download and Install Redis Module
The very first thing you need to do on your Drupal 7 website is to download and install the Redis module. Remember to enable the module after installation.
Edit settings.php
After you have installed the module, you need to edit the settings.php file in the Drupal installation. This file is located in the sites > default folder. You could either use the shell access or an FTP software (Filezilla is a good choice) to edit this file. Insert the following code at the end of the file:
/* Redis config * Please leave the settings below untouched */ $conf['cache_backends'][] = 'sites/all/modules/redis/redis.autoload.inc'; $conf['cache_class_cache'] = 'Redis_Cache'; $conf['cache_class_cache_menu'] = 'Redis_Cache'; $conf['cache_class_cache_bootstrap'] = 'Redis_Cache'; $conf['lock_inc'] = 'sites/all/modules/redis/redis.lock.inc'; $conf['path_inc'] = 'sites/all/modules/redis/redis.path.inc'; $conf['redis_client_host'] = ‘127.0.0.1'; $conf['redis_client_port'] = ‘6379’; $conf['redis_client_password'] = ‘’;
Save and close the file after you are done with it.
Check if Redis is Working
Go to Drupal’s CLI and enter the following command:
redis-cli monitor
Keep the CLI open and carry out several actions on your website. Now check the CLI window and you will notice that a number of lines have been generated. This means that the Redis installation is working perfectly on your website.
Conclusion
As you could see, installing and configuring Redis in incredibly simple, thanks to Cloudways. Even a lay user could carry out the procedure without any issues. I hope that after running through this tutorial, your Drupal 7 website has regained its former speed. If you liked this blog post then, also check out another post on 10 Tips To Speed Up Your Drupal Website
Hamza Zia
Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.