
Redis Stack Server is a package that combines Redis, Redis Modules, RedisInsight, and RedisGears into a single installation. Redis Stack Server allows you to run Redis with advanced features and capabilities, such as search, graph, JSON, AI, and stream processing. Redis Stack Server also provides a graphical user interface for managing and monitoring your Redis instances. In this blog post, I will show you how to install Redis Stack Server on the latest Ubuntu using the official APT repository.
Before you begin, you need to have the following:
To install the latest stable version of Redis Stack Server, you need to add the official packages.redis.io APT repository to your system. This repository supports Debian Bullseye (11), Ubuntu Bionic (18.04), Ubuntu Focal (20.04), and Ubuntu Jammy (22.04) on x86 and arm64 processors.
To add the repository, follow these steps:
sudo apt update
sudo apt install curl gnupg
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
Now that you have added the Redis APT repository, you can install Redis Stack Server using the apt command. To do so, follow these steps:
sudo apt update
sudo apt install redis-stack-server
The installation process will take some time and install all the components of Redis Stack Server, including Redis, Redis Modules, RedisInsight, and RedisGears. It will also create a systemd service for Redis Stack Server and start it automatically.
To verify that Redis Stack Server is installed and running correctly, you can use the following methods:
sudo systemctl restart redis-stack-server sudo systemctl status redis-stack-server
You should see an output similar to this:
● redis-stack-server.service - Redis Stack Server
Loaded: loaded (/lib/systemd/system/redis-stack-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-10-18 12:34:56 UTC; 5min ago
Docs: 3
Main PID: 1234 (redis-server)
Tasks: 4 (limit: 2286)
Memory: 81.4M
CGroup: /system.slice/redis-stack-server.service
└─1234 /usr/bin/redis-server 127.0.0.1:6379
Oct 18 12:34:56 ubuntu systemd[1]: Starting Redis Stack Server...
Oct 18 12:34:56 ubuntu systemd[1]: Started Redis Stack Server.
This indicates that the service is active and running.
redis-cli
You should see a prompt similar to this:
127.0.0.1:6379>
This indicates that you are connected to the Redis server.
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379> json.set foo . '{"name":"bar"}'
OK
127.0.0.1:6379> json.get foo
"{"name":"bar"}"
127.0.0.1:6379> quit
These commands demonstrate how to use the basic Redis commands and the RedisJSON module. You can find more commands and examples in the Redis documentation.
The RedisInsight graphic user interface helps you visually browse and interact with Redis data.
RedisInsight installation downloads through the official page.
# redis server monitor redis-cli monitor 127.0.0.1:6379> monitorfind the redis data path
redis-cli config get dir 127.0.0.1:6379> config get dir
turn off protected mode if redis is running in secure enviroment (behind firewall, dedicate non sharing network)
redis-cli config set protected-mode no 127.0.0.1:6379> config set protected-mode no
##############GENERAL###############daemonize yes // run redis server in the background
requirepass <secure_password> // secure your server with a password
pidfile /var/vcap/sys/run/redis.pid // path to the Redis PID file
#############NETWORK################
bind 0.0.0.0 // listen on all addresses
port 6379 // default bind port
timeout 3600s // close connection after client is idle for N seconds
tcp-keepalive 60
###########LOGGING####################
logfile /var/vcap/sys/log/redis/redis.log // path to the log file
###########PERSISTENCE################
dbfilename dump.rdb // name to your database save file
dir /var/vcap/store/redis // directory to database saves
appendonly no // save mode
save 900 1
save 300 10
save 60 10000
##############CLIENTS#############
maxclients 10000
In this blog post, I have shown you how to install Redis Stack Server on the latest Ubuntu using the official APT repository. Redis Stack Server is a package that combines Redis, Redis Modules, RedisInsight, and RedisGears into a single installation. Redis Stack Server allows you to run Redis with advanced features and capabilities, such as search, graph, JSON, AI, and stream processing. Redis Stack Server also provides a graphical user interface for managing and monitoring your Redis instances. I hope you have enjoyed this tutorial and learned something new. If you have any questions or feedback, please leave a comment below. Thank you for reading!