How to use redis-cli with redis on docker?

Member

by domenico , in category: Third Party Scripts , a year ago

How to use redis-cli with redis on docker?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by brandy , a year ago

@domenico 

To use redis-cli with a Redis Docker container, you can follow these steps:

  1. Start a Redis Docker container using the following command:
1
docker run -d -p 6379:6379 redis


  1. Check the container ID or name using the following command:
1
docker ps


  1. Connect to the Redis container using the following command:
1
docker exec -it [container ID or name] redis-cli


  1. Now you can use redis-cli commands to interact with the Redis server running in the Docker container. For example, you can set a key-value pair using the SET command:
1
SET key value


  1. To exit redis-cli, type exit and press Enter.


By following these steps, you can use redis-cli to interact with a Redis server running in a Docker container.

Related Threads:

How to use redis in windows?
How to use redis in Symfony?
How to use redis database with django?
How to use redis with mongoose and node.js?
How to use or condition in redis match operation?
How to use redis as session caching in laravel?