Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

What Is Redis and How to Install It

This guide explains Redis and shows how to install it on a Linux server. Installing needs root access, so it fits a VPS or dedicated server.

How-To Guides2 min read14 steps

What is Redis?

Redis is a very fast data store that keeps information in memory (RAM). RAM is the computer's quick short-term memory. Because it avoids the slower disk, Redis answers in tiny fractions of a second. Websites use it as a cache, which is a place to keep copies of things used often, like page parts or search results. It is also used for sessions (remembering who is logged in) and job queues.

Steps on Ubuntu or Debian

  1. Connect to your server with SSH.
  2. Update the package list:
sudo apt update
  1. Install Redis:
sudo apt install redis-server -y
  1. Start it and make it start at boot:
sudo systemctl enable --now redis-server

Steps on AlmaLinux, Rocky or CentOS

  1. Install Redis:
sudo dnf install redis -y

On older CentOS you may need yum and an extra package source.

  1. Start it and make it start at boot:
sudo systemctl enable --now redis

Test that it works

  1. Open the Redis command tool:
redis-cli
  1. Type ping. It should answer PONG.
  2. Store and read a value:
set mykey "hello"
get mykey

The first line saves a value. The second line reads it back.

  1. Type exit to leave.

Keep it safe

Warning: do not leave Redis open to the internet. Attackers scan for open Redis servers.

  1. Back up the settings file. Its path is /etc/redis/redis.conf on Ubuntu, or /etc/redis.conf on Alma and Rocky.
  2. Open the file and make sure this line is set, so only the server itself can connect:
bind 127.0.0.1
  1. Add a password with the requirepass line:
requirepass YourStrongPasswordHere
  1. Restart Redis, using the service name from earlier steps:
sudo systemctl restart redis-server
Tip: Apps like WordPress and Laravel can use Redis for caching once you install a connector. Redis uses RAM, so keep an eye on your memory.

Quick recap

  • Redis is a fast in-memory store, often used for caching.
  • Install it with apt or dnf and start the service.
  • Test with redis-cli and ping.
  • Keep it private with bind and a password.