Tutorial: Install Redis in Ubuntu - Linux
Tags: redis, database, tutorial, learning
Published: 2024-03-06 00:33:07

Follow the steps below to install [Redis](https://redis.io/):

You will open the terminal and type:

```bash
sudo apt-get update
```

Install build-essential

```bash
sudo apt-get install build-essential -y
```

Now you will access the **[Redis](https://redis.io/)** website

Click on download

![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b4swga7ajq6q5wdhgmtb.png)

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

![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07gclsyoqjevu1erocrw.png)

To save:

![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bt526f3dogiu5ug7sq5i.png)

Now in the terminal you will access the downloads folder


![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vpw4vt93ku0egm9h8stv.png)

Then you will unzip the file

```bash
tar -xvzf redis-7.2.4.tar.gz 

```
Rename the file

```bash
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.

```bash
# ~/.redis

mkdir .redis
```

```bash

mv redis ~/.redis

```
You will now access the new location:

```bash
cd ~

cd .redis
```

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

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

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

This step to compile:

![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfykgue02q8xzv7qb4f6.png)

Then run the tests and check:

![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkhv01shdvvh6vhqpsai.png)

![Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tziqnt4rkmhustvodjdv.png)

Now open your .bashrc file and add the folder path
```text
PATH=$PATH:/home/eddi/.redis/src
export PATH
```

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

```bash
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

```bash
sudo apt install lsb-release curl gpg
```

Then run:

```bash
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

- [Install Redis on Linux](https://redis.io/docs/install/install-redis/install-redis-on-linux/)
- [Redis](https://redis.io/)
- [Documentation](https://redis.io/docs/get-started/data-store/)


-----

## My Latest Posts

{% embed https://dev.to/sc0v0ne/did-you-say-free-gpu-542c %}

{% embed https://dev.to/sc0v0ne/my-super-powers-as-a-software-developer-2024-1h17 %}

{% embed https://dev.to/sc0v0ne/becoming-efficient-with-pomodoro-1km8 %}

{% embed https://dev.to/sc0v0ne/why-use-obsidian-for-software-development-3j42 %}

{% embed https://dev.to/sc0v0ne/creating-dataset-the-elder-scroll-skyrim-armor-and-sending-to-kaggle-datasets-n2f %}

-------

## About the author:

{% embed https://dev.to/sc0v0ne %}

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

- [Kaggle](https://www.kaggle.com/sc0v1n0)
- [Gitlab](https://gitlab.com/sc0v0n3)
- [Github](https://github.com/sc0v0ne)
- [Mastodon](https://mastodon.social/@sc0v0ne)

----