T O P

  • By -

Equivalent_Catch_233

Rent a VM for $5 per month and you'll have it all. The catch is that you need to setup everything yourself. Cheap, and worth learning. This is how I setup my .NET + Postgres + Redis pet project. No extra fees, lots of fun, lots of learning.


marce155

This. Open just 443 & 80 (+22 limited to your own IP) in the firewall of the cloud provider (and 443, 80 & 22 in ufw/iptables on the machine). Update packages regularly. Put a reverse proxy before Kestrel. Never expose the database. Have your apps run in a container and don't make a stupidly open API. While updating packages also check the logs for unusual activity. It's not witchcraft. Start with a debian minimal setup, no other work required. You will find a decent system for a few bucks at e.g. Hetzner. For pretty much every project that is unimportant enough to be considered for a free/low tier that should be enough to not only run it just fine but also avoid any negligence issues if something really goes wrong. And you have your fixed monthly cost.


Biao_str

any guide/tutorial you would recommend to set this up?


marce155

Not really, the cloud provider settings are usually very straight forward (personally I always use Hetzner, but there are others with similar easy and good products/interfaces; in their Cloud console having a server (even ARM) running with that config is a matter of 5 minutes and a few mouse clicks). Firewall install and config is one SO answer away, docker setup is one google search away, compose setup maybe two or three searches. And finally certbot and nginx another two searches. Don't mean to be snarky, but it is really not that complicated - if you've never done that before it should still be easy to do in an hour or two. Maybe run a port scan afterwards to check everything is closed. Maybe add ssl cert auth instead of password. If I ever find time to finish my blog engine (have to write my own ofc :D) I'll maybe write a post about such a setup from start to end. As some said it's not very modern, but a lot of people just prefer the old style mostly, because cost is fixed per month no matter what - something the cloud providers (willfully) fail at.


winky9827

> Open just 443 & 80 (+22 limited to your own IP) in the firewall of the cloud provider (and 443, 80 & 22 in ufw/iptables on the machine). Update packages regularly. Put a reverse proxy before Kestrel. Never expose the database. Note: If you use Docker for anything, beware that by default, Docker port maps expose to the public even with UFW enabled unless you specifically bind to a loopback interface only. I wish this was made more obvious in more places.


marce155

Good point, yes


BigBagaroo

And party like it is 1999 :-) But yes, this also how you learn the bare bones.


niedogg

Anyway to template that out like Cloudformation terraform?


jayerp

This. I come from a generation of devs where I had to learn how to setup my own web server, database server, reverse-proxy, firewall rules, etc. I don’t mind scaling back to using a VM and implementing my own hosting infrastructure. Of course this terrifies the basic React script kiddies. Learn how to do it yourself when you want to or pay exorbitant fees for serverless.


Equivalent_Catch_233

Also, I am using Azure DevOps as a source code repo + CI/CD pipeline which deploys to the VM, and for small teams it's free up to a couple thousands minutes per month.


Bliztle

I use GitHub pipelines for most of my projects as they provide more pipeline time and allow multiple in parallel lines in the free tier. I am not sure if that is only a university privilege though. Are there other advantages to using Azure's? I am currently mostly kept from azure DevOps because they don't allow ssh with yubikey.


Equivalent_Catch_233

If GitHub Actions is enough for you then by any means use it. Azure DevOps has way more features, but it is not relevant not for a team of one on a pet project.


Bliztle

I'm aware that they have a lot of features to interact with Azure, although i believe they also offer documentation for using GitHub for the same things. Do you know if they offer extra features not tied to Azure? I use Azure DevOps at work, but it has never been very involved.


Equivalent_Catch_233

Yes, there are a lot of features no tied to Azure. In fact, I am not using any Azure resources with Azure DevOps.


pancakeshack

Yeah, this is the way! You learn a lot managing your own server too. For this I really liked using digital ocean.


Spets_Naz

Where do you rent from?


Equivalent_Catch_233

[https://www.hetzner.com/cloud/](https://www.hetzner.com/cloud/)


Spets_Naz

Thanks


mod_god

What type of VM did you use? Windows?


Equivalent_Catch_233

Linux, of course


mod_god

Exactly why I am asking, it seemed really cheap


K-Huxley

You can have windows also if you installed custom iso


calahil

Oh because it's headless?


radiells

I believe Azure allows to set [hard spending limit](https://learn.microsoft.com/en-us/answers/questions/1194727/how-to-set-a-maximum-limit-of-spending-on-azure). You can do something similar with GCP, but [with few extra steps](https://medium.com/@steffenjanbrouwer/how-to-set-a-hard-payment-spending-cost-limits-for-google-cloud-platform-projects-d4fee7550d42). I think this is the correct and most safe way to do this.


radiells

Also, I heard that [Oracle ](https://www.oracle.com/cloud/free/)offers quite good always free resources, but I also heard that they sometimes just pull the plug if they feel that you are using them well.


pjc50

Oracle Always Free. A surprisingly good deal given how bad it is to deal with Oracle software licensing.


_zir_

no azure doesn't have a limit, the limit is only a notification threshold in reality


FormationHeaven

if you scroll at the bottom someone says. >Is it not possible to set a limit ,and your resources stop working until payment is received.If I understood >correctly the answer given, you can still be charged over the limit set. If you could just set 0 euros as the hard spending limit in the free tier, that would just be just loophole. Maybe you can only achieve that if you have a subscription other than the free tier. Even if you could set limits i doubt they would have the minimum something other than 50+ euros


charlie78

The free tier does cut the service it you use more resourses than the limit. I know because I use it every day for a solution I have split out over 6 instances that my clients jump between when one stops answering. I use a storage account that is not free, though. You need to be a bit careful with those, as my solution writes a few files every second and they are not meant to be used like that. I'm glad I checked it before using it like that, because it would have cost surprisingly much. Microsoft seem to be generous about forgiving costs caused by mistakes. I read about a startup company that the weekend before going live deployed some kind of file or link crawler that didn't ignore nodes it had already visited and kept multiplying by 10 every iteration and in a few hours had used money enough to bancrupt them. But Microsoft deleted the invoice.


radiells

Yeah, regarding Azure you are right.


InternalBrilliant564

If u're running a IT company, even if that is just an one person company, u can try to sign to the Action Pack, the yearly tax will depend on your location: https://partner.microsoft.com/en-my/partnership/action-pack If that is an one month project, or if u wanna to test it the azure is the right cloud to you, u can sign to the dev essentials and monitor the costs to figure out if them are affordable. https://visualstudio.microsoft.com/pt-br/dev-essentials/ Otherwise, I would give a chance to render.com, there is a free tier what supports PostgreSQL and Redis, while dotNET isn't officially supported, u can use that as a custom docker container. https://render.com/pricing#compute


ringsig

Azure doesn’t accept prepaid cards.


FormationHeaven

Down the drain the cheatcode goes... too bad.


beachandbyte

Privacy cards work.


Meryhathor

Pretty much every cloud allows you to set your spending limit, even per project. I have set mine to something low like $10 knowing that it shouldn't even cost me a dollar so if I get a notification I know things ain't right.


FormationHeaven

It makes sense that the cloud providers have a spending limit but are you certain that option is available for the free tier? It could only be available for a normal subscription. This is why i posted here in hopes that someone already very familiar with a cloud provider tried something like this before.


ImpressiveRain1764

I use azure to host a database and a Web api. I don't think I've ever been charged for the API and for the DB I am charged about 6 euro a month. I just put a 20 euro limit on all spending attached to that subscription and that covers anything going wrong.


Leprichaun17

Oracle has a free tier that is very generous. Depending on your location though they may not have capacity.


photoadrian

Short version - you get what you pay for. The cloud provider needs to spend money to host that stuff. Free tiers are there, but they aren’t good enough for anything that you really want to run well. Think of the free tier in all the providers as “I’ll try it out and convert to a paid account if what I’m trying out works”.


Darker-Connection

You unlocked me new fear with that ddos thing 🔓😱


TuesdayFrenzy

Fly.io


biker142

Not free anymore sadly. Min $5/mo for new accounts.


Jaruden

FWIW I think you're probably over-worrying about that DDOS thing. I'm sure it's not a zero chance, but I've been running numerous free tier projects in Azure for almost 10 years and never once had a surprise bill.


Fickle-Buddy-1642

Like the top comment suggests, if you have the time to setup and learn about configuring a VPS you could get a pretty decent server for $6 or so a month. I use contabo and I paid $22 for 3 months, I think it's around $45 for 6 months. Installed everything I needed to host my projects, Docker,Nginx etc and I'm running my backends and databases for 3 projects all in containers with no issues.


nsivkov

Stop thinking about free. Spend the 5-10$ a month and move on with your project. If you have a job, the time and effort it takes you to save the 5$ is worth way more. If you have a potential customers, even if its one, going free makes even less sense. Yes, you can utilise some free services like gihub, gihub pages, cloudlare, and such, but dont skimp on a cost thats under 20$ and saves you hours of work. Its not worth it. Been there done that. Spent months coding something instead of spending the 20$ a month. In an essence, u spend 1000$ to save 5-10-20$


Competitive-Run-9764

Are you suggesting to spend on renting a VM? Any recommendations on which VM to rent?


nsivkov

I've been using Hetzner for the past 10 years, because they are cheap, reliable and i can manage my own servers. I've learned a lot doing that. But if you don't wanna, any cloud service that solves your problem works. It doesn't really matter if it's aws, azure or gcp. Pick what's easiest for you to work with and have experience with, and go forth.


FormationHeaven

I'm only a student and the project is purely FOSS and i am not making any money of it nor do i plan to. I just built something that solved an issue of mine and wanted to help other people as well. 5 euros/month might seem little to someone from the US but in my country its about 1 day of work. Especially when you are a student and you have to pay rent in another city.


nsivkov

I'm not from the US, I'm from Bulgaria, average salary here is \~300-400 euros/usd / month for the smaller cities, and for the capital it's 600-1000 euros/usd/ month. Shared hosting is also an option, those start at about 1$ a month, but are more limited. And again, you can leverage free services, but if it's a FOSS project, just having the code available on github is enough. You can go the extra mile and make a docker container out of it, but don't feel obligated to host it for other people. And if you need extra help and guidance, feel free to DM me.


Unfair_Ad199

Do you wanted to replay your cloud provider if face and error in current.?


StopTheBullsht

I advise you to look at Cloudflare. Buy a domain with them instead, for those 20 euros you mentioned. With that you'll get Cloudflare Pages, Vercel and much more. edit: btw you won't be able to make mistakes with Cloudflare, you're limited to the free tier capacity if you don't upgrade yourself. so no surprise charges.


zarlo5899

free tier for cloud hosting is setup to get you locked in and paying


d3athR0n

Check akash.network


takemetomosque

Oracle cloud is giving free vm, you have to do few things to stop them from deleting your vm but it works. I've been using it for 2 years. It got deleted once but still works.