Skip to content

Instantly share code, notes, and snippets.

@markkcc
Last active May 20, 2020 02:57
Show Gist options
  • Save markkcc/23987b5443369aca8574cbe29e7265a3 to your computer and use it in GitHub Desktop.
Save markkcc/23987b5443369aca8574cbe29e7265a3 to your computer and use it in GitHub Desktop.
Heroku CLI Cheatsheet

Installing and setting up Heroku CLI

Tested on Ubuntu 20.04 LTS

sudo snap install --classic heroku
heroku login

Creating a Heroku app for your git repo

heroku apps:create desired-heroku-appname

Postgres

heroku pg:info -a herokuappname
heroku pg:psql -a herokuappname

Custom domain

You need to be verified i.e. have a credit card on file

heroku domains:add your.domain.name -a herokuappname

Get logs

heroku logs -a herokuappname

Get a shell

heroku ps:exec -a herokuappname

Buildpacks

List installed buildpacks, in execution order, for your app. Default buildpack (e.g. ruby) should run last.

heroku buildpacks -a herokuappname

Add/remove a buildpack in queue slot 1 (starts first)

heroku buildpacks:add --index 1 http://github.com/path_to/buildpack -a herokuappname
heroku buildpacks:remove --index 1 -a herokuappname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment