> Markdown version of [Heroku](https://vaadin.com/docs/next/flow/production/cloud-providers/heroku). Section index: [llms.txt](https://vaadin.com/docs/next/flow/llms.txt)

# Deploying a Vaadin Application to Heroku

This tutorial shows you how to deploy a Vaadin application to the Heroku cloud platform. Heroku has a free-tier offering that can be used for non-commercial applications. You can find details of their free offerings on the [Heroku website](https://www.heroku.com/).

> **Note: Heroku account required**
>
> To complete this tutorial, you need a Heroku account. You can sign up at <https://signup.heroku.com/>.

## <a id="step-1-install-and-set-up-the-heroku-cli"></a>Step 1: Install and Set Up the Heroku CLI

To begin, download and install the [Heroku CLI](https://devcenter.heroku.com/articles/flow/heroku-cli/).

When it has been installed, log in to your account from a terminal window using the following command:

```terminal
heroku login
```

Next, install Heroku’s Java plugin by issuing the following command:

```terminal
heroku plugins:install java
```

## <a id="step-2-download-a-starter-app"></a>Step 2: Download a Starter App

Download a minimal Vaadin project and unpack the downloaded zip into a folder on your computer.

[Download project](https://start.vaadin.com/dl)

## <a id="step-3-add-java-11-support"></a>Step 3: Add Java 11 Support

The starter project is on Java 11, whereas, by default, Heroku expects Java 8 projects. To ensure that Heroku runs a Java 11 environment, create a `system.properties` file under the project root directory with the following content:

`system.properties`

```
java.runtime.version=11
```

If this doesn’t work, you can specify the Java version as a parameter when you run the `deploy` command (see [Step 6: Deploy the Application](#step-6-deploy-the-application)):

```terminal
heroku deploy:jar --jdk=11 ...
```

## <a id="step-4-create-a-production-build"></a>Step 4: Create a Production Build

Open the project directory from a terminal window, and enter the following command to generate a `JAR` file of your application:

```terminal
mvn package
```

## <a id="step-5-initialize-a-heroku-application"></a>Step 5: Initialize a Heroku Application

From a terminal window, enter the following command to initialize a Heroku application:

```terminal
heroku create --no-remote
```

This command creates an application with a randomly generated name. Take a note of the generated application name that appears in the logs. For example, in the following screenshot, the generated application name is `blooming-beach-34155`.

[Image: Heroku CLI log]

## <a id="step-6-deploy-the-application"></a>Step 6: Deploy the Application

To deploy the application, run the following command from a terminal in your project’s root directory (replacing 'blooming-beach-34155' in the command with your application name, noted in the previous step):

```terminal
heroku deploy:jar target/myapp-1.0-SNAPSHOT.jar --app blooming-beach-34155
```

When the deployment has completed, the application URL is displayed in the logs.
