How to Install Redis Stack Server on the Latest Ubuntu

@technology

Over a year ago

post image

How to Install Redis Stack Server on the Latest Ubuntu

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.

Prerequisites

Before you begin, you need to have the following:

  • A system running the latest Ubuntu (22.04 Jammy Jellyfish at the time of writing, 23.10 has trouble with signed repository).
  • A user account with sudo privileges.
  • A stable internet connection.

Step 1: Add the Redis APT Repository

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:

  • Open a terminal and update the package index:
sudo apt update
  • Install the curl and gnupg packages if they are not already installed:
sudo apt install curl gnupg
  • Download and import the Redis GPG key:
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
  • Add the Redis APT repository to your sources list:
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

Step 2: Install Redis Stack Server

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:

  • Update the package index again:
sudo apt update
  • Install Redis Stack Server:
sudo apt install redis-stack-server
  • Confirm the installation by pressing Y when prompted.

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.

Step 3: Verify the Installation

To verify that Redis Stack Server is installed and running correctly, you can use the following methods:

  • Check the status of the Redis Stack Server service:
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.

  • Connect to the Redis server using the redis-cli command:
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.

  • Run some Redis commands to test the functionality of the server and the modules. For example, you can run the following commands:
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.

  • Browse, filter, and visualize Redis keys, perform CRUD operations, or delete keys in bulk. 
  • Display data in pretty-print JSON, hexadecimal, MessagePack, and many other formats. Use friendly keyboard navigation. 
  • Use the Tree view to group data and enhance the navigation.


RedisInsight installation downloads through the official page.


Frequent use commands

# redis server monitor
redis-cli monitor
127.0.0.1:6379> monitor

# find 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


Example of config file redis.conf

##############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

Conclusion

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!

You may also like:

D o you want to connect with people who share your interests, passions, and goals? Do you want to express yourself, showcase your talents, and discover new opportunities? Do you want to enjoy a safe and enjoyable platform that offers everything you need for your daily computing needs? If you answered yes to any of these questions, then you should join NXplan.com, the new all-in-one social platform that features blog, messaging, chat, inbox, and marketplace.

NXplan.com is more than just a social network.

It’s a social ecosystem that allows you to create, communicate, and collaborate with others in a variety of ways. You can:
Create your own blog and share your thoughts, opinions, and experiences with the world. You can also follow other bloggers and get inspired by their content. Message your friends and family and stay in touch with them. You can also make new friends and join groups that match your interests.
Chat with other users and have fun conversations. You can also join live events and webinars and learn from experts and influencers. Manage your inbox and organize your emails. You can also send and receive files, photos, and videos with ease. Explore the marketplace and find products and services that suit your needs. You can also sell your own products and services and earn money.

NXplan.com is designed to provide you with a safe and enjoyable platform that respects your privacy and security.

You can: Control your own data and decide who can see and access your information. Report and block any abusive or inappropriate content or users. Enjoy a spam-free and ad-free environment that does not track or sell your data. Access the platform from any device and any browser, without any downloads or installations. NXplan.com is free to join and use, and you can get started in minutes. All you need is a valid email address and a password. You can also customize your profile and settings to make it your own.

Ready to give it a try?

Join NXplan.com today and discover a new way of socializing online. You’ll be amazed by what you can do and who you can meet on NXplan.com. Don’t miss this opportunity to join the next big thing in social media. Register now and start your NXplan journey.

Technology is nothing. What's important is that you have a faith in people, that they're basically good and smart, and if you give them tools, they'll do wonderful things with them

Steven Jobs

post image
post image
Posting, please wait...
Please type a message first!