How to Install Redis on Your VPS/Dedicated Server

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.

  1. Log into your server via SSH
  2. Download the latest stable Redis release as a compressed file
     wget https://download.redis.io/redis-stable.tar.gz
  3. Decompress the file
     tar xvzf redis-stable.tar.gz
  4. Change into the uncompressed directory
     cd redis-stable
  5. Run the make command:
     make
  6. Complete the installation with this command:
     make install

    (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.

 redis-cli ping

And you should see a reply:

 PONG

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.

Thoughts on “How to Install Redis on Your VPS/Dedicated Server

Leave a Reply to Carlos DaSilva Cancel reply