r/SpringBoot • u/LouGarret76 • Feb 17 '24
Easiest way yo deploy a spring boot app in production
Hi everyone,
I am new to web development. This is my first commercial project.
I am working on a startup idea that requires a landing page, an email capture page and a basic thank you page. Later one, I might add a blog and a selling page.
I am familiar with java for past experience with javafx desktop app. My reading suggested that Spring boot is the most popular framework for my need. I have coded the web app and it is working on my computer.
I want to deploy it online at minimal cost. I started reading about deployment and I realised that it is a whole new area of knowledge.
Any idea how I can go with this? What are the most popular and easiest solution for startups?
Thanks
3
u/No-Possibility-6454 Feb 17 '24
Hey buddy I wanted to ask about using aws as a student. They say it has hidden charges and I will get billed suddenly(I want to use file upload service like s3 and deploy my spring boot docker image) can I do this in free without getting any charges. Also How can I make sure some one never spams my server so I dont cross free tier limits
(I am beginner in deployment , cloud Also new on reddit XD :)
3
u/SuspiciousElgamal Feb 17 '24
For java application I'd go with heroku. It's really intuitive and in a few minutes your application will be up and running
5
u/asdspartadsa Feb 17 '24
Absolutely easiest? Rent a server, copy your jar file on it, and run it. Otherwise, the other commenter's suggestion is more elegant.
2
u/ringofgerms Feb 17 '24
The easiest thing would be to use a cloud provider which offers a service where you more or less only need to upload a jar file (or docker image. but that's a tiny bit more complicated). For example Amazon has AWS Elastic Beanstalk, Microsoft has Azure App Service. I would take a look into those offerings and see if it fits your budget. Your requirements are pretty low so you can probably find a decent offer.
The Spring Boot documentation has some info here: https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment
2
u/WaferIndependent7601 Feb 17 '24
There should be services around where you can create anything you need. Spring boot is overkill here, so just buy what you need. Will be cheaper
2
u/jaktrik Feb 17 '24
I think you should explore Render they provide free hosting for hobby and have the option to deploy using Docker from your git repository.
Once you are moving to production you can use digital ocean or explore giant like AWS and Azure
1
0
2
Feb 17 '24
[removed] — view removed comment
1
u/LouGarret76 Feb 17 '24
I agree that most of the pages except from the contact form are static. I do need a database to collect the email and message from the contact form. That is what let me to spring boot in the first place.
1
u/rootException Feb 17 '24
My two cents - you can use Supabase as the database and something like SvelteKit to deploy to Vercel. Really dig it.
I've been a Java dev since the 90s and SK+Vercel+Supabase really impressed me.
18
u/g00glen00b Feb 17 '24
To be fair, if you only have a few static pages and a form (right now), then I would consider not using Spring Boot. In stead, you could create a few HTML pages (or use a static site generator, even though that's overkill at this point) and deploy them on a Content Delivery Network/CDN.
There are several CDN's out there that have a basic free plan, so you only pay for your domain name. Some of those come with basic serverless functions (like Cloudflare) or form handling (like Netlify), so you could even create the e-mail capture page with their free plan.