October 1, 2025

FleetMS – Part 8 (Deploy SpringBoot With PostgreSQL Database to Heroku)

In this tutorial, you will learn how to deploy Spring Boot application together with it’s MySQL database to Heroku. Follow the steps provided.

 

Create an App in Heroku

Step 1 – Login in to Heroku (heroku.com) and create a new app.

Step 2 – Under the Deployment Method, choose GitHub as shown below:

Github deployment method in Heroku
Github deployment method in Heroku

 

Step 3 – Under the Resources section, find Heroku Postgres in the Add-ons section

Heroku Postgres in the Resources tab
Heroku Postgres in the Resources tab

 

Step 4 – The order form is displayed as shown below, and you have to submit it.

PostgreSQL Order form in Heroku
PostgreSQL Order form in Heroku

 

Step 5 – In the next page, select the dropdown next to Free and choose Create Dataclip

Step 6 – Click on Heroku Postgres. Then click on the Settings tab. Then click on View Credentials to display the PosgreSQL credentials as shown below:

PostgreSQL Credentials
PostgreSQL Credentials

 

Step 7 – You can now use these details to update your application.properties file

Step 8 – Open your User model (User.java) and add this @Table annotation to the class.

@Table(name = "\"User\"")

Step 9 – Push your changes to Github repository

Step 10 – Finally, go back to Heroku and follow the instruction to connect and deploy to Heroku

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments