DEV Community

Bishal
Bishal

Posted on

6

Learning to deploy Spring boot Web Application to On Render(free tier)

After you make a spring boot web app using spring data jpa, thymeleaf, the next challenge comes when you want to deploy that app to show your colleagues or college friends.

There are very few free hosting services that allow you to deploy web apps.

I found one with the name of On render, which gave a free plan to host web services.

Image description

Even after I found the platform, there was still a challenge, how do I deploy the spring boot app? They have very good services for nodejs and others.

The only solution to that was to deploy using Docker.

For that, I had to make a docker file using the name "Dockerfile" without any extension, in the root directory of the project.

Image description

Finding the maven version that was required for the OpenJDK 19 was a headache.

Image description

after I set the version in the docker file, compile version was not matching with it so I had to set it manually in the pom.xml, which did the trick.

But after that it was easy, just needed to set the command to make a maven clean build on the docker container, expose the port, and set the entry point.

Then you just need to push it to git repo and connect it in onrender by creating a new web service.

After completing the build in the server you can run your web app on the given domain from on render.

You can check(might need some time (2-3min) to open as it is free hosting)

my weather app -->https://weatherapp-g3yu.onrender.com

my todo app -->https://todoapp-shwf.onrender.com

If you need help you can get in touch I can help you out

merkasin272@gmail.com

Quickstart image

Django MongoDB Backend Quickstart! A Step-by-Step Tutorial

Get up and running with the new Django MongoDB Backend Python library! This tutorial covers creating a Django application, connecting it to MongoDB Atlas, performing CRUD operations, and configuring the Django admin for MongoDB.

Watch full video →

Top comments (0)

Quickstart image

Django MongoDB Backend Quickstart! A Step-by-Step Tutorial

Get up and running with the new Django MongoDB Backend Python library! This tutorial covers creating a Django application, connecting it to MongoDB Atlas, performing CRUD operations, and configuring the Django admin for MongoDB.

Watch full video →

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay