- Docker Desktop
- Any Terminal ( Recommended : Windows Terminal )
- Redis VS Code Extension - Optional
-
Run in your terminal
docker run -d --rm --name CacheServer -p 6379:6379 redis
, it will providelocalhost:6379
as redis connection string.Docker Run Command:
docker container run -d --name [container_name] -p [machine_port]:[container_port] [docker_image]
Options :- -d, –detach: It is used to run the container in the background and print container ID.
- –name: It is used to specify the name of the container
- -p, –publish: It is used to publish container’s ports to host
-
Now you are ready to use
localhost:6379
to connect with redis server. -
Open Redis VS Code Extension, Add connection left everything empty test your connection if succeed press Ok create a connection with Redis.
- If the connection is successfully connected with redis you will see a dialog same as bellow in sidebar.