Installing Redis on CentOS

  1. Download the Redis Compressed Package

You can download Redis directly from the official Redis website. For convenience, here's a direct link to version 6.2.14: Redis 6.2.14 download link.

On the homepage of the Redis website, click on "Download" to access the download page. If you want the latest stable version, choose the topmost "stable" option. However, for this guide, we'll use Redis 6.2.14. Scroll down to the "Older Redis Versions" section and click on "download 6.2.14" to start downloading.

  1. Upload the Redis Package to the Server

To upload the downloaded package to your server, you can use tools like FinalShell or Xshell. FinalShell is a free tool that allows you to drag and drop files directly onto the server, making it beginner-friendly.

  1. Installing Redis

Once the package is uploaded, follow these steps:

  1. Navigate to the directory where the Redis package is located and extract it:
tar -zxvf redis-6.2.14.tar.gz

  1. Move into the extracted directory:
cd redis-6.2.14

  1. Compile the source code using make. This may take some time:
make

  1. Install Redis by specifying the installation path:
make install PREFIX=/usr/local/redis

  1. Verify the installation by checking the contents of the /usr/local/redis directory:

ls -l /usr/local/redis/
ls -l /usr/local/redis/bin


Ensure that the bin directory contains Redis-related executable files.

  1. Create symbolic links to /usr/bin for easier access:
rm -rf /usr/bin/redis-*
ln -s /usr/local/redis/bin/redis-server /usr/bin/redis-server
ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis-cli
ln -s /usr/local/redis/bin/redis-benchmark /usr/bin/redis-benchmark
ln -s /usr/local/redis/bin/redis-check-rdb /usr/bin/redis-check-rdb
ln -s /usr/local/redis/bin/redis-sentinel /usr/bin/redis-sentinel

  1. Check the installed versions:

redis-server -v
redis-cli -v


At this point, Redis should be successfully installed.

  1. Configuring Redis
  2. Copy the redis.conf file from the installation directory to /etc for easier management:
cp redis-6.2.14/redis.conf /etc

  1. Open the configuration file with a text editor (e.g., Vim):
vim /etc/redis.conf

  1. Modify the following settings in the configuration file:
  • Set daemonize to yes to allow Redis to run as a background process:
daemonize yes

  • Bind Redis to specific IP addresses (if needed). By default, it binds to all network interfaces:
bind 127.0.0.1 -::1

  • Specify the port Redis will listen on (default is 6379):
port 6379

  • Define the number of databases:
databases 16

  • Optionally, set a password for Redis access by uncommenting and modifying the requirepass line:
requirepass your_password_here

  1. Start Redis with the Configuration File

Run the following command to start Redis using the specified configuraton:

redis-server /etc/redis.conf

Tags: Redis centos configuration

Posted on Mon, 22 Jun 2026 17:45:37 +0000 by Yawa