Logo

dev-resources.site

for different kinds of informations.

Tutorial: Install Redis in Ubuntu - Linux

Published at
3/6/2024
Categories
redis
database
tutorial
learning
Author
sc0v0ne
Categories
4 categories in total
redis
open
database
open
tutorial
open
learning
open
Tutorial: Install Redis in Ubuntu - Linux

Follow the steps below to install Redis:

You will open the terminal and type:

sudo apt-get update

Install build-essential

sudo apt-get install build-essential -y

Now you will access the Redis website

Click on download

Image by author

Then click on Download the version that appears to you, and you can update it after publishing this post.

Image by author

To save:

Image by author

Now in the terminal you will access the downloads folder

Image by author

Then you will unzip the file

tar -xvzf redis-7.2.4.tar.gz 

Rename the file

mv redis-7.2.4 redis

You will move the redis folder to an accessible location

First you need to create the folder if you don't have one.

# ~/.redis

mkdir .redis

mv redis ~/.redis

You will now access the new location:

cd ~

cd .redis

Now inside this folder there is the redis folder, move the files from inside to outside and remove the empty folder.

mv redis/* ~/.redis
rm -r redis

Now inside the .redis folder you will execute the following commands.

This step to compile:

Image by author

Then run the tests and check:

Image by author

Image by author

Now open your .bashrc file and add the folder path

PATH=$PATH:/home/eddi/.redis/src
export PATH

Close the terminal and open it again and perform the following commands.

sc0v0ne@machine-popos:~$ redis-cli --version
redis-cli 7.2.4
sc0v0ne@machine-popos:~$ redis-server --version
Redis server v=7.2.4 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=817811e6323dbe4b
sc0v0ne@machine-popos:~$ 

If no error appears, installation was successful.

Simpler alternative

Install the necessary libraries

sudo apt install lsb-release curl gpg

Then run:

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

Resources

My Latest Posts

About the author:

A little more about me...

Graduated in Bachelor of Information Systems, in college I had contact with different technologies. Along the way, I took the Artificial Intelligence course, where I had my first contact with machine learning and Python. From this it became my passion to learn about this area. Today I work with machine learning and deep learning developing communication software. Along the way, I created a blog where I create some posts about subjects that I am studying and share them to help other users.

I'm currently learning TensorFlow and Computer Vision

Curiosity: I love coffee

Featured ones: