Debug School

Cover image for Install Redis
Suyash Sambhare
Suyash Sambhare

Posted on

Install Redis

Install Redis from the official packages.redis.io APT repository.

Prerequisites
If you're running on a very minimal distribution (eg. a Docker container) you may need to install lsb-release, curl and gpg
sudo apt install lsb-release curl gpg

Install Redis
Add the repository to the aptitude index.

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis
Enter fullscreen mode Exit fullscreen mode

Install from Snapcraft
The Snapcraft store provides Redis packages that can be installed on platforms that support Snap. Snap is supported and available on most major Linux distributions.

sudo snap install redis

Sahyadri

Install Redis Stack on Linux
You can install recent stable versions of Redis Stack from the official packages.redis.io APT repository. Add the repository to the aptitude index.

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis-stack-server
Enter fullscreen mode Exit fullscreen mode

For CentOS/RedHat
You can install recent stable versions of Redis Stack from the official packages.redis.io YUM repository. The repository currently supports RHEL7/CentOS7 and RHEL8/Centos8. Add the repository to the repository index, and install the package.

Create the file /etc/yum.repos.d/redis.repo with the following contents

[Redis]
name=Redis
baseurl=http://packages.redis.io/rpm/rhel7
enabled=1
gpgcheck=1
curl -fsSL https://packages.redis.io/gpg > /tmp/redis.key
sudo rpm --import /tmp/redis.key
sudo yum install epel-release
sudo yum install redis-stack-server
Enter fullscreen mode Exit fullscreen mode

With snap
From Download, get the latest Stack snap package.

To install, run:
sudo snap install --dangerous --classic <snapname.snap>

With AppImage
From Download, get the latest Stack AppImage package.
Enable the installation:
chmod a+x <AppImagefile>

To install run:
./<appimagefile>

Ref: https://redis.io/docs/getting-started/installation/

Top comments (0)