7 A one-page reference to common Heroku-CLI commands.
9 [Heroku](http://heroku.com/) is a web hosting platform supporting many languages, and this guide is a reference to Heroku's [command-line interface](http://heroku.com/).
12 ### `create` - Create an app
19 git push heroku master
22 This will create an application named `sushi`. ([docs](https://devcenter.heroku.com/articles/creating-apps))
24 ### `container` - Docker containers
27 heroku stack:set container -app <app>
28 heroku container:push web -app <app>
29 heroku container:release web -app <app>
32 Containers can be deployed using the Heroku Container Registry. ([docs](https://devcenter.heroku.com/articles/container-registry-and-runtime))
34 ### `access` - Collaboration
36 #### Manage collaborators
40 heroku access:add me@xy.com
41 heroku access:remove me@xy.com
44 #### Transfer to another owner
47 heroku apps:transfer new@owner.com
50 ### `logs` - Show logs
54 heroku logs -t # --tail (stream)
55 heroku logs -s app # --source (only on app logs)
62 heroku releases:info v25
71 heroku addons:add heroku-postgresql
77 heroku addons:add pgbackups:auto-month
80 See: [Heroku PostgreSQL](https://devcenter.heroku.com/articles/heroku-postgresql) _(devcenter.heroku.com)_
82 ### `config` - Environment var configuration
88 heroku config -s # List in shell format
100 heroku config:set KEY=val
101 heroku config:set KEY1=val KEY2=val ...
105 heroku config:unset KEY1
108 ### `apps` - Applications
112 heroku apps:create [NAME]
113 heroku apps:destroy --app APP
115 heroku apps:open # open in browser
116 heroku apps:rename NEWNAME
122 heroku maintenance:on
126 heroku maintenance:off
132 ### `ps` - Managing processes
136 heroku ps:scale web=1 # spawn more dynos
145 ### `run` - Running tasks
149 heroku run console # Rails console
150 heroku run rake assets:precompile
155 ### `domains` - Custom domains
160 heroku domains:add example.com
161 heroku domains:add www.example.com
168 heroku domains:remove example.com
171 See: [Custom domains](https://devcenter.heroku.com/articles/custom-domains) _(devcenter.heroku.com)_
176 heroku addons:add wildcard_domains
180 *.yourdomain.com => heroku.com
185 ### htpasswd (for PHP apps)
187 Create an `.htaccess` file in the webroot:
190 AuthUserFile /app/www/.htpasswd
192 AuthName "Restricted Access"
196 Create a `.htpasswd` file:
199 $ htpasswd -c .htpasswd [username]
202 See: [gist.github.com](https://gist.github.com/3316425)
206 * <https://addons.heroku.com/>
207 * <https://devcenter.heroku.com/>