Docker quickstart for Redis Enterprise Software
Set up a development or test deployment of Redis Enterprise Software using Docker.
For testing purposes, you can run Redis Enterprise Software on Docker containers on Linux, Windows, or MacOS. The Redis Enterprise Software container acts as a node in a cluster.
To get started with a single Redis Enterprise Software container:
-
Install Docker for your operating system
Install Docker
Follow the Docker installation instructions for your operating system:
Run the container
To download and start the Redis Enterprise Software Docker container, run the following
docker run
command in the terminal or command line for your operating system.
docker run -d --cap-add sys_resource --name RE -p 8443:8443 -p 9443:9443 -p 12000:12000 redislabs/redis
The example command runs the Docker container with Redis Enterprise Software on localhost
and opens the following ports:
-
Port 8443 for HTTPS connections
-
Port 9443 for REST API connections
-
Port 12000 configured Redis database port allowing client connections
You can publish other ports
with -p <host_port>:<container_port>
or use the --network host
option to open all ports to the host network.
Set up a cluster
-
In the web browser on the host machine, go to https://localhost:8443 to see the new Redis Enterprise Software Cluster Manager UI. The cluster generates self-signed TLS certificates to secure the connection. These self-signed certificates are unknown to the browser and must be accepted before you proceed.
To use the legacy UI for this quickstart instead, see the 6.4 version of the quickstarts.
Note:- If the server does not show the login screen, try again after a few minutes.
-
Select Create new cluster.
-
Enter an email and password for the administrator account, then select Next to proceed to cluster setup.
You can also use these credentials to connect to the REST API.
-
Enter your cluster license key if you have one. Otherwise, a trial version is installed.
-
In the Configuration section, enter a cluster FQDN such as
cluster.local
, then select Next.Warning:If the FQDN iscluster.local
, you cannot configure DNS. You cannot change the FQDN after cluster creation. -
On the node setup screen, select Create cluster to accept the defaults.
-
Select OK to acknowledge the replacement of the HTTPS TLS certificate on the node. If you receive a browser warning, you can proceed safely.
Create a database
-
On the Databases screen, select Quick database.
-
Enter 12000 for the Port.
If port 12000 is not available, enter any available port number between 10000 to 19999 or leave it blank to let the cluster assign a port number for you. You will use this port number to connect to the database.
-
Select Create to create your database.
When you see Database active appear on the database configuration screen, the database is activated and ready for you to use.
You now have a Redis database!
Connect to your database
After you create the Redis database, you can connect to it to begin storing data.
Use redis-cli inside Docker
Every installation of Redis Enterprise Software includes the command-line tool redis-cli
to interact with your Redis database. You can use redis-cli
to connect to your database from within the same Docker network.
Use docker exec
to start an interactive redis-cli
session in the running Redis Enterprise Software container:
$ docker exec -it redis-cli -h redis-12000.cluster.local -p 12000
127.0.0.1:12000> SET key1 123
OK
127.0.0.1:12000> GET key1
"123"
Connect from the host environment
The database you created uses port 12000
, which is also mapped from the Docker container back to the host environment. This lets you use any method you have available locally to connect to a Redis database. Use localhost
as the host
and 12000
as the port.
Test different topologies
When deploying Redis Enterprise Software using Docker for testing, several common topologies are available, according to your requirements:
-
Single-node cluster – For local development or functional testing
-
Multi-node cluster on a single host – For a small-scale deployment that is similar to production
-
Multi-node cluster with multiple hosts – For more predictable performance or high availability compared to single-host deployments
Single node
The simplest topology is to run a single-node Redis Enterprise Software cluster with a single container on a single host machine. You can use this topology for local development or functional testing.
Single-node clusters have limited functionality. For example, Redis Enterprise Software can't use replication or protect against failures if the cluster has only one node.
Multiple nodes on one host
You can create a multi-node Redis Enterprise Software cluster by deploying multiple containers to a single host machine. The resulting cluster is scale minimized but similar to production deployments.
However, this will also have several limitations. For example, you cannot map the same port on multiple containers on the same host.
Multiple nodes and hosts
You can create a multi-node Redis Enterprise Software cluster with multiple containers by deploying each container to a different host machine.
This topology minimizes interference between containers, allowing for the testing of more Redis Enterprise Software features.