Docker/Redis
< Docker
Try It
editOnline Free
edit- Use Play with Docker. Create an account and/or log in.
- Start an interactive session and add a new instance.
- In the terminal window, enter the following command:
docker run -d -p 6379:6379 --name=redis-server redis
- To connect to the redis-server, enter the following commands:
docker exec -it redis-server bash
redis-cli
On Your Own System
edit- Install Docker Desktop or the Docker Engine.
- In a terminal window, enter the following command:
docker run -d -p 27017:27017 --name=redis-server redis
- To connect to the redis-server, enter the following commands:
docker exec -it redis-server bash
redis-cli
Programming
edit- To connect to the redis-server from a programming language in a separate container:
- Use
redis-server
for the host name. - Modify the
Dockerfile
to install any required libraries.
- Use
- To connect to the redis-server from a programming language not running in a container:
- Use
localhost
for the host name. - Modify the
Dockerfile
to install any required libraries.
- Use