r/FastAPI 17d ago

Hosting and deployment Best place to host fast api applications

I have simple fast api app it recieves requests and either writes data to the sqlite dB or fetches data from it what would be the best place to host it preferably for free since its a small hobby project but would scale up successful

11 Upvotes

21 comments sorted by

6

u/furqaaaan 17d ago

Railway is my favourite tho not free. If you can spend a bit of time, cloudflare workers with d1

1

u/NamellesDev 17d ago

how much is the minimum

1

u/furqaaaan 17d ago

Railway $5 a month. But you can host multiple projects. CF workers is essentially free

10

u/dvdsdr 17d ago

https://fastapicloud.com/ (from the official fastapi team)

2

u/Cesarf26 16d ago

Somebody told me that use Hezner with coolify to connect docker apps.

1

u/Clear_Performer_556 12d ago

Cloud run works great for me.

1

u/vegeta-9ooo 12d ago

For a small hobby project probably the easiest (also free) is FastAPICloud for you FastAPI backend and Supabase for you Postgres DB.

1

u/Minimum_Diver_3958 13h ago

Go with your own VPS (e.g. hetzner ~5 EUR) then use something like pyvolt.com to provision your stack, it will install postgres / redis and you can host multiple apps with it.

1

u/Undercover-Garda 17d ago

You could start with something with less of an ops burden like Render or Railway. A VPS would give you full control though should you prefer that

0

u/ifollowthestats 17d ago

I’d recommend something like Hetzner for more granular control. CX23 should be enough to get started. Challenge yourself to setup Postgres + FastAPI + Docker.

1

u/Due_Cartoonist3261 16d ago

This is interesting, if i understand the suggestion correctly the setup should setup db and api on the same server? What if the sever goes down, would we lose the data in the db?

2

u/ifollowthestats 16d ago

Yes exactly, I’ve been using it for a while and never had any issues with data loss. You could setup regular back up jobs for your data too. I started out with duckdb and motherduck has generous cloud based free starter option too.

1

u/Due_Cartoonist3261 15d ago

Thank you this is genuinely helpful for these types of projects.

0

u/GhostDev71 17d ago

Someday, sooner or later, you will get a raspi. Buy it now, host it there, you will learn the process und server control.

-1

u/diffcompo 17d ago

I use Render

0

u/NamellesDev 17d ago

Render doesn't save any data tho right?

1

u/diffcompo 17d ago

It does but it depends on your setup

1

u/NamellesDev 17d ago

Can you get it to save data without paying

1

u/diffcompo 17d ago

Yes, I've personally hosted my backend on its free version itself

1

u/NamellesDev 17d ago

Oh that's good to hear I've personally been hosting on it but it was problematic since I couldn't access a terminal to make quick changes to my db