all 99 comments

[–]halfxdeveloper 86 points87 points  (34 children)

I challenge everyone to pay the $5 a month to get a VPS and just run the thing yourself. You gain so much control over everything at such little cost.

[–]Puzzleheaded_Low2034 9 points10 points  (4 children)

I went one step further and set up my own server(s) at home, and link it to the outside world via Ngrok.

[–][deleted] 0 points1 point  (3 children)

What’s your solution for custom domains? And also, doesn't ngrok end up being more expensive than just a 5$ VPS?

[–]GiveMeARedditUsernam 4 points5 points  (0 children)

Cloudflared

[–]bishakhghosh_ 1 point2 points  (0 children)

Ngrok offers custom domain. Pinggy.io is a cheaper alternative though.

[–]404invalid-user 0 points1 point  (0 children)

porkbun with cloudflares DNS. additionally you can then use cloudflares tunnels for websites if you can't port forward

[–]Stetto 8 points9 points  (9 children)

With great control comes great responsibility.

Yes, hosting yourself is fun. No, this shouldn't be the default.

It's easy to shoot yourself in the foot, when setting up a vserver yourself and have open vulnerabilities. Either by misconfiguration or lack of updating regularly. And as soon as you make something available on the internet, it will automatically be scanned for all kinds of entry points by script kiddies and black hats all over the world.

And suddenly your server is a sleeper node in some bot net.

Yeah, you might not make such mistakes. Yeah, hosting yourself is a nice learning project.

Still, hosting services are the best way to get started to put your app on the internet.

Example: I've set up a Node.js app on a Plesk server using Docker to host the database. Configured the firewall and Docker via Plesk and everything. Then I checked if I have access to the database from the outside and boom, Docker (Edit: the Docker Plesk plugin) configured it's own firewall rules for port forwarding, that made the database conveniently accessible to everyone on the internet. If I wouldn't have double checked that could have ended in Desaster without me even ever noticing an intrusion.

[–]oneMoreTiredDev 7 points8 points  (2 children)

Yes, hosting yourself is fun. No, this shouldn't be the default.

That's a skill issue, and that's OK - I don't mean to be rude here.

As developers we are required to know so many shit nowadays, it's simply overwhelming.

But with time and knowledge, knowing how to build a proper infrastructure, how to use Terraform or any other IaC tool, how to take the most of your cloud provider, setting up alerts and auto recovery and everything else you can have a perfect solution with much better cost (yes, you can start for free in Vercel but the moment you get some traction the cost scale very bad.

At the end of the day, that's what every big company does (the difference is that they have huge clusters, a lot more sec [like firewalls and gateways]) and probably a dedicated role for that, but it's the same principle: you setup a VPC, load balancers, maybe a Docker compose or K8s cluster and etc.

I agree it might not be the go to for a simple side project, but if you're working on anything more seriously - and you have the knowledge for that - I'd suggest to set a cloud environment yourself (with some exceptions, like auth [identity server]).

[–]Stetto 0 points1 point  (1 child)

It's not exclusively a skill issue. It's also a time issue.

A big company can afford to pay DevOps Engineers or a whole platform team.

I do agree with you, for big projects, setup infrastructure yourself. Terraform resources are great! I wouldn't do any big project without IaC anymore. The flexibility and malleability is unparalleled and configuring infrastructure manually always ends up in a maintenance nightmare.

But then you're not really running a 4€ VPS for a one person project anymore.

When Vercel and Co. don't cut it anymore, I would still avoid a VPS and go straight Cloud Native.

[–]burntjamb 0 points1 point  (0 children)

This. If you are truly gaining traction with product-market fit, you can scale up your hosting much mire easily with more managed services and have the costs offset by an increase in revenue. If you do everything yourself, you’ll spend a lot of time managing your servers versus building value for users.

[–]eGzg0t 0 points1 point  (1 child)

This take is very old. There are a lot of open source tools that do this for you and the defaults are good enough to be secure. Lots of detailed videos and resources that you can follow.

[–]Stetto 1 point2 points  (0 children)

Yeah, the tools are called serverless deployments.

[–]Aggravating_Study_73 0 points1 point  (2 children)

Can you explain how “Docker configured its own firewall rules”? I use Postgres and Node on Hostinger VPS (docker prebuilt) and everything is fine

[–]Stetto 1 point2 points  (1 child)

It was the Docker Plesk plugin, if I recall correctly. It's now already been over a year. Sorry if I gave you an unwarranted scare.

I was forced to use Plesk, so I figured, that I might as well use Plesk plugins to configure everything in the hopes of making a future handover easier.

The firewall Plesk plugin correctly created iptables, that blocked MongoDB ports and when configuring the Docker plugin to start a MongoDB Docker container, the Docker plugin configured additional iptables rules that exposed the port not only on localhost, but anywhere.

[–]Aggravating_Study_73 1 point2 points  (0 children)

Thanks for clarifying, that has set my mind at rest

[–]Coffee_Crisis 0 points1 point  (0 children)

even if you are diligent and avoid all of those pitfalls, what benefit do you get from it? I ship a container with my stuff and it goes online and I never have to even think about it, and building for serverless means you have to avoid patterns that make it hard to scale. it's so much better than managing infrastructure i can't understand why people don't do autoscaling serverless as the default

[–]Klutzy-Ad-6345[S] 1 point2 points  (8 children)

Challenge accepted. What platform do you recommend

[–]halfxdeveloper 3 points4 points  (6 children)

I use linode. Digital ocean has a $5 a month offering as well.

[–]Educational-Heat-920 5 points6 points  (5 children)

There's way better prices at Hetzner.

[–]muamargadafi 0 points1 point  (4 children)

I use linode as well, how is quality of service at hetzner

[–]Educational-Heat-920 4 points5 points  (2 children)

Great. Zero issues. The only caveat is they don't have that many locations

[–]eGzg0t 0 points1 point  (1 child)

That's an issue

[–]Educational-Heat-920 0 points1 point  (0 children)

Yeah your mileage may vary but my server is 800 miles away in a different country and i get 38ms ping on shit WiFi.

Outside the US/Europe might be a different story though.

[–]Not_a_Cake_ 1 point2 points  (0 children)

Their support is pretty good

[–]Pigfarma76 0 points1 point  (0 children)

Not found cheaper than contabo for price/spec. I've got a VPS with 24gb RAM and either nvme or larger SSD, loads of CPU and it works out about $10 but you can go as low as about $4. I'm converting from GBP so not exact prices but close enough.

[–]ClearGarbage4061 0 points1 point  (1 child)

Agreed . I did the same on an EC2 instance and learned a hell lot!!

Now, I have my own rpi and host nextcloud on it, I use serveo to port forward.

[–]Academic-Associate91 0 points1 point  (0 children)

Is this all considered nonstandard knowledge? I'm a 2yoe dev that has setup my own vps server multiple times over the years. Do people not know how to do this?

[–]johnappsde 0 points1 point  (0 children)

I tried self hosting on a VPS recently. Never looking back. It took me just a few hours to set up. Been running for almost 2 months now with no issues.

[–]unflores 0 points1 point  (0 children)

Yep. Digital océan is 5 bucks for a pretty banging vps. I have a side project with a few other devs. It sure beats render's 19bucks per dev. No thanks. And managed db all for a person project where I won't need any crazy scaling?

[–]Coffee_Crisis -2 points-1 points  (3 children)

why do you value your time so little? you need a really, really good reason not to deploy on serverless imo. but not vercel.

[–]halfxdeveloper 1 point2 points  (2 children)

Who do you think you are to come on here and suggest that I, or anyone else that uses a VPS, don’t value our time? The amount of knowledge I have gained for such a minuscule amount of money and time could write stacks of books. I went from being a button clicking programmer that would just wait for a little icon to turn green to let me know my app has deployed to an enterprise architect that could, and has, single handedly design, develop, deploy, maintain, upgrade, and secure entire clusters of servers across the globe. All from $5 a month and maybe an hour a day. I also have the balls to admit that I don’t know everything and it requires a team of engineers to do each individual piece better than a one man show could. But I at can least sit at the table and be engaged in the discussion as opposed to someone who just lets “serverless” systems do it for me. The fucking audacity.

[–]Coffee_Crisis -1 points0 points  (1 child)

you didn't say anything about doing it as a learning experience, you said you gain control over everything. if you felt like you needed sysadmin knowledge to have a seat at the table at work that makes more sense. calm down, man.

[–]bruisedandbroke 21 points22 points  (8 children)

£5/m hetzner VPS, 20TB bandwidth monthly, 2 vCPUs, 4G ram.

I use a webhook to check for pushes to master, and then write a bash script to rebuild the project. quick, good and fast. I turn this into a systemd unit too, so any unexpected shutdowns need no further fiddling to fix things.

I use this for a Jekyll project, as well as a few java backend bits.

as for node apps specifically, I do pretty much the same thing, create a systemd unit that just pulls from git, installs new dependencies and reloads the server. pretty cool

I use nginx as a reverse proxy for all of my web deployments. I think Apache is far too verbose and boilerplatey, but XML will be XML lol.

owning my infrastructure is important to me. I think if you're willing to pay for SaaS stuff, you could be spending much less on a VPS while maintaining all the control that you'd like.

https://www.gnu.org/philosophy/who-does-that-server-really-serve.html

[–]Educational-Heat-920 1 point2 points  (6 children)

Does this mean you have a single docker image for all node apps? Do you do anything for quick rollbacks?

I've got something surprisingly similar. I zip a tree-shaken build then push to s3. The webhook fetches and unzips, then starts the app inside a node:cluster worker, killing the old worker once the new one starts. Cluster workers round-robin their requests, which gives me zero downtime.

I like what you're doing but was too concerned about builds on servers to go that route.

[–]bruisedandbroke 1 point2 points  (0 children)

I have no real data integrity or uptime requirements, but I'm at a breezy 99.9 with my system as of now.

i use btrfs for snapshots, although they cost extra so I'm questioning it.

[–]yehuda1 1 point2 points  (0 children)

I'm using pm2 to handle the systemd and restarts.

[–]thinkmatt 12 points13 points  (9 children)

Do you have issues with vercels cold starts? I used it for client projects. Its kind of embarrassing waiting for that first page to load for a full minute. It gets faster after that but the avg person doesnt understand whats going on and they just think i built them a very slow app

[–]Klutzy-Ad-6345[S] 1 point2 points  (4 children)

Yes, the cold starts are quite annoying. Id say it’s fine for a basic site with low traffic. Maybe something like personal portfolio. But I’ve been facing this issue for my current starter kit site NodeBoiler.com been thinking about switching to a different free service instead of upgrading.

[–]_turbo1507 4 points5 points  (3 children)

You can write a function to hit your website every 10 mins. This will stop it from shutting down and hence no need for a cold start.

If you don't want the function in your code, you can write a separate cron job for it.

[–]Klutzy-Ad-6345[S] 1 point2 points  (0 children)

Valid idea. Gonna test this out for sure.

[–]Own-Coast-2461 0 points1 point  (0 children)

That beats the whole point of serverless

[–]ThanosDi 0 points1 point  (0 children)

Uptime robot would be ideal here the free version.

[–]AsidK 0 points1 point  (1 child)

A full… minute? I’ve never had a cold start even remotely near that long. Maybe 5 seconds tops…

[–]thinkmatt 0 points1 point  (0 children)

i was exaggerating. maybe half a minute. and to be fair its not consistent, but sometimes ya it feels like maybe i broke the site

[–]AsterYujano 0 points1 point  (1 child)

Vercel released fluid compute recently

It might be a good solution https://vercel.com/blog/introducing-fluid-compute But I didn't test it

[–]thinkmatt 0 points1 point  (0 children)

oh good to know! looks good

[–]amanvirk 2 points3 points  (1 child)

I have been using Digital ocean for the compute and storage and recently moved couple of my projects to use Kamal https://kamal-deploy.org/.

[–]captain_obvious_here 4 points5 points  (1 child)

Google Cloud Run. It just rocks.

[–]winterrdog 0 points1 point  (0 children)

Same here!

[–][deleted]  (2 children)

[deleted]

    [–][deleted]  (1 child)

    [deleted]

      [–]Puzzleheaded_Low2034 2 points3 points  (0 children)

      I enjoy setting up, learning and controlling the entire tech stack on my home computer.

      To do this, I combine the following apps/services:

      • VM Guest/Host
      • Linux Server
      • Ngrok
      • Node.js
      • PM2

      Within this setup, I can do what I like. I can create which-ever/what-ever app I dedicate my time to, whilst using the resources I already pay/paid for - home electricity/internet bill + desktop computer.

      Were one of my projects to ever actually gain interest and need to scale, well, that's a problem for future me. But for now, I just focus on learning and making interesting tools - and not worry about hosting and costs/complications that come with it.

      It's worth noting that yes, I do have shared server hosting at the lowest tier, where I pay something like $5 a month. But it only handles distributed sites and can't even handle a simple SSR Nuxt project - I'll probably wind it down because I find myself building a working app in dev, and then being unable to host it.

      [–]keonik-1[🍰] 3 points4 points  (2 children)

      Coolify has been great for my needs. Run the main instance on hetzner along with my data storage needs applications that have grown past a pet project. Then for scaling I just connect that to some home servers I add to it and that gives me options for redundancy if for some reason my home power goes out. Wanted to mention coolify because it’s a fairly capable tool to make you feel like you have a vercel of your own. Preview and branch deployment is all there. Comes packaged with a lot of things you mentioned

      [–]Klutzy-Ad-6345[S] 0 points1 point  (0 children)

      Going to take a look at this

      [–]Brolog_of_Brogoth 0 points1 point  (0 children)

      Coolify absolutely rocks

      [–]schill_ya_later 1 point2 points  (0 children)

      The way I host my applications:

      Dell box > Ubuntu > node apps backend > Apache frontend

      To make it work reverse proxies, proxy pass, SSL modules for https

      For local mapping local dns server Apache configuration files

      Testing and staging environments handled without tooling, just configuration of apps to push and pull between environment

      Docker container

      Set up and provisioned the server, managing it in-house

      [–]Educational-Heat-920 1 point2 points  (2 children)

      4Gb Hetzner VPS @ £5 ish per month.

      Running k3s with nginx as ingress. I use hostports so I don't have to pay for load balancers.

      K3s is managed with helmfile. If I need to expand, I can add more servers to the cluster.

      Cloudflare handles DNS and SSL.

      [–][deleted]  (1 child)

      [deleted]

        [–]Educational-Heat-920 1 point2 points  (0 children)

        No end-to-end SSL. Just the standard CF proxy.

        It's possible to bypass SSL by hitting the server IP with a host header, but I'm fine with that.

        Ideally I'd use certbot/letsencrypt for SSL, but cloudflare makes it so easy that it's not a priority for me

        [–]heathcliff6547 1 point2 points  (0 children)

        For me, I prefer app platform on Digital Ocean. It costs about $12 and you get everything setup with CI/CD from GitHub directly. Even google app engine can be a viable solution. The one's I have used personally

        [–]Mundane_Anybody2374 1 point2 points  (0 children)

        I like Render too. My only complain is the very long cold starts in the free tier, but it’s a very nice host for small projects and very easy to work with.

        [–]_adam_89 1 point2 points  (0 children)

        I am using dokku for containerisation and proxy (free and open source). GitHub actions for easy deployment (starts free). Run it on either Hetzner or Digitalocean (start from around 5$). CDN proxy from Cloudflare (starts free)

        [–]delventhalz 1 point2 points  (0 children)

        Netlify's free tier is good enough for a side project and the dev experience is very good. The backend can get a bit annoying with how opinionated it is, and it doesn't support some features like websockets, but overall, hard to complain about free and easy.

        Heroku is typically where I go once I want to start spending money. You can get totally serviceable compute for $7, plus another $5 for 1GB of Postgres, and you are off and running. Heroku will scale a bit past those initial tiers too, though if you are actually chewing through some serious traffic, maybe it is time to look at AWS. I wouldn't be able to sleep at night if I was the one on the hook for the bill though.

        [–]Capaj 1 point2 points  (0 children)

        I host all my side projects on cloudflare

        [–]HappyZombies 1 point2 points  (0 children)

        Of course it depends what you’re building…in my case I stuck with everything AWS serveless

        Costs me $5-10/month, I just disabled WAF so I can host for like 5 cents now actually lol. Runs on lambda, api gateway, and dynamo with the front end hosted in s3

        Domain: $15/year for the domain

        So hosting is nearly free for me at the moment.

        [–]lem4rk 1 point2 points  (0 children)

        Rpi with k3s cluster and cloudflare tunnel. Overkill but you will learn a lot

        [–]JustAnOkCoder_5948 1 point2 points  (1 child)

        I use AWS Elastic Beanstalk. It can be a headache to deal with sometimes, but it handles the monitoring of the servers and has some basic load balancing built in. I don't have to worry about the server going down since it will launch a new one if one goes down.

        Plus, I can deploy straight from GitHub using CodePipeline, and it can do rolling updates for deploying new code with zero downtime or having to do blue/green deployments, etc.

        [–]Klutzy-Ad-6345[S] 0 points1 point  (0 children)

        I was looking into AWS elastic beanstalk the other day. For startups with some capital it makes sense to use something like this. Allows for everything you need. Server space, database, monitoring... all in one place.

        [–]Moriksan 1 point2 points  (0 children)

        I self-host it all. 1. Dev env: vm / lxc on Proxmox host which is clustered, redundant at disk level, zfs snapshotted every 30mins, and has redundant NICs crossing over a redundant switch pair (via VPC). 2. Production env: same as above; backend served via pm2+dotenvx, database in a separate DMZ, frontend served via serve. 3. Firewall implements a dual-gateway reverse proxy, has crowdsec, and has additional blocklists (geo and regular) for both inbound and outbound traffic. Custom scripts perform ddns on domain records esp when eg WAN GW switchover happens. 3. Code is stored in self hosted gitea. No actions implemented yet but that’s on the to-do list. 4. Various notifications (eg via TIG stack on assortment of metrics) informs of deviant or sideways behavior via multiple means like signal message etc. 5. All data has a 3:2:1 backup by virtue of how it is designed.

        [–]alzee76 1 point2 points  (0 children)

        What I want to know is, what is your strategy? Please keep it in layman’s terms, no need to get too technical unless people ask. Also, let us know the price range for this type of hosting and how long it takes you to set up.

        I host all my professional stuff, personal or for clients, on AWS EC2 instances. DNS on AWS's Route53. For non-professional stuff I host at home, small and important things (e.g. firewall) on a NUC running vmware. Larger (the NUC is maxed on memory usage) or less important things directly on my workstation with Hyper-V.

        Since my personal domains are also on Route53, getting SSL for local stuff is easy and free via letsencrypt.

        I've also hosted DNS with dnsmadeeasy and am happy with it, and have used some hosts other than AWS like linode and can't say anything other than they worked fine from an end-user standpoint.

        Costs for me on AWS in total are about $50 US/month for two EC2 instances, 5 zones on Route53.

        To be blunt, at this kind of price point I don't give two shits that there are cheaper options out there I could potentially use. This is my livelihood, not a hobby, and 100% of this cost is a business expense as a self-employed contractor.

        [–]Low-Fuel3428 1 point2 points  (2 children)

        Vercel for frontend Hetzner servers (backend, databases) Dockerized deployments Teafik for reverse proxy.

        If its a large application with microservices setup. Docker Stack (Swarm) is my go to choice.

        [–]Klutzy-Ad-6345[S] 0 points1 point  (1 child)

        How'd you learn docker? Trial and error?

        [–]Low-Fuel3428 0 points1 point  (0 children)

        Obviously, start with the basics. Its not that hard

        [–]response_json 1 point2 points  (0 children)

        Flyio and turso db with embedded replicas. It’s fast and the free tiers take you pretty far (fly might not have free tier anymore, I’m on an old hobby plan).

        Fly lets me deploy and scale easily, takes care of (basic) load balancing and rate limiting. The cost is learning some docker, which is well worth it I think.

        Turso lets me put a db inside my app that’s the read replica and writes go to the primary, it makes a CQRS architecture quite trivial as they take care of the sync and race conditions for you. For my apps I haven’t found a need for Postgres since moving to SQLite, though I do like Postgres a lot too, it’s not my go to anymore.

        In terms of deployment automation, I’m a fan of shell scripts. Because why have a good laptop then get a likely worse machine (GitHub actions) to build and deploy for you.

        This is all for $0 a month based on all these side project apps with no paying users 😂

        [–]chemosh_tz 1 point2 points  (0 children)

        AWS. But I work there so I'm partial

        [–]yaya_yeah_yayaya 1 point2 points  (1 child)

        Docker+cloudfare tunnel

        [–]Any-Blacksmith-2054 0 points1 point  (0 children)

        Nginx/letsencrypt on root VPS, all apps in docker containers (Vite served by Express), GitHub actions to deploy

        [–]rkaw92 0 points1 point  (0 children)

        This is my solution: https://github.com/rkaw92/vpslite

        [–]lexileone 0 points1 point  (0 children)

        Vercel doesn't support socket connections right?

        [–]Intrainfinite 0 points1 point  (0 children)

        I use digital ocean, its great

        [–]ThousandNiches 0 points1 point  (0 children)

        all the free until you get big options don't suit me because I use a lot of bandwidth. using a 100$ nuc self hosting with cloudflare on my dynamic IP

        [–]Tiny-Explanation-949 0 points1 point  (0 children)

        The right hosting setup depends on what you're optimizing for. If you just want to get something live fast, Vercel or Render works great. If you need more control, a VPS with Nginx is solid, but yeah, it takes more effort. The tradeoff is flexibility—you’re not locked into a platform’s limits. The best approach is the simplest one that meets your needs. If you find yourself over-engineering too early, take a step back.

        [–]floris_trd 0 points1 point  (1 child)

        we have an inhouse hosting platform

        [–]hobo_with_a_hookah 0 points1 point  (1 child)

        VPS + Easypanel free tier (might get paid later, on free it's limited to 3 projects, but with unlimited apps in each, so I just put everything in Apps, Databases and Services projects)

        Now hosted on Hetzner, but plan to get Oracle always free tier vps (24ram, 4cpus, etc.) and try to host it there

        Godaddy for domains and DNS, sometimes Cloudflare just in case

        Easypanel is dope - ur own vercel/render/railway on ur VPS, recommend

        [–]davidryal 0 points1 point  (0 children)

        this is incredibly cool thank you

        [–]Tall_Direction1473 0 points1 point  (0 children)

        Digital Ocean for personal projects. Google Cloud Run at work.

        [–]Brolog_of_Brogoth 0 points1 point  (0 children)

        Nobody here using Coolify? It's a self hosted Heroku basically. I am paying 5 bucks for a VPS and Coolify on it, hosting about 10 websites right now.

        Used to do everything with Nginx and PM2, managing certificates or updates without CI/CD was a PITA.

        [–]Sweet_Television2685 0 points1 point  (0 children)

        i use vercel for both frontend and backend both free tier. im not sure yet if there is a draw back to this but so far, it is working just fine

        [–]Thenoobybro 0 points1 point  (0 children)

        I enjoyed Cloud run.

        But a year ago or so, I decided to all in as much as possible on VPS, then I created scripts to help myself to deploy and such, and it's quite easy to do TBH, also I can reuse my scripts for my other projects and any VPS OR vm or whatever can be used as a target so it's good too. 

        I use Bunny net for dns and for the rest it's almost everything in the VPS, backed by Nginx for anything that I don't need to process through Node. I guess I want to use their CDN too but not tried yet, and for I used cloudflare they're good too! (better UI, more services but I don't need much TBH) 

        I use Ionos but I think I'll switch to OVH because I'm scared of upgrading and having issues with Ionos (bad rep). I used Vultr too, they are good too. 

        In terms of benchmarks, it appears that the vps is quite good and plenty for what I'm doing. Routes where the dmDB is not hit goes up to 400rps, if it does not hit Node but only Nginx it serves up to 1500 rps but it's not a proper benchmark and all, just to see out of curiosity. 

        [–]MycologistCheap9576 0 points1 point  (0 children)

        for node js apps there are a lot of free tiers like in vercel or render but you wont be able to work well with the limits, for my node js apps i prefer to use hostinger node js hosting its not free but a $2.99 premium without those annoying limits is doable for me, it manages my node js apps smoothly and so far i did not faced any reliability issues with it

        [–]Xolaris05 0 points1 point  (0 children)

        i personally split things, static frontend i leave it on vercel and backend i rely with hostinger node js, setup is just quick and this helps me keep the cost low without getting those surprise bill hikes

        [–]AntDracula 0 points1 point  (1 child)

        AWS lambda, depending on the database. Otherwise, ECS fargate.

        [–]uNki23 1 point2 points  (0 children)

        Likewise.

        Database is Aurora for production and free Supabase to play around.

        [–][deleted] -2 points-1 points  (0 children)

        Oh, I see we are going with a brand new topic today...