| title | Heroku |
|---|---|
| category | Devops |
| layout | 2017/sheet |
| updated | 2017-10-11 |
| description | A one-page reference to common Heroku-CLI commands. |
| intro | [Heroku](https://heroku.com/) is a web hosting platform supporting many languages, and this guide is a reference to Heroku's [command-line interface](https://heroku.com/). |
heroku create sushigit push heroku masterThis will create an application named sushi. (docs)
heroku stack:set container -app <app>
heroku container:push web -app <app>
heroku container:release web -app <app>Containers can be deployed using the Heroku Container Registry. (docs)
heroku access # List
heroku access:add me@xy.com
heroku access:remove me@xy.comheroku apps:transfer new@owner.comheroku logs
heroku logs -t # --tail (stream)
heroku logs -s app # --source (only on app logs)heroku releases
heroku releases:info v25
heroku rollbackheroku addons:add heroku-postgresqlheroku addons:add pgbackups:auto-monthSee: Heroku PostgreSQL (devcenter.heroku.com)
heroku config # List
heroku config -s # List in shell formatheroku config:get KEYheroku config:set KEY=val
heroku config:set KEY1=val KEY2=val ...heroku config:unset KEY1heroku apps # list
heroku apps:create [NAME]
heroku apps:destroy --app APP
heroku apps:info
heroku apps:open # open in browser
heroku apps:rename NEWNAMEheroku maintenance:onheroku maintenance:offheroku ps # list
heroku ps:scale web=1 # spawn more dynosheroku restartheroku run bash
heroku run console # Rails console
heroku run rake assets:precompileheroku domains:add example.com
heroku domains:add www.example.comheroku domains:clear
heroku domains:remove example.comSee: Custom domains (devcenter.heroku.com)
heroku addons:add wildcard_domains*.yourdomain.com => heroku.comCreate an .htaccess file in the webroot:
AuthUserFile /app/www/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-userCreate a .htpasswd file:
$ htpasswd -c .htpasswd [username]See: gist.github.com