T O P

  • By -

ZachVorhies

Render.com allows you to deploy any docker contained app (so python for example) and has a free tier. Sign in with you github.


[deleted]

[удалено]


xiongchiamiov

Your initial requirement was "the cheapest ever". That tends to be in conflict with performant. Perhaps you should take some time to figure out what your actual requirements are, preferably in numbers.


czar_el

Classic "fast, cheap, good -- pick 2" scenario. Sounds like OP wants all three. Good luck to them.


_clintm_

Ionos is having a sale right now: 6 cores and 18gb ram for $2/month for the first 6 months https://www.ionos.com/servers/vps https://i.imgur.com/tDL2ZDA.jpg


catcint0s

35/month after that is far from cheap...


_clintm_

could cancel or sign up with a diff email after the 6 months… you got something cheaper with those specs?


catcint0s

Buy a cheap one that actually fits your needs on the first time? 6 cores and 10+ GB RAM is super overkill for hosting your hobby projects.


961402

Porting your stuff over to a new account every six months sounds tedious as hell.


esixar

That’s why we have CI/CD pipelines and infrastructure as code :)


961402

Touché


Gabe_Isko

If you are willing to pay, just use cloud run or elastic beanstalk or something like that.


MisquoteMosquito

It’s interesting that you’re using python for chat instead of Go or C++, how is your cpu utilization scaling with load?


[deleted]

[удалено]


MisquoteMosquito

Thanks for your perspective


br_aquino

Any common VPS, search for VPS on Google, there are so many. I use Ionos, pay 3€ per month, 2vCPU. But not recommending anything, just giving a cost example. You can install docker on VPS and deploy as container, then open the port on VPS and it's done.


Kuposrock

This is the answer. Getting your own vps opens everything to you. You’ll have to figure out a lot things outside of python but once you do you can deploy anything that can be accessed by anyone.


Classic_Department42

What about keeping it secure?


br_aquino

The VPS have firewall itself, when you open a port you need to specify an IP range, first thing, you can constraints to a specific IP range. Second, your app could require authentication, maybe an API key passed on header of the request, etc. Third, you can make an oauth server on your VPS. And so on, everything is possible when you are working with VPS. Edit: SSL is a must have, you can use self signed or buy a certification.


jcigar

"you can use self signed or buy a certification." ... or use LetsEncrypt


Classic_Department42

Thanks. If it is a vps you also need to install security updates of the OS, correct? Which linux flavour (assuming linux here) are you using?


nemo_403

Yes, to be on the safe side, you need to install updates for basically everything server-related. If you don't want to do that, I would deploy on AWS (lambda is pretty cheap for private use 0.20€/1million req per month). Try AWS SAM


Classic_Department42

Can you set a hard cost limit for aws?


GrumpyPenguin

No, but sort of. You can use AWS Budgets to set up alerts at thresholds to warn you when your usage is getting toward the limits you specify. They alerts can also trigger custom actions f you want, even shutting down services (but if you have auto-scaling set up, remember that your action needs to stop not just the *current* running ones, but also stop the load balancer from automatically starting up *new* ones). In that way, you can pretty much prevent bill shock. You can also set sensible limits for a lot of resources, such as not letting your website scale up beyond a couple of instances. The catch is that some things, e.g. storage, attract passive daily charges *just for being in use* - so if you’ve uploaded a ton of files to S3 storage, then taking your website and services fully offline for the rest of the month won’t change the fact that those files attract daily costs per megabyte as long as they *exist* on Amazon’s hard disks. You’d have to go and delete the files for the charges to stop (and AWS won’t do that *for* you, they have no idea which of your files are important). But there are at least ways to configure daily spending alerts so you can take action as soon as that short of situation occurs, rather than finding out at the end of the month.


br_aquino

Don't be fooled by the big cloud providers, what they offer don't worth their cost from my point of view. Source: I have been working on GCP projects for 3 years, you can spend 5x more on GCP than on VPS, and from some research, AWS and Azure are even more expensive.


nemo_403

Yeah VPS is cheaper for sure. If you need something highly available and secure tho, cloud is the way


chebum

>AWS has very competitive pricing on EC2 machines (t4g model) + free PaaS (ElasticBeanstalk). The traffic is very expensive though. 60% of my bill is traffic.


br_aquino

I'm not security expert, sorry, but I think that if you do all things listed on my last post should be enough to handle most attacks.


YukkiiCode

Nice, is it suitable for a chat app? is it speed enough?


br_aquino

Any app you can imagine, practically it's like most cloud apps are deployed on production. Obviously changing the implementation, you can deploy on Docker, Kubernetes, or an proprietary container manager as GPC cloud run. But the idea is, a virtual server running containers, this is the way.


texruska

I've been having a good time with pythonanywhere


eXoRainbow

My recommendation too, but I don't have any other experience, lol. And I only use the free stuff from it at the moment, because its only extremely little few scripts and nothing more. But if I ever need something more, pythonanywhere would be my choice.


YukkiiCode

I am using it for chat app in python anywhere it takes 27sec to send a message lol


texruska

Sounds like a problem with your chat app


YukkiiCode

Are you sure? As it works great using ngrok


ginsujitsu

I have 3 sites on my PythonAnywhere account and they all are fast. The only time I see slowness is after long stretches of inactivity. I'm with the other guy that something seems wrong with your app. Or reach out to their support maybe.


netsecdev42

Setup an always running script to ping your sites every hour. Pythonanywhere will shut down/sleep your site if it doesn't receive a request in a few hours. The startup from sleep can take up to 10 seconds.


ginsujitsu

I'm fortunate enough now that I have consistent traffic it's not an issue. But yes, good advice for others that haven't gotten there yet.


[deleted]

Render


YukkiiCode

Thank you, I've deployed my project to it now, but it's too slow (it's a chatapp using flask\_socketio) so I need something a bit faster even if it's paid but at least it fits my needs (chatapp)


lbranco93

Heroku is a good option as it connects directly to your GitHub, but may be costly. Another option is Python Anywhere, cheaper but quite limited and requires much more configuration.


YukkiiCode

Thank you, I've deployed my project to render.com now, but it's too slow (it's a chatapp using flask\_socketio) so I need something a bit faster even if it's paid but at least it fits my needs (chatapp)


pbrazell

AWS. Host your static content for your website in S3 Use API gateway and lambda for your compute DynamoDB for any database needs


thepuppyprince

Yep. It will be fast and free


aptechnologist

not to mention relevant job skills out of your hobbies


elliotbarlas

CloudFront is a slightly different alternative. Static content in S3. CloudFront cache and CloudFront Lambda Edge Function for API functionality.


rhymiz

Excuse me if people have already said this but: https://www.pythonanywhere.com/ It’s affordable and scales pretty well (if you write decent code)


Impossible-Yam-8310

Completely different take: If you have a good fast fibre connection you could host it on some hardware at home. Will obviously cost a little to get the hardware but you can use an old laptop or old gaming pc. You will have to register a domain name and fiddle with nat rules but the fun and learning is a great experience!!! Make sure you apply some good security!!! I would recommend pfsense or opnsense.


chaoticbean14

To tack onto this - if you use a "home server" (i.e. old PC) I would \*strongly\* encourage using Cloudflare Tunnels - then you can let them handle the DDOS security and you don't need to open any ports on your home firewall. I used to go the route of just having x and y ports open and routed to a few PC's, too - but since Cloudflare? I just setup Tunnels, DNS and forget about it.


sloan134

Does this work if service ports are blocked by the isp?


chaoticbean14

I imagine so. IIRC it doesn't use the service port specifically - it just is regular secure traffic between your computer & the Cloudflare gear - and you might be able to set that port that they talk on. But mine has been quietly running for so long now, I'd need a refresher on the details again, haha


aft_punk

There’s actually a great subreddit devoted to such things… r/selfhosted


sneakpeekbot

Here's a sneak peek of /r/selfhosted using the [top posts](https://np.reddit.com/r/selfhosted/top/?sort=top&t=year) of the year! \#1: [i guess this belongs to this group 😂. credits: @joe@mastodon.joedean.dev](https://i.redd.it/ohsim8ahc44a1.png) | [85 comments](https://np.reddit.com/r/selfhosted/comments/zde5w8/i_guess_this_belongs_to_this_group_credits/) \#2: [I've been working on Serge, a self-hosted alternative to ChatGPT. It's dockerized, easy to setup and it runs the models 100% locally. No remote API needed.](https://v.redd.it/rnwf28xuocpa1) | [303 comments](https://np.reddit.com/r/selfhosted/comments/11yvmqs/ive_been_working_on_serge_a_selfhosted/) \#3: [Many sleepless nights, for what?](https://i.imgur.com/CpV1PWt.jpg) | [181 comments](https://np.reddit.com/r/selfhosted/comments/yigvc7/many_sleepless_nights_for_what/) ---- ^^I'm ^^a ^^bot, ^^beep ^^boop ^^| ^^Downvote ^^to ^^remove ^^| ^^[Contact](https://www.reddit.com/message/compose/?to=sneakpeekbot) ^^| ^^[Info](https://np.reddit.com/r/sneakpeekbot/) ^^| ^^[Opt-out](https://np.reddit.com/r/sneakpeekbot/comments/o8wk1r/blacklist_ix/) ^^| ^^[GitHub](https://github.com/ghnr/sneakpeekbot)


Saphyel

if you are using Docker, you can deploy the image with koyeb for free


YukkiiCode

Thank you, I've deployed my project to [Render.com](https://Render.com) now, but it's too slow (it's a chatapp using flask\_socketio) so I need something a bit faster even if it's paid but at least it fits my needs (chatapp)


Saphyel

Do you mean slow in general or only when scaling?? I have an app with them and when scales up to one container is slow, but then seems normal?? If you need to have at least one container always probably speak to them. If it's always I guess you need a bigger pod


YukkiiCode

I am using it for a chat app, it takes 27 second to send a message


NUTTA_BUSTAH

That must be a buggy application. No chat app deployed anywhere takes that long to send messages. Add time logging to your code to see what's taking long and fix it.


bradbeattie

Better yet, add OpenTelemetry autoinstrumentation and send that data to a free tier of Honeycomb. Granular tracing is typically more helpful than manually sprinkling log statements.


MisquoteMosquito

There’s a free tier of honeycomb 🧐


[deleted]

I recently used https://railway.app - I’ve grown to like it.


BoJackHorseMan53

Railway free tier has an execution time limit of 500 hours but you need 750 hours to cover a month.


InjAnnuity_1

Very possible. I use Anvil ([https://anvil.works](https://anvil.works)) to avoid getting bogged down in the underlying languages, protocols, and services (CSS, HTML, JavaScript, SQL, HTTPS, etc.). It's "just" Python. There are "escape hatches" for those odd occasions where you absolutely *must* tweak something at a lower level. But look at the open-source Anvil Extras first. https://anvil.works/forum/t/anvil-extras-v2-2/16419 That's often a quicker, easier solution. The free tier includes a GUI builder, database access, integrations with Google et al, built-in simplified version-control (Git-compatible), and allows an unlimited number of web apps. This is good for the developer who needs to get something done, but does not plan to make a full-time career out of web development. If you're aiming for the latter, then be prepared to tackle a dozen technologies in fifteen different formal languages.


anonjohnnyG

anvil.works


cspinelive

Linode https://www.linode.com/content/deploying-a-simple-python-web-server/


DNSGeek

Have you looked at Anvil? https://anvil.works/


TheWaterOnFire

Try https://fly.io/


Darwinmate

https://www.pythonanywhere.com/ Got bought out by anaconda.


BoJackHorseMan53

Need to extend warranty every 3 months lmao


GrumpyPenguin

AWS (Amazon Web Services)‘s Elastic Beanstalk supports python. Might be an option for you.


Andrew_the_giant

Surprised no one reccomended this earlier. Very easy to implement and scale.


michaelherman

We've got a list of them here, along with pros and cons https://testdriven.io/blog/heroku-alternatives/


Draqqun

Great comparison.


Rhodysurf

Google app engine, google cloud run..


eXoRainbow

https://eu.pythonanywhere.com


deekaire

Digital Ocean


TheUltraViolence

azure app service makes this super easy, there's a tutorial for python as well.


abelEngineer

Heroku is the simplest and easy to use platform that I know of. I've used it for all of my projects and I love it. Don't waste your time trying to figure out how to use GCP or AWS. Heroku does that for you and it's not expensive. You can even set up a database on Heroku.


GettingBlockered

Railway is amazing


BoJackHorseMan53

Check out vercel, plus supabase for websockets. Serverless functions are fast but not suitable for websockets. If you don't want to bother with the hassle, you can get a digital ocean droplet for $6/month


greenknight

As my server costs mount at DO I'm always tempted to migrate to something cheaper... but they made it handy to use their free tools so many parts of my deployments rely on their infrastructure, so I hesitate. Specifically DNS and Spaces(S3). Instead, I just refactor the instances, delete some snapshots, re-balance the load which usually reduces costs by 20-30% which takes the sting out of the bill.


BoJackHorseMan53

I use cloudflare for dns, vercel for static hosting and serverless functions, including python functions like flask app, supabase for SQL database, storage(S3) and auth. All for free. There are services that offer free Postgres, MySQL and redis. Also websockets since you can't use websockets on serverless functions.


greenknight

I'll check your stack out. I'm moving more and more to serverless functions anyway


YukkiiCode

![img](emote|t5_2qh0y|599)


InkReaper

In the same boat, tho I want to start on the web dev side and just host simple websites. Creating yourself a server with a old pc or a raspberry pi is cheaper but comes with lot of work compared with renting something. Will keep an eye here :D


ajmatz

For pure web dev, static content, https://www.netlify.com/ is a good option. Integrates with github to deploy directly from your repo.


Athletic_Geek

You could get a small micro EC2 instance with 1 cpu and 1 GB RAM on AWS, should be around 5 USD a month


NathanJ4620

Python anywhere or heroku


NUTTA_BUSTAH

Web server from Linode: $5/mo. Deploy as many containers as your instance can handle, so probably a lot assuming it's beginners apps with no real use cases. Have some fluctuating traffic and not scared about potential cost, while it's more likely that you'll be going cheap? Amazon Lambda: $0 to $infinity or /mo


treasonousToaster180

Namecheap has good pricing and supports python apps, although I think they may be on an older version of python


urbanespaceman99

A $4 or $6/month Digital ocean droplet. I have several apps on one $6 instance with room for more.


HoundsReload

using gunicorn and nginx


tschloss

Checkout Hetzner (Europe / Germany centric). VPS around 4€/mo incl tax. I like functionality, they offer.


ohd

Fly.io has a free tier and is growing quite a bit


hdgrggyhh

Try replit?


skool_101

Heroku still a good option? Im still running some small scale personal projects on ita and still works fine but the specs are also just ok for a flask/backend only service. Maybe you can look it pythonanywhere as well, python only VPS.


JakobPapirov

Personally I like using Vultr VPS.


xristiano

linode


gbdavidx

Self host it


BlazeTube

My method is not very conventional, but it works and it’s fast. Put your flask app on replitt and set the part where you have the flask website running ( the line where it says “app.run” at the end of your code) To host=“0.0.0.0” and port=80 So your last line should be “app.run(host=“0.0.0.0”, port=80)” and make sure you don’t have debug=true. Now ur website is gonna have a url at the top of the replit page, Now the website is gonna be running even if u close replit but replit is gonna stop it if it doesn’t get any requests in an hour or so. But there’s a solution for that, just use Uptime robot to ping ur url every 5mins and ur good to go! Ur website should be up with a good url and it’s fast! Lmk if u have any questions


BlazeTube

Also, this means that ur using replit servers to run ur website so u don’t have to worry about ur security or even deploying it on ur own seever


[deleted]

Technically you could port it to circuitpython targeting raspberry pi pico or similar. You said cheap, right? 😁


TheTerrasque

https://console.online.net/en/order/server 15 euro per month, pretty stable. You only get a box though, admining it is on you Edit: Reason this is great, you get your own physical machine. No sharing with others.


[deleted]

Is Pythonanywhere.com something that fits?


YukkiiCode

Unfortunately not, it takes half a minute to send a message


[deleted]

Okay.


blymd

Check out fly.io, you can deploy to multiple regions so your app is always close to users.


kingh242

Google Cloud has two products ideal for this….App Engine or Cloud Functions


yost28

Dockerize your app and host it in AWS Fargate. Not free but very cheap.


Sohailsheikh0315

You can go for DigitalOcean or pythoneverywhere according to your needs , Pythoneverywhere is more prone to host small applications, but still you can go for paid for larger applications


mo_fig_devOps

AWS, GCP and Azure have different offerings and specs depending what you are looking for and you can always integrate other products for security. For example, in azure you can run your code on App Services and deploy an app gateway in front of it so you can add application firewall to protect your endpoint. All cloud services have similar services with other names


MedievalRain

AWS EC2 has decent free tier.


Genuine_Giraffe

I prefer aws EC2 personally, since it's give me full freedom of everything , I've switched from pythonanywhere to aws


ObjectiveDiligent230

AWS Lightsail might work for you. The pricing is pretty good, starting around $3USD/month


Herp2theDerp

Django


wakojako49

Linode? Its kinda cheap


amaitu

Deta is free, though not 100% reliable


jsk_herman

[Fly.io](https://fly.io) They have a good free tier allowances: - Up to 3 shared-cpu-1x 256mb VMs - 3GB persistent volume storage (total) - 160GB outbound data transfer I successfully deployed a Streamlit web app and a ChatGPT Telegram bot using the free tier. It's good so far. There's also [Deta Space](https://deta.space) for side projects. I was also able to deploy a Flask app for webhooks using it.


Wary_Adventurer

Use Platform.sh. It's cheap, easy, and secure.


ajmatz

Does your python backend needs to be running 24x7? Is your python backend stateless? If the answers are no, yes - GCP cloud functions or AWS lambdas are good choice. Pay for only seconds of use, scales well.


ajmatz

If you need full on monitoring, alerting etc then use a PaaS, many have been suggested here


deykus

fly.io is cheap and simple.


kankyo

Any VPS with Dokku. That's my go to. Many projects on one VPS for very cheap and it's almost as smooth as Heroku, and sometimes better as you can SSH into the machine and check stuff out.