Deploy Project on Heroku

Daniel Liu
2 min readJul 17, 2020

Overview

Heroku is a cloud platform that can be used to host backend and frontend applications. Heroku is free with add ons that will cost money. For the free version you can host up to 5 applications with limitations. Heroku can host applications written in Ruby, Node.js, Java, Python, Clojure, Scala, Go and PHP. There are a couple of ways to deploy your applications to heroku but we will be focused on using Git.

Heroku CLI

The first step is to create a heroku app. Assuming you have installed the heroku CLI you can run the command in the project repository

heroku login

This will reroute you to the heroku login page. After you log in can push your changes and run the command

git push heroku master

Heroku will then build and try to deploy the project. If there are in issues it will log it in the command line or you look at the logs in the heroku application overview.

Automatic Deploy

In the heroku application page you can go to the deploy tab and connect to the project in Github. Once you connect to your github account you can look for your project and heroku will build and deploy the project if there are any changes to the project. Alternatively you can manually deploy the project as well. At the bottom you can choose a branch from the project and deploy it.

Project Commands

For some projects you might need to run some commands before the application is up and running. For example, ruby projects with active record might need to initialize the database and possibly create some data. To run those commnd using the heroku cli you would use

heroku run /*command*/

Conclusion

Heroku uses Postgres, Redis and Kafka. Applications that uses a database would have to keep in mind to use postgres for their database when deploying to Heroku. To use Redis or Kafka you would have to upgrade your account by providing your credit card. Although you may not have to pay it would still require a credit card. Although there are some features that are unavailable without a credit card Heroku is easy to use to deploy simple applications quickly and easily.

--

--