You may have already heard about Redis databases. Likewise, you may have noticed that many websites use Redis as an object cache to serve pages faster. In this article, we’ll show you how to install Redis on your VPS or Dedicated server.
In order to install Redis, we will make sure to complete the following steps:
- Grab the latest stable release
- Install the source files
- Test the installation
Once these steps are complete, you will be able to use Redis for your website.
Note that you will require root or sudo access in order to run these commands.
How to Install Redis
In order to prepare for running these commands, make sure that you have logged into your server as the root user.
- Log into your server via SSH
- Download the latest stable Redis release as a compressed file
- Decompress the file
tar xvzf redis-stable.tar.gz
- Change into the uncompressed directory
- Run the make command:
- Complete the installation with this command:
(If not logged in as root add a sudo before this command to make it sudo make install)
The redis install process may take a few minutes. Once you've completed the installation make sure to run this command to get the server running: redis-server
How to Test Your Installation
It may be best advised to check and see if your installation process was successful. All you’ll need to do is run this test command.
And you should see a reply:
Well done! You have now successfully installed Redis. Now you can use the various tools and plugins available on the web to use Redis as a cache.