New from O’Reilly: The memory architecture behind adaptive AI agents

Read the report
For operatorsHow to Deploy and Run Redis in a Docker Container

Prerequisites

Ensure that Docker is installed in your system. Follow Docker's installation guide if you haven’t installed it yet

Step 1: Run the Redis container

Execute the following command to run Redis container in the background in a “detached” mode.

where my-redis-stack is the name of Docker container -d representis running Redis in a background in a “detached” mode. redis/redis-stack-server is the name of Docker image that it fetches from Docker Hub.

Step 2: Verify that the Redis container is running

Step 3: Connect to your database

The following uses the first three alphanumeric characters of your Container ID and opens up sh shell of the Redis Docker container:

Step 4: Testing Redis container​

Execute the following command to test the Redis server:

Step 5: Running Redis container with Persistent Storage

​In order to enable persistence, you should invoke the Docker container, passing appendonly yes option as shown below:

Check ls -ld /Users/my-redis/ on your host machine to view the directory permissions.

So If persistence is enabled, data is stored in the volume /data, which can be used with --volumes-from some-volume-container or -v /docker/host/dir:/data