Redis is a powerful in-memory database that is well-suited for many Dash
applications. In particular, you can use Redis to:
While Redis is an in-memory database, Dash Enterprise regularly
backs up its data to the underlying server. So, it’s safe for production
usage. Dash Enterprise can dynamically spin up and manage secure
instances of Redis for your application.
In Plotly Enterprise 2.5.0, Redis Databases are always enabled.
For previous versions, navigate to Plotly On-Premises Server Settings
https://<your.plotly.domain>:8800/settings), then under Special Options
& Customizations select Enable Dash Customizations and Enable Redis
Databases for Dash Apps.
You can create one Redis instance that is used by multiple apps or you
can create a unique Redis Database for each individual app.
To start, we recommend creating a unique Redis Database for each
Dash App. It will be easier for you to ensure that one application doesn’t
override the data from a separate application.
In Plotly Enterprise 2.5.0 it is possible to create and link a Redis
Database to your Dash App using the Dash Enterprise UI.
Here, you have two options:
1. Create a database before initializing an app.
2. Create and link a database after an app has been initialized.
If you haven’t initialized an app yet, select Databases situated in the
top navigation menu. Next, select Create Database, then in the
‘Create Database’ modal, add the name of your database. We recommend using
a convention like using the name of your application and adding
to the end, e.g.
Once your Redis Database has been created, you’ll notice that it is
added to your list of databases.
Next, navigate to Apps and create a new app (for more info see
in the ‘Create App’ modal you have the option of linking a database.
Here, use the dropdown to select the database that you created previously
(see image below).
In the Dash Enterprise UI, select the app then navigate
to the settings page. In Databases, use the dropdown to select
create and link database then Add.
While it is now possible to create and link Redis Databases via the
Dash Enterprise UI, it is still possible to create and link a Redis
database via the command line (using ssh):
In the commands above, replace:
YOUR_DASH_SERVER with the name of your Dash server
(same as when you run
git remote add)
SERVICE-NAME with the name you want for your Redis service
APP-NAME with the name of your app (as specified in the
Dash App Manager).
You can reference your Redis Database with the
To get started, see the Redis documentation
to download Redis and set up a local instance.
By referencing Redis in our code, we’ll need to add the variable to our
local environment as well. One easy way to do this is to define the
variable on-the-fly when you run
Installing Redis from source on windows can be tricky. If you have the
“Windows Subsystem for Linux”, we recommend using that and installing
the Redis in that linux environment. Otherwise, we recommend installing
these 64-bit binary releases of Redis.