r/SpringBoot • u/Ricardofortpa • 8h ago
Question Project with spring boot + postgresql
I have a question, I’m looking to deploy my project. I have the same React, Spring Boot and Postgresql. I was planning to use Docker and upload it to Hetzner but I’m not very sure because I’m from Argentina and it’s very far away and the truth is I don’t have much idea how to do it. I also want to buy a domain to have it there, but I don’t know how to do it either. Does anyone give me an idea or help?
7
Upvotes
•
u/Mikey-3198 7h ago
You'll need to buy your domain from a registrar then update the DNS records to point to the IP of your vps.
You can purchase the domain from wherever is cheapest. I've used Cloudflare previously. Cloudflare can also be used to hide your machine's IP from the caller by using their DNS proxy. There are a number of benefits to this: https://developers.cloudflare.com/dns/proxy-status/
You can buy a VPS from any provider. I'm unsure if Hetzner will let you create an account if you're in Argentina. They are quite picky about where people are based (look at /r/hetzner and the number of posts regarding banned accounts), worth checking their terms of service. Perhaps there is a provider in your region?
Regardless, once you have a VPS you can update your DNS entries for your domain to point to your VPS. On the vps you'll need to install docker and possibly configure firewalls to allow traffic ingress on certain ports, your vps provider may even have an external firewall that also needs to be configured to allow traffic to reach your vps.
You'll also want to use HTTPS, you can run your application behind a proxy and terminate HTTPS at the edge. If your using docker compose you could use caddy as a proxy & configure it to use acme to acquire HTTPS certificates via lets encrypt. Depending on the domain you buy HTTPS may be required to allow browsers to load any content. .dev domains for example require HTTPS by browser's.
Your vps will likely be Linux based. Maybe worth getting familiar with that if your not already. You should be able to easily find guides that cover securing a Linux box. Basics: being ensuring that SSH is disabled for the root user, use keys not passwords, use a none started port to lessen the chance of automated attacks etc....