Using an existing Heroku database

Let’s say you have an existing Heroku Postgres database with data in it, and you’d like add GraphQL on it.


In case you’re exposing an existing database (esp. if it is production), please configure an admin secret key for the console and the GraphQL endpoint.

Step 1: Deploy Hasura on Heroku

Deploy Hasura on Heroku by clicking on this button:


Follow the Heroku instructions to deploy, check if the Hasura console loads up when you click on View app and then head to the Manage App screen on your Heroku dashboard.

This will deploy Hasura with a free Postgres add-on automatically provisioned.

Step 2: Remove the created Postgres add-on in the app

Head to your Heroku dashboard and delete the Postgres add-on created in the previous step:

Delete the Postgres add-on

Step 3: Configure environment variables

Now configure the DATABASE_URL with your existing Heroku Postgres database URL and a HASURA_GRAPHQL_ADMIN_SECRET if you want to secure your endpoint.

Configure environment variables


The Hasura GraphQL engine needs access permissions to your Postgres database as described in Postgres permissions.

Step 4: Track tables and relationships

Wait for the GraphQL engine to restart and then see Setting up a GraphQL schema using an existing database to enable GraphQL over the database.