Docker Install Redis
# Docker Install Redis
Redis is an open-source, network-supported, in-memory and persistent log-based, Key-Value NoSQL database written in ANSI C, and it provides APIs for multiple languages.
### 1. Check Available Redis Versions
Visit the Redis image repository: [https://hub.docker.com/_/redis?tab=tags](https://hub.docker.com/_/redis?tab=tags).
You can view other versions of Redis by sorting. The default is the latest version **redis:latest**.
[!(#)](#)
You can also find other versions you want in the dropdown list:
[!(#)](#)
Additionally, we can use the `docker search redis` command to view available versions:
$ docker search redis NAME DESCRIPTION STARS OFFICIAL AUTOMATED redis Redis is an open source ... 2321 sameersbn/redis 32 torusware/speedus-redis Always updated official ... 29 bitnami/redis Bitnami Redis Docker Image 22 anapsix/redis 11MB Redis server image ... 6 webhippie/redis Docker images for redis 4 clue/redis-benchmark A minimal docker image t... 3 williamyeh/redis Redis image for Docker 3 unblibraries/redis Leverages phusion/baseim... 2 greytip/redis redis 3.0.3 1 servivum/redis Redis Docker Image 1 ...
### 2. Pull the Latest Redis Image
Here we pull the official latest version of the image:
$ docker pull redis:latest
[!(#)](#)
### 3. Check Local Images
Use the following command to check if Redis is already installed:
$ docker images
[!(#)](#)
In the image above, we can see that we have installed the latest version (latest) of the Redis image.
### 4. Run the Container
After installation, we can use the following command to run the Redis container:
$ docker run -itd --name redis-test -p 6379:6379 redis
Parameter Explanation:
* **-p 6379:6379**: Maps port 6379 of the container service to port 6379 of the host machine. You can access the Redis service directly via host_ip:6379 from outside.
[!(#)](#)
### 5. Installation Successful
Finally, we can check the container's running information with the **docker ps** command:
[!(#)](#)
Next, we connect to test the Redis service using redis-cli.
$ docker exec -it redis-test /bin/bash
[!(#)](#)
YouTip