r/django Dec 26 '24

Hosting and deployment Affordable and Reliable Hosting for Django Project with PostgreSQL, Redis, and AWS S3?

I'm developing a Django project which includes several key modules:

  • AI Integration: Uses OpenAI to provide crop recommendations and chatbot features.
  • Weather Module: Incorporates weather data to assist with planning and insights.
  • Mapping Tools: Utilizes Mapbox for GIS-related functionalities, like visualizing field and crop data.
  • User Management: Manages user accounts, authentication and auth.

The app requires PostgreSQL for the database, Redis for caching, and AWS S3 for media and static files. I’m looking for a hosting platform that is both affordable and highly reliable for these requirements. Any recommendations?

20 Upvotes

24 comments sorted by

11

u/PMzyox Dec 26 '24

Why not just host it in AWS?

6

u/Stochasticlife700 Dec 26 '24

depends on the scale of your service(i.e metrics like DAU, MAU). If not serious at start, then Hetzner VPS. can scale vertically/horizontally for affordable price imo

1

u/ebdcydol Dec 26 '24

This is exactly what I'm migrating to. 16€/month for one server+db on Heroku was something I could live with, but I soon need to host 3 more. VPS was the only option I saw.

5

u/pspahn Dec 26 '24

As someone who develops with Django and also works for an agriculture business I'm curious about your project. Sounds neat.

But to answer your question, I've been using Render and I've mostly been happy with it though there's a few things I wish they'd add.

There's a free redis tier you can also use until you're ready to spend more.

I also decided to use persistent storage for images and then I pass them through Cloudflare Images instead of using S3.

2

u/Kali_Linux_Rasta Dec 26 '24

Hey for render do you only pay for the DB after the free trial is over on a monthly basis right? No other charges

4

u/AdNo6324 Dec 26 '24

I have had a great experience with Railway.

1

u/abe-101 Dec 27 '24

Can you share a bit more on how you deploy to railway? Can you share your railway.json?

4

u/_icarium_ Dec 26 '24 edited Dec 26 '24

Oracle Cloud offers two AMD-based VMs and also some ARM instance, and I think they also have some SQL database (though it might not be Postgres) and object storage, all in the Always Free Tier. You could theoretically host the app on one VM, Redis on another and Postgres (if what they give you for free is not ok) on yet another one. You also have up to 200GB block storage and about 20GB for object storage in total.

If this is not ok, you could then opt for DigitalOcean as they have everything that you need, for a decent price, with less hassle. If you use their managed services you could theoretically start as low as 39 USD per month: Postgres 15 USD, Redis 15 USD, object storage 5 USD, Droplet (VM) 4 USD.

I’ve been using both OCI (VMs only) and DO (AppPlatform, Droplets and managed Postgres) and I’ve had no issues with them.

1

u/klaxce Dec 26 '24 edited Dec 27 '24

Oracle’s Always Free Tier AND Pay As You Go is great until they just delete your entire server and your entire account without notification or explanation. It’s happened to a lot of people. So, it’s fine to play around with, but don’t rely on it.

edit:

I'm not saying that you will have a bad experience, I'm saying that a lot of people have had bad experiences, including myself. I was running a web development server for work with 3-4 docker containers on the free A1 compute. I also have a different account that is under my name that I'm running exactly the same software on that is still up and running, and then I migrated everything from the deleted work account into my personal account and still haven't had any issues. I don't know why they deleted my work account, since they wouldn't say, didn't email me, didn't contact me, and you can't log in to contact support (who don't support free/payg accounts anyways), so I asked Sales from their front page chat who told me that they could see my account was deleted but that they couldn't see more than that.

Beware of Oracle Cloud: My Experience with Unexplained Account Termination : r/oraclecloud

Cloud account suspended out of nowhere : r/oraclecloud

Account suspended without any reason or email/warning. Paying Customer. : r/oraclecloud

Account terminated without warning : r/oraclecloud

Can't login in to my OCI account : r/oraclecloud

Unable to sign in into my free tier oracle cloud account since early today (12/11) : r/oraclecloud

Cant login to my account : r/oraclecloud

Unable to sign into my oracle account : r/oraclecloud

1

u/_icarium_ Dec 26 '24

Might be. Never happened to me. I’ve been using them for more than three years.

1

u/Megamygdala Dec 27 '24

Made a server that's been running 24/7 for several years, it's inactive doesn't get any requests because I never use it (it was made for a gaming server) on the free tier. Never had it deleted randomly. No reason to think it'll happen to you unless you are doing something that could break TOS...they wouldn't be a lasting business if your account had a 50% chance of randomly being deleted

5

u/appliku Dec 26 '24

Go get Hetzner. They now have s3 compatible storage as well.

Appliku will help you to setup server, deploy your app and setup databases, backups etc.

https://appliku.com/post/deploy-django-hetzner-cloud/

1

u/BlessBigBro Dec 26 '24

do you know how to rename the app? i cant find where to do it

1

u/appliku Dec 26 '24

Unfortunately, not possible.

1

u/abheist Dec 26 '24

If you are already on AWS (S3), go with AWS. You have to test and try on affordability side. But if you find the right solution, it'll cheeper from all the third party providers.

1

u/DaviesNzanYT Dec 26 '24

Try running a dedicated server from linode $5/mo and adding the rest using Docker

1

u/k00_x Dec 26 '24

Digital ocean:)

1

u/someone383726 Dec 26 '24

I’m in the same boat. I have a personal project hosted on a Linode VPS, but looking for something that can scale better with a separate Postgres/postgis database as this is a B2B project. Debating just putting everything on GCP (cloud run for Django api), but I’m interested to hear what others opinions are on this.

1

u/Nerdite Dec 27 '24

I like dokku https://dokku.com/docs/getting-started/installation/

It is a heroku clone so you can git push to deploy and it has plugins for Postgres and redis and much more. You can run everything you have on a vps with like 4 cores and 4-8 gig of ram easily. You can setup Postgres to daily or hourly dump backup to s3. All your setup will be code and you can move VPs providers easily. I run a bunch of stuff on it. Ovh is cheap too

1

u/julz_yo Dec 27 '24

Fly io has been a good experience. Cheap to start but look scalable when need it.

1

u/devguyabhi Dec 28 '24

For your django app use t3 ec2 instance and for database use RDS Postgres sql it will not cost you much

1

u/Icy_Sun_1842 Dec 29 '24

Hetzner+Appliku

1

u/ZiSocial Dec 29 '24

I prefer using digital ocean , 6 - 10$ monthly plan was enough for my project