Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Troubleshooting Node.js Apps
      • Working with Node.js
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Vector Database
    • Working with AI
    • Heroku Inference
      • AI Models
      • Inference Essentials
      • Inference API
      • Quick Start Guides
    • Model Context Protocol
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Add-ons
  • All Add-ons
  • openredis
openredis

This add-on is operated by Amakawa Pte. Ltd.

Dependable Redis Hosting.

openredis

Last updated June 24, 2020

Table of Contents

  • Provisioning the add-on
  • Local setup
  • Using Redis from Ruby
  • Using Redis from Python
  • Using Redis from Node.js
  • Using Redis from PHP
  • Using Redis from Java
  • Troubleshooting
  • Migrating between plans
  • Removing the add-on
  • Support
  • Additional resources

openredis is an add-on that provides access to a Redis database. Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. More information can be found at redis.io.

openredis is accessible via an API and has supported client libraries for C, C#, C++, Clojure, Dart, Erlang, Fancy, Go, Haskell, Io, Java, Lua, Node.js, Objective C, Perl, PHP, Python, Ruby, Scala, Smalltalk and Tcl.

This is how your dashboard will look like once the add-on is integrated:

openredis dashboard

Provisioning the add-on

openredis can be attached to a Heroku application via the CLI:

A list of all plans available can be found here.

$ heroku addons:create openredis
-----> Adding openredis to sharp-mountain-4005... done, v18 (micro)

Once openredis has been added an OPENREDIS_URL setting will be available in the app configuration and will contain the canonical URL used to access the newly provisioned Redis instance. This can be confirmed using the heroku config command.

$ heroku config | grep OPENREDIS_URL
OPENREDIS_URL: redis://:password@host:port

After installing openredis the application should be configured to fully integrate with the add-on.

You can open your openredis dashboard and view the current memory usage of your instance by using the heroku addons:open command.

$ heroku addons:open openredis

Local setup

Environment setup

It’s important to note that access to your database is restricted to the AWS cloud.

Using Redis from Ruby

Using Redis from Ruby is very straightforward. Start by installing the Redis client:

$ gem install redis

Now, create a client and connect it to Redis:

$redis = Redis.connect :url => ENV["OPENREDIS_URL"]

Setup for Sinatra

require "redis"

class MyApp < Sinatra::Base
  configure do
    $redis = Redis.connect :url => ENV["OPENREDIS_URL"]
  end
end

Setup for Rails 3.x

Ruby on Rails applications will need to add the following entry into their Gemfile specifying the openredis client library.

gem "redis"

Update application dependencies with bundler.

$ bundle install

You can connect to Redis by using the OPENREDIS_URL:

$redis = Redis.connect :url => ENV["OPENREDIS_URL"]

Using Redis from Python

Install redis-py:

$ pip install redis

Then connect to Redis:

import os
import redis

REDIS_URL = os.environ['OPENREDIS_URL']

client = redis.from_url(REDIS_URL)

Using Redis from Node.js

Install node_redis:

$ npm install redis

Then use the following snippet to connect to Redis:

var url   = require("url").parse(process.env.OPENREDIS_URL);
var redis = require("redis").createClient(url.port, url.hostname);

redis.auth(url.auth.split(":")[1]);

Using Redis from PHP

Install Predis:

Then use the following snippet to connect to Redis:

$redis = new Predis\Client(getenv('OPENREDIS_URL'));
$redis->set('foo', 'bar');
$value = $redis->get('foo');

Using Redis from Java

Install Jedis by following the author’s instructions.

Then use the following snippet to connect to Redis:

Jedis jedis = new Jedis(System.getenv("OPENREDIS_URL"));

Development environment

When developing locally it is best to turn off the integration with openredis to minimize dependencies on remote services. You can use a local Redis server, and point OPENREDIS_URL to localhost and the appropriate port.

For example:

ENV["OPENREDIS_URL"] = "redis://localhost:6379"

$redis = Redis.connect(:url => ENV["OPENREDIS_URL"])

Troubleshooting

Make sure you can connect with redis-cli. If that works, check you are getting the credentials right in your application. For support questions, you can find us at #openredis on Freenode, mention @openredis on Twitter, or simply email us at info@openredis.com.

Migrating between plans

Application owners should carefully manage the migration timing to ensure proper application function during the migration process.

Upgrading an instance is easy and incurs no downtime. In order to upgrade your instance, simply execute:

$ heroku addons:upgrade openredis:small
-----> Upgrading openredis:small to sharp-mountain-4005... done, v18 ($35/mo)
       Your plan has been updated to: openredis:small

After that, a new instance, with a new URL will be provisioned. Your OPENREDIS_URL will also be updated automatically and your application will be restarted gradually.

If you’re not using the OPENREDIS_URL variable directly, your application will not get the changes. Please update your app first to use OPENREDIS_URL before upgrading, or make sure you change any custom REDIS_URL you are using to the new OPENREDIS_URL value.

Removing the add-on

openredis can be removed via the CLI.

This will destroy all associated data and cannot be undone!

$ heroku addons:destroy openredis
-----> Removing openredis from sharp-mountain-4005... done, v20 (micro)

Before removing openredis a data export can be performed by setting up a local instance of redis-server as a follower of the openredis instance.

Support

All openredis support and runtime issues should be submitted to one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at info@openredis.com.

Additional resources

Additional resources are available at:

  • openredis
  • Redis.io

Keep reading

  • All Add-ons

Feedback

Log in to submit feedback.

Zara 4 Papertrail

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices