Strapi 4 on heruku

System Information
  • Strapi Version: 4.00
  • Operating System: Windows 10
  • Database: mysql
  • Node Version: v14.18.2
  • NPM Version: 6.14.15
  • Yarn Version: 1.22.17

I have install Strapi 4 on localhost by --quickstart flag. I have deployed it on Heroku by following this guide

But it seems Strapi runs by local database not ./config/env/production/database.js
I have environment variable NODE_ENV=production in Heroku.

Have you set enviromental variables on heroku for

4. Create your Heroku database config file for production

Yes, I did

What variables did you set in heroku if I can ask ?

This are the config variable


You need the DATABASE_URL

DATABASE_HOST and DATABASE_URL aren’t same ? What should the value of DATABASE_URL ?

DATABASE_URL is the postgres database or addon that should be set if you setup a database in heroku.
If you have added a postgres database to heroku it should be done by itself

1 Like

DATABASE_URL is a combination of the protocol + user + password @ host + port / dbname

Usually looks something like postgres://username:password@host:port/dbname?someExtraParams


Thank you for your time guys. Actually I was using AWS RDS for database and I forgot to create a database there. Everything was fine in config variable