If you’re new to Redis Enterprise Cloud, this quick start helps you get up and running.

You’ll learn how to:

  1. Create a free subscription

  2. Create a database

  3. Connect to your database

If you already have a subscription, see Manage subscriptions and Manage databases.

Create a subscription

To create a new free subscription:

  1. Sign in to the Redis Cloud admin portal. (Create an account if you don’t already have one.)

  2. If this is the first time you’ve signed in, you have no active subscriptions and can select the Add subscription button.

    The Add subscriptions button appears when there are no other subscriptions.

    If you already have a subscription, select the New subscription button in the admin menu.

    The New subscriptions button in the admin console menu.

    (You can only have one free subscription.)

  3. When the New subscription page appears, select Fixed plans and then scroll to the cloud vendor options.

    Available subscription plan options.
  4. Choose a Cloud Provider and a Region.

    (You can ignore the High-Availability options for now; these are available in paid tiers only.)

    Available cloud vendor options.
  5. In the Fixed Size panel, locate the Dataset Size list and then choose 30MB.

    Free plans are a tier of Fixed plans; this provides an easy upgrade path when you need it.

    Create a free subscription.
  6. Enter a descriptive Subscription Name and then select the Create subscription.

    The Create subscription button is located below the subscription options.

Create a database

Now that you have a subscription, you need to create a database.

  1. If you aren’t already at the Subscription details screen, sign into the Redis Cloud admin console and select your subscription from the subscription list.

  2. Select the New Database button.

    Use the New database to create a database.
  3. In the General section, enter a descriptive Database Name.

    • You have 40 characters
    • You can use letters, numbers, or a hyphen
    • The name must start with a letter and end with either a letter or a number
    • Spaces are not allowed
    Create new database.
  4. For this exercise, leave the remaining options at their default values. (To learn about them, see Create a fixed subscription.)

  5. Select the Activate database button near the upper, right corner of the page.

  6. You’re taken to the Configuration tab for your new database.

    Configuration tab showing details of your new database.

    In the upper corner, an icon shows the current status of the database. If the icon shows an orange clock, this means your database is still being created and its status is pending.

    Pending status icon   Active status icon

    Once the database has been created, it becomes active and the status indicator switches to a teal circle containing a checkmark.

Admin console operations are asynchronous; they operate in the background. You can continue to use the admin console for other tasks, but pending resources aren’t available until they’re active.

When your new database becomes active, you’re ready to connect to it.

Connect to a database

At this point, you’re viewing the Configuration details for your new database.

To connect to your database, you need the following info:

  • The public endpoint for your database
  • The port number
  • The database password

These are displayed in the Configuration tab.

  • In the General section, the Public endpoint setting shows the URI for your database and the port number. Use the Copy button to copy these values to the Clipboard.

  • The Security section contains your Default user password. By default, this is masked. Select the eye icon to show or hide the password.

    The Security section of the Configuration tab of the database details page.

Once you have the connection details, you can connect in a variety of ways, including:

  • Using the redis-cli utility

  • Using a connection client for your preferred programming language

Here’s an example of each.

Use redis-cli (via Docker)

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.

Docker provides a convenient way to run redis-cli without the full installation experience.

When you run the redis Docker image, you can open a bash shell instance and run redis-cli from the container.

  1. To begin, pull the redis docker image and run it with default options:

    $ docker pull redis
    $ docker run -d --name redis1 redis
    $ docker exec -it redis1 bash
    
  2. This gives you a bash prompt running within your Docker image. From here, you can connect to your database:

    # redis-cli -h <endpoint> -p <port> -a <password>
    xxx:yyy> 
    

    Replace <endpoint>, <port>, and <password> with the details copied earlier from the View Database screen.

  3. You should now be connected to your database and can perform basic Redis commands:

    xxx:yyy> ping
    PONG
    xxx:yyy> set hello world
    OK
    xxx:yyy> get hello
    "world"
    

Use code (Python)

Different programming languages use different clients to interact with Redis databases.

Here’s how to connect to your database using the redis-py library for Python.

  1. If you don’t already have the client installed:

    sudo pip install redis
    
  2. The specific syntax varies according to the client:

    import redis
    r = redis.Redis(host='<endpoint>', port='<port>', 
                    password='<password>')
    r.set('hello', 'world')
    print(r.get('hello'))
    
  3. Now, run the code:

    $ python example_redis.py
    world
    

More info