Sling Academy
Home/DevOps/How to Install and Configure Redis on Ubuntu 23.04

How to Install and Configure Redis on Ubuntu 23.04

Last updated: December 03, 2023

Redis is an in-memory data structure store that can serve as a temporary database, cache, or message broker. It supports various data types, such as strings, lists, sets, hashes, and more. Redis is fast, flexible, and reliable. The steps below show you how to install and configure Redis on Ubuntu 23.04 LTS. Without any further ado, let’s begin!

1. Update system packages:

sudo apt update

2. Get Redis installed by executing the following command:

sudo apt install redis-server

3. Open the Redis configuration file:

sudo nano /etc/redis/redis.conf

And Change supervised directive to systems:

supervised systemd

Save and close the file by pressing: Ctrl + X, then Y, and Enter.

4. Restart Redis service:

sudo systemctl restart redis.service

5. Test if Redis is working:

redis-cli ping

You should see this output:

PONG

6. Open the config file to secure Redis with a password:

sudo nano /etc/redis/redis.conf

Uncomment and modify requirepass directive:

requirepass your_password

Save your change and exit the file: Ctrl + X, Y, Enter.

7. Restart Redis service:

sudo systemctl restart redis.service

8. Check if Redis is secured:

redis-cli ping

Output:

NOAUTH Authentication required

Try again but authenticate with your password:

redis-cli -a your_password ping

This time, it works like a charm:

PONG

Done!

Next Article: Ubuntu: How to open/close a port in firewall (UFW)

Previous Article: Ubuntu: How to set up and configure firewall (UFW)

Series: Linux Tutorials

DevOps

You May Also Like

  • How to reset Ubuntu to factory settings (4 approaches)
  • Making GET requests with cURL: A practical guide (with examples)
  • Git: What is .DS_Store and should you ignore it?
  • NGINX underscores_in_headers: Explained with examples
  • How to use Jenkins CI with private GitHub repositories
  • Terraform: Understanding State and State Files (with Examples)
  • SHA1, SHA256, and SHA512 in Terraform: A Practical Guide
  • CSRF Protection in Jenkins: An In-depth Guide (with examples)
  • Terraform: How to Merge 2 Maps
  • Terraform: How to extract filename/extension from a path
  • JSON encoding/decoding in Terraform: Explained with examples
  • Sorting Lists in Terraform: A Practical Guide
  • Terraform: How to trigger a Lambda function on resource creation
  • How to use Terraform templates
  • Understanding terraform_remote_state data source: Explained with examples
  • Jenkins Authorization: A Practical Guide (with examples)
  • Solving Jenkins Pipeline NotSerializableException: groovy.json.internal.LazyMap
  • Understanding Artifacts in Jenkins: A Practical Guide (with examples)
  • Using Jenkins with AWS EC2 and S3: A Practical Guide