How to Deploy A Golang App to Heroku.

Requirements.

  1. Heroku Account
  2. Heroku CLI
  3. Golang v1.14 and above

Step 1.

$ brew tap heroku/brew && brew install heroku
$ heroku login

Step 2.

$ touch Procfile
$ echo “web: currency” > Procfile

Step 3.

$ go mod init github.com/heavykenny/currency

Step 4.

$ heroku config:set PORT=8080

Step 5.

$ git init
$ git add . && git commit -m "Deploying to Heroku"

Step 6.

$ heroku create go-currency
$ git push heroku master

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store