Creating Apps from the CLI
Last Updated: 03 July 2012
cli create
The app is the fundamental unit of organization on Heroku. Users can create an unlimited number of apps; each of which can provision their own add-ons.
Creating a Named App
After creating an app, you will probably want to git push to deploy and add collaborators so that others can deploy changes as well.
To create a new app named “myapp”, install the Heroku Toolbelt and run the following command:
$ heroku apps:create myapp
Creating myapp... done, stack is cedar
myapp.herokuapp.com/ | git@heroku.com:myapp.git
The command’s output shows that the app will be available at
myapp.heroku.com. The second URL, git@heroku.com:high-sunrise-58.git, is the remote git repository URL; by default, the heroku create command automatically adds a git remote named “heroku” pointing at this URL.
To create an app on the Bamboo stack, use the --stack parameter:
$ heroku apps:create myapp --stack bamboo
Creating myapp... done, stack is bamboo-mri-1.9.2
myapp.heroku.com/ | git@heroku.com:myapp.git
Creating an App Without a Name
The app name argument (“myapp”) is optional. If no app name is specified, a random name will be generated.
$ heroku apps:create
Created
mystic-wind-83.heroku.com/ | git@heroku.com:mystic-wind-83.git
Since Heroku app names are in a global namespace, you can expect that common names, like “blog” or “wiki”, will already be taken. It’s often easier to start with a default name and rename the app later.
Welcome Page
Once your new app is created, before any code has been deployed, Heroku will display a generic welcome message to its visitors. This page is served with HTTP status code 502 to indicate that the app is not yet running.