DEV Community

sc0v0ne
sc0v0ne

Posted on • Edited on

Tutorial: Install Redis in Ubuntu - Linux

Follow the steps below to install Redis:

You will open the terminal and type:

sudo apt-get update
Enter fullscreen mode Exit fullscreen mode

Install build-essential

sudo apt-get install build-essential -y
Enter fullscreen mode Exit fullscreen mode

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 

Enter fullscreen mode Exit fullscreen mode

Rename the file

mv redis-7.2.4 redis

Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

mv redis ~/.redis

Enter fullscreen mode Exit fullscreen mode

You will now access the new location:

cd ~

cd .redis
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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:~$ 

Enter fullscreen mode Exit fullscreen mode

If no error appears, installation was successful.

Simpler alternative

Install the necessary libraries

sudo apt install lsb-release curl gpg
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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


Top comments (1)

Collapse
 
3dd1_learn profile image
eddi

Very Good !!!