Set Heroku environment variable without restarting app Set Heroku environment variable without restarting app heroku heroku

Set Heroku environment variable without restarting app


According to this article it pretty explicitly states that

Whenever you set or remove a config var, your app will be restarted.

Personally I also wish there was a way to do what you're asking. On larger apps, a system-wide hard restart can be painful when you have many process types running. Many times I set environment variables that aren't crucial for the app to grab ahold of immediately, such as that involving future functionality, or settings that are OK having the old value but you want the new value to take effect in a rolling-restart fashion.


At the present, is not possible to avoid the app restart. But you can use the command heroku config:edit to edit your env at once or even paste a new env set, avoiding many restarts.

In according to the heroku config help:

(...)COMMANDS  config:edit   interactively edit config vars  config:get    display a single config value for an app  config:set    set one or more config vars  config:unset  unset one or more config vars

So you can run

heroku config:edit

Additionally, you might want to take a look on this issue (proposal):https://github.com/heroku/cli/issues/1570