My app can't connect to Redis

If you get an error connecting to Redis, you might have forgotten to attach a Redis database to your app.

Written by Chris Oliver
Updated over a week ago
Getting an error from your app that says something like this?
NOAUTH Authentication required.
This means your application tried to connect to Redis without supplying a username & password.

Hatchbox configures unmanaged Redis with a username and password for additional security. This means you'll need to set your apps Redis URL to include the username and password for it to connect successfully.

Attach an Unmanaged Redis Database To Your App
First, make sure you have a server in your cluster with the Redis role.

On the Databases tab of your app, you can click the Redis button to attach a new Redis database to your app. This will set the REDIS_URL environment variable which includes the username and password to authenticate with your unmanaged Redis server.

That's it!

Attach a Managed Redis Database To Your App

For managed databases, you'll have a username and password assigned by your hosting provider. Simply set the REDIS_URL environment variable with the details from your hosting provider and you will be set.

Was this article helpful?