You can add an entry to the .env file for APP_KEYS instead of hardcoding in the server.js file. Worked for me. But you only need one key for the APP_URL per documentation.
Hey guys. I followed all your tips to have my Strapi deployed with Heroku. But each time I push a commit, all the content is lost. And I need to register my account, again and again, thereās no login page but only a sign-up one. Do I miss something? Does anyone have a solution?
After lots of readingā¦it would seem the docs just missed a key note regarding the setup of the Config Variables within Heroku. Strapi requires the variables that exist within the .env file on your localhost, and these obviously arenāt pushed to the repo due to .gitignore for security purposes.
Head into the settings on your Heroku app, and add these four variables from your local .env file to your Config Variables area with their values.
Thanks for the heads up everyone. There were some changes in a couple releases. I would recommend reading our releases for changes to deployment. Weāre also much better now at updating docs when changes like this happen. Appreciate all the people who stepped up to help out with solutions.
Iāve seen a couple things come up that I want to address.
Please donāt hard code your APP_KEYS to your server.js file. Thatās a potential security risk. If your Heroku deployment fails because of missing config please check the docs on how to generate and push some to your Heroku app.
Your local database and database on Heroku arenāt connected. So changes you make locally to content wonāt reflect in production, at the moment you would have to enter those yourself. We are working something to fix that, do share your interest for such a feature on the product board.
Iāve also updated the article to reflect the changes (might take a bit or changes to reflect but theyāll come). Take care!
hi, so how to update content? Seems like first i need to create collections using my superadmin account on localhost, add some data for testing environment. but then also need to copy paste all date into another strapi database (created for production), Production database shows new collections but no data entry. Is this the case? ā OK i just saw the post above and it answered by question
I am not following in regards to the SQlite/PostgresSQL issues. What do you mean we need to use PostgresSQL to successfully deploy strapi to heroku? I understand the default database is SQlite. Now you want us to use PostgresSQL instead. Does this process automatically configure the queries for PostgresSQL just like SQlite did? Or do we have to manually configure those queries in our Strapi repo? Because if so, then that is a HUGE red flag which will result us in migrating to a different headless CMS.