avatarRafli Ramadhan

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1680

Abstract

name and port as follows. The first port is 6379 for Redis server and 8001 for Redis insight.</p><figure id="e08a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Vj5Tu_InxN9tEphjWbz_bA.png"><figcaption></figcaption></figure><p id="d3f1">Add the environment variables REDIS_USERNAME and REDIS_PASSWORD, then click the run button.</p><figure id="7164"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*FvDllQSsoTbpdiduOk7ylA.png"><figcaption></figcaption></figure><p id="f793">The Redis container will be displayed in the containers tab.</p><figure id="adc2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*7hXZ6zNZosQXx4DsuOw0iA.png"><figcaption></figcaption></figure><p id="75cb"><b>Step 3 (Use CLI or Install GUI to manipulate data)</b></p><ol><li><b>Using CLI</b></li></ol><p id="181f">To open Redis CLI, first run the following command:</p><div id="05b1"><pre>docker <span class="hljs-built_in">exec</span> -it your_container_name sh</pre></div><p id="ff38">Then type redis-cli as shown below, we can use keywords like set, get and del to manipulate data in Redis. Here are examples of some commands in redis-cli:</p><figure id="809e"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*teVL4iGsau6CODQw30tkig.png"><figcaption></figcaption></figure><p id="990c"><b>2. Using Redis-insight</b></p><p id="ada4">Redis insight is the official Redis GUI which you can download <a href="https://redis.io/insight/">here</a>. Once the download process is complete, place the file into your local directory and install it.</p><figure id="6bac"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*b_cO5bPoVf

Options

m8cjHk2aJqrw.png"><figcaption></figcaption></figure><p id="e990">Here is how Redis insight looks like.</p><figure id="210a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*5J6VDHsKpxMFdyQs0Ivkcg.png"><figcaption></figcaption></figure><p id="f4fe">Add connection details manually to open the database.</p><figure id="5a56"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*YhkazillKveG8SDii8hB2w.png"><figcaption></figcaption></figure><p id="733d">Fill in the username and password and click test connection. If it fails, try leaving the username and password blank. If successful, click add Redis database.</p><figure id="0941"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*MsBza3MTS0AYpI6FvCEySA.png"><figcaption></figcaption></figure><p id="68fd">Your database will be displayed in My Redis Databases tab.</p><figure id="65fe"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*dlhLk9IkS-OmG7mhk6fc5g.png"><figcaption></figcaption></figure><p id="a44e">To add multiple key-values, we can add them by using the +Key button on the right panel. Select the key type as needed, fill in the TTL if needed if you want to set a temporary key, fill in the value, then click the add key button.</p><figure id="c6f1"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*m5yf4QHU9LB2AHNZBtl2Tg.png"><figcaption></figcaption></figure><p id="02cd">Your key-value will be shown in the database as follows.</p><figure id="cfee"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*YRcDOJQo2TfZzULhesp4xw.png"><figcaption></figcaption></figure><p id="43a7">Thank you for reading.</p></article></body>

Setting Up Redis (Redis-Stack) with Docker Desktop on Windows: A Step-by-Step Guide

Intro

Here is an article that helps you to know the difference between Redis from docker official image and redis-stack: About Redis Stack — Redis.

Redis from Docker Official Image.
Redis-stack.

Pre-requisite:

The Docker desktop must be installed first. Here is the link for install docker desktop: Install Docker Desktop on Windows | Docker Docs

Step 1 (Search Redis image)

Open the search bar at the top of the docker desktop, then type redis-stack. Click the pull button to download the image, wait for the download process to complete.

Step 2 (Running image)

Click the run button to the right of the redis-stack image.

Then click the optional settings dropdown and fill in the container name and port as follows. The first port is 6379 for Redis server and 8001 for Redis insight.

Add the environment variables REDIS_USERNAME and REDIS_PASSWORD, then click the run button.

The Redis container will be displayed in the containers tab.

Step 3 (Use CLI or Install GUI to manipulate data)

  1. Using CLI

To open Redis CLI, first run the following command:

docker exec -it your_container_name sh

Then type redis-cli as shown below, we can use keywords like set, get and del to manipulate data in Redis. Here are examples of some commands in redis-cli:

2. Using Redis-insight

Redis insight is the official Redis GUI which you can download here. Once the download process is complete, place the file into your local directory and install it.

Here is how Redis insight looks like.

Add connection details manually to open the database.

Fill in the username and password and click test connection. If it fails, try leaving the username and password blank. If successful, click add Redis database.

Your database will be displayed in My Redis Databases tab.

To add multiple key-values, we can add them by using the +Key button on the right panel. Select the key type as needed, fill in the TTL if needed if you want to set a temporary key, fill in the value, then click the add key button.

Your key-value will be shown in the database as follows.

Thank you for reading.

Redis
Redis Stack
Docker Image
Docker Desktop
Recommended from ReadMedium