banner
云野阁

云野阁

闲云野鹤,八方逍遥

Install Redis with Docker

First, enter the command docker pull redis to install the latest version of Redis locally.

Enter the following command to start Redis in the background (Note: this command is a single command).

The name after --name is the name of the Redis container, which can be changed as desired.

docker run -p 6379:6379 --name mars1 --privileged=true

-v /app/redis/redis.conf:/etc/redis/redis.conf

-v /app/redis/data:/data

-d redis redis-server /etc/redis/redis.conf

This command can also solve the problem of data loss that occurs after deleting the Redis container. To recover the data, simply rerun the command.

image-20230411164804210

Run the command docker ps to see that Redis is running.

image-20230411163752381

Then execute the command docker exec -it mars1 /bin/bash, and Redis is successfully running.

image-20230411180817939-1711202816360-2

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.