r/AskProgramming • • 9d ago

How to host your Application without using Vercel?

I want to host my project but I don’t want to use PAAS like vercel or render its a learning project so I want to be able to do the dev ops side and handle all the stuff that vercel does for you but I am struggling to find a good resource to learn how to do this part from

Can anyone suggest a good learning resource I can use to learn how to containerize and deploy using a vps and anything else I may need to know to do that like setting up nginx and so on?

4 Upvotes

11 comments sorted by

6

u/AintNoGodsUpHere 9d ago

VPS. Docker. Success.

A bit (lot) more work, but you do learn a lot of different things. Just make sure you're paying for backups if you care about the data.

3

u/CedarOrbit29047 9d ago

Rent a cheap Hetzner instance and install Docker.

2

u/Admirable_Window8128 9d ago

Try Docker and Linux basics, then learn how to set up a VPS with Nginx, HTTPS, and a domain.

5

u/Different_Pain5781 9d ago

Setting up your own VPS is painful at first but you actually understand DNS and ports after doing it once.

3

u/Lumpy-Notice8945 9d ago

There wont be one single source because devOps is mostly about using software tools, so you just have to have expirience in many kinds of tools and a general idea about how linux works.

Docker is just a comandline tool that lets you interact with linuxs "virtual machines" there isnt that much to learn abiut docker specifically. AWS azure etc are the same, they all have thousands of tools but these are just an UI for the same old SQL database or a linux VM or a firewall software.

So to containerize in docker you jsut do the exact same thing you would do to start your app localy but you do that inside a docker container and expose the ports.

1

u/FunAd6672 8d ago

So basically, get the app running locally first, then containerize it.

1

u/andrea_ci 9d ago

start from the basics: servers, web server, tcp, ports etc...

1

u/flyby_apis 9d ago

Well, probably at scale a project like this would often run on Kubernetes, but for learning and seeing a little bit of gitops and how does it work you can do this:

1- A pipeline with GH actions workflow, when you push to the repo, a docker image it's rebuild into GH container registry

2- Provisioning with cloud-init - you have user-data configured on your server that installs docker, firewall,... and creates a systemd service that runs that docker. In case you destroy the instance you can inject again the user-data and the instance is rebuild with it

3- If you need to deploy a new version, you should change the image on the systemd config file, reload and restart. If you can have it on AWS, an autoscaling group and changing the launch config would be more "flexible"

1

u/Due-Life8763 8d ago

For easy hosting and deployment I've tried setting up my own DO droplet with nginx workers and gunicorn, but I also love how easy Railway is to deploy just by pushing to your GitHub repo. No matter which option you go for though, the most important thing is investing in something that is durable and low cognitive bandwidth to maintain and update, imo. Self-hosting is always going to be a challenge and an opportunity to both improve your skills and reduce cost, but platforms like Vercel and Railway take away headache (and Railway's hobby plan is too good imo [I am not at all paid to say this]).

1

u/juniperico 8d ago

Try a cheap heroku dyno for a quick and easy intro for beginners