This add-on is operated by Stovepipe Studios

Production-quality Redis servers with superior support and analytics


Last Updated: 07 May 2015

Table of Contents

Creating a RedisGreen server

You can use the Heroku Toolbelt to add RedisGreen to your app:

% heroku addons:create redisgreen:basic
Adding redisgreen:basic to fancy-slinky-2001... done, v24 ($169/mo)
Basic Redis server successfully provisioned.
Use `heroku addons:docs redisgreen:basic` to view documentation

Once your RedisGreen server has been built, your app will have access to a “REDISGREEN_URL” environment variable that contains the Redis URI for your Redis server. You can also view the RedisGreen environment variable using the Heroku Toolbelt:

% heroku config | grep REDISGREEN

Using Redis with Ruby

Add the redis and hiredis gems to your Gemfile and run bundle install to install them:

gem 'redis'
gem 'hiredis'

For Rails apps, create an initializer at config/initializers/redis.rb to create a global Redis connection when your app loads:

$redis = ENV["REDISGREEN_URL"], driver: :hiredis)

For all non-Rails projects, you can use the above code wherever it makes the most sense. For instance, in Sinatra apps, you would put the above code in the “configure” block:

require 'redis'

configure :production do
  uri = URI.parse(ENV["REDISGREEN_URL"])
  $redis = ENV["REDISGREEN_URL"], driver: :hiredis)

configure :development, :test do
  $redis =

Using Redis with Python

Install the “redis” package:

% pip install redis

And create your Redis connection with:

import os, redis

redis = redis.from_url(os.getenv("REDISGREEN_URL"))

To use Redis as a cache backend for your Django app with django-redis-cache:

from urlparse import urlparse

redisgreen = urlparse(os.getenv("REDISGREEN_URL"))

    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': '%s:%i' % (redisgreen.hostname, redisgreen.port),
        'OPTIONS': {
            'DB': 1,
            'PASSWORD': redisgreen.password,
            'PARSER_CLASS': 'redis.connection.HiredisParser'

Using Redis with Node.js

Install the “redis” package using npm:

% npm install redis

However, we strongly recommend using “redis” with the “hiredis” driver:

% npm install hiredis redis

And then run npm install to install the package locally. You can then create your Redis connection with:

var redis = require("redis");

if (process.env.REDISGREEN_URL) {
  var redisgreen = require("url").parse(process.env.REDISGREEN_URL);
  var client = redis.createClient(redisgreen.port, redisgreen.hostname);
} else {
  var client = redis.createClient();

Using Redis with PHP

We recommend the predis library. The “How to use Predis” section of their README has instructions for installing and using Predis.

When initializing your client connection, make sure you use the REDISGREEN_URL environment variable:

$client = new Predis\Client(getenv('REDISGREEN_URL'));

RedisGreen dashboard

The RedisGreen dashboard has a wide array of graphs, alerts, diagnostic information, and other features that make analyzing the health and performance of your server easy. You can access the RedisGreen dashboard through your app’s Heroku page or through the Heroku Toolbelt:

% heroku addons:open redisgreen

Removing RedisGreen

RedisGreen can be removed from your app via the Heroku Toolbelt:

After you remove RedisGreen from your app, the Redis server will be taken down and deleted. We recommend that you download the most recent backup from the dashboard before removing RedisGreen.
% heroku addons:destroy redisgreen:basic

 !    WARNING: Destructive Action
 !    This command will affect the app: fancy-slinky-2001
 !    To proceed, type "fancy-slinky-2001" or re-run this command with --confirm fancy-slinky-2001

> fancy-slinky-2001
Removing redisgreen:basic from fancy-slinky-2001... done, v25 ($169/mo)

Additional Support

Use the “Support” button in the RedisGreen dashboard or email us at to get help with any aspect of your RedisGreen server, including custom configurations.