Renaming Apps from the CLI
Last updated March 13, 2023
Table of Contents
You can rename an app at any time with the heroku apps:rename
command. For example,
to rename an app named “oldname” to “newname”, run the heroku apps:rename
command from your app’s Git
repository:
$ heroku apps:rename newname
Renaming oldname to newname... done
http://newname.herokuapp.com/ | git@herokuapp.com:newname.git
Git remote heroku updated
You can also rename an app from outside of its associated Git repository by including the --app
option in the command:
$ heroku apps:rename newname --app oldname
http://newname.herokuapp.com/ | git@herokuapp.com:newname.git
When you rename an app, it immediately becomes available at the new corresponding herokuapp.com
subdomain (newname.herokuapp.com
) and unavailable at the old one
(oldname.herokuapp.com
).
If you have custom domains configured that use your app’s old subdomain (for example, a CNAME record that points to oldname.herokuapp.com
), then you need to update the configuration for those custom domains as well.
Updating Git remotes
If you use the Heroku CLI to rename an app from inside its associated Git repository, your local Heroku remote is updated automatically. However, other instances of the repository must update the remote’s details manually.
You can run the following commands to update the remote’s details in other repository instances:
$ git remote rm heroku
$ heroku git:remote -a newname
Replace newname
with the new name of the app, as specified in the rename
command.