4 minutes read

Introduction

The lifecycle of a web application has several stages. At first, you decide what you want to do. Then you write the code of your program. And then comes the time to deploy your application to make it public. Although your laptop is great for development purposes, it's not enough to grant public access to your app. You need a platform, where you can launch it. In this topic, we'll observe how you can do it with Heroku.

Hyperskill is not affiliated with the Heroku platform and does not advertise the services on it, we provide this information only for educational purposes.

Heroku platform

Heroku logo

Heroku is a cloud platform supporting different programming languages to launch web applications. It supports such programming languages as:

  • Python
  • Java
  • Scala
  • JavaScript (Node.js)
  • Go

Heroku provides both free and business accounts. It means that you can use some Heroku services for free, but with limited capabilities, or switch to a paid account to explore more features and get guarantees from the platform.

The platform will ask you to add a credit card to verify your account, however, it will not charge you any fees if you stay on a free account. You can read more about pricing on the official site.

How it works

As with any other online service, you need to register to start using it. After successful registration, you can browse detailed tutorials and find one with the language you're using for the development.

We provide language-specific examples of deploying web applications in the following topics.

We assume that you stick to a free account and want to launch your fresh app on the Heroku platform. At this stage, you need to install the official Heroku CLI and have a git repository with the code of your program on your local computer. After you've finished these preparations, you can run several commands in your terminal, and Heroku starts a Dyno with your app:

$ heroku create
Creating app... done, ⬢ fierce-atoll-36151
https://fierce-atoll-36151.herokuapp.com/ # Public address of your app

$ git push heroku your-main-branch
building and deploying logs...

Dyno is a Linux container that runs on the Heroku platform. You can think of it as an isolated environment, where you launch your application.

That's all. Your application is ready and you can access it at the address given by the heroku create command.

Integration with other services

Of course, your perfect app not only needs the code in the git repository but also may use other resources as a database, file storage, or key-value store. All of them are also available on Heroku with limited capabilities for free:

You can read about each of them by yourself and explore many others on the page of available add-ons. You can install add-ons through the web interface or by running a command from a terminal:

$ heroku addons:create heroku-postgresql:hobby-dev

Choose the pricing plan that you need. In the example above, it's a free hobby-dev plan.

Now your application can use the launched service. To read more about suitable methods to configure your application, refer to the official documentation for your language.

Conclusion

In this topic, we've explored some features of the Heroku platform, such as:

  • Official guides and documentation
  • Commands to launch a web application on Heroku
  • Integration with other services on a platform

Now you are ready to start using Heroku by yourself, but we recommend you to look through the official tutorials to ease your experience with the platform.

17 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo