Connect to a Redis Cloud database
| Redis Cloud |
|---|
After you create your database, you can connect to it using the public or private endpoint.
Get connection information
To connect to the database, you need the following information:
- The database endpoint
- Your database username and password
Database endpoints
The database endpoints are listed in the General section of the Configuration tab for your database.
Redis Cloud Pro and Redis Cloud Essentials databases have a public endpoint, which you can access from the public internet. Redis Cloud Pro databases also have a private endpoint. You can connect to the private endpoint from a private network. Before you can connect to the private endpoint, you must set up a private connectivity method, such as:
- VPC peering
- Google Cloud Private Service Connect (Google Cloud only)
- AWS Transit Gateway or AWS PrivateLink (AWS only)
Redis Cloud Pro users can block the public endpoint for their databases. For more information, see Block public endpoints.
Static and dynamic endpoints
Static endpoints on Redis Cloud start with redis-<port>.c<number> (or redis-<port>.internal.c<number> for the private endpoint). For example, a static endpoint might look like this:
redis-12345.c12345.us-east-1-mz.ec2.cloud.rlrcp.com
Dynamic endpoints on Redis Cloud always contain three words and a random number, and end in db.redis.io. For example, a dynamic endpoint might look like this:
horse-battery-staple-12345.db.redis.io
You can see the Dynamic endpoints for databases with both static and dynamic endpoints by expanding the Dynamic endpoints section in the General section of the Configuration tab.
You can redirect the dynamic endpoints to a different database at any time, but you cannot redirect the static endpoints. We recommend using the dynamic endpoints for your application so that you can migrate your database endpoints to a different database in the future without any code changes. See Redirect dynamic endpoints for more information.
Database username and password
By default, your database is protected by a Default user with the username default and a masked Default user password. You can see the default user password in the Security section of the Configuration details for your database. Select the eye icon to show or hide the password.
If you've turned on Role-based access control for your database and turned off the default User, use the username and password for your data access role.
Connect to your database with connection wizard
Select Connect to open the connection wizard.
The connection wizard provides the following database connection methods:
-
redis-cliutility -
Redis client for your preferred programming language
Redis Insight
Redis Insight is a free Redis GUI that lets you visualize your Redis data and learn more about Redis.
You can connect to your database with Redis Insight in two ways:
-
Download and Install Redis Insight on Windows, macOS, and Linux.
Open in your browser
If Redis Insight on Redis Cloud is available for your database, select Launch Redis Insight web from the connection wizard to open it.
You can also select Launch from the database page under View and manage data with Redis Insight to open Redis Insight in your browser.
Redis Insight will open in a new tab.
This browser-based version of Redis Insight has a subset of the features of Redis Insight. For more information, see Open with Redis Insight on Redis Cloud.
Install and open on your computer
-
If you haven't downloaded Redis Insight, select Download under Redis Insight in the Connection wizard to download it.
-
Once installed, select Open with Redis Insight.
-
A pop-up asks if you wish to open the link with Redis Insight. Select Open Redis Insight to connect to your database with Redis Insight.
If you get an error when connecting with Redis Insight, manually connect to your database from Redis Insight.
You can use Redis Insight to view your data, run Redis commands, and analyze database performance. See the Redis Insight docs for more info.
Redis client
A Redis client is a software library or tool that enables applications to interact with a Redis server. Each client has its own syntax and installation process. For help with a specific client, see the client's documentation.
The connection wizard provides code snippets to connect to your database with the following programming languages:
- .NET using StackExchange.Redis/NRedisStack
- node.js using node-redis
- Python using redis-py
- Java using Jedis and Lettuce
- Go using go-redis
- PHP using Predis
If the username and password are not already filled in, replace <username> and <password> with your username and password.
See Clients to learn how to connect with the official Redis clients.
redis-cli
The redis-cli utility is installed when you install Redis. It provides a command-line interface that lets you work with your database using core Redis commands.
To run redis-cli, install Redis on your machine. After it's installed, copy the redis-cli command under Redis CLI in the connection wizard and enter it into your terminal. If the username and password are not already filled in, replace <username> and <password> with your username and password.
See Redis CLI to learn how to use redis-cli.