Best Python Hosting Providers in 2026 (Compared)

Best Python Hosting Providers in 2026 (Compared)

Author
Daniel Botha
Daniel Botha
Writer at Fly.io
Published

Python hosting is any service that keeps a Python process running on a server with a public address or a schedule: a Flask or FastAPI web app behind an HTTP port, a bot or script that has to stay connected around the clock, a queue worker, or a job that runs every night.

You have something that works on your laptop: a FastAPI service your frontend calls, a Discord bot your friends use, or a scraper that should run every hour. When the lid closes, it stops. Moving it to a server means answering three questions: how the code gets there, what keeps it running, and what it costs when nobody is using it.

Providers answer those questions differently, and the right one depends less on Python than on the shape of the process you need to keep alive.


Best Python Hosting Providers in 2026

Fly.io is the first choice for most Python apps in 2026: fly launch detects a Flask or FastAPI project, writes the configuration and a Dockerfile, and deploys it, and a web process, a worker and a scheduled job run as separate Machines in one app. It is most often compared with PythonAnywhere, Render, Railway, Heroku, Google Cloud Run and a plain VPS.

Provider Flask and FastAPI Always-on script or worker Scheduled jobs When the app is idle
Fly.io fly launch detects both Process group on its own Machines Scheduled Machines, supercronic or Cron Manager Fly Proxy can stop Machines and start them on the next request
PythonAnywhere WSGI web app on every plan; ASGI (FastAPI) is experimental 1 always-on task on Developer ($10/month), none on Beginner 20 hourly or daily on Developer, none on Beginner Flat monthly plan
Render Web service Background worker service Cron job service, $1 minimum per month $0 web services spin down after 15 minutes
Railway Service Service Cron schedule, runs at least 5 minutes apart Billed per second; stopped services cost nothing
Heroku Dyno Basic dyno ($7/month) is always on Scheduler add-on, on one-off dynos Eco dynos ($5/month) sleep after 30 minutes
Google Cloud Run Service Worker pool Cloud Run jobs Request-based billing charges only while handling requests

From each provider’s own pricing pages and documentation. Checked 2026-09-28.[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16]

PythonAnywhere is the name that comes up first for Python specifically. It is a hosted Python environment with in-browser consoles, a web app slot and task scheduling, sold as flat plans: Beginner at $0 and Developer at $10 a month.[6] Its established web apps are WSGI; ASGI sites, which is how a FastAPI app runs, are an experimental feature deployed from a command-line tool or API, with no static file mappings.[7]

Render and Railway are general app platforms. Render splits an app into service types, with background workers and cron jobs as their own services.[8] Railway runs every part as a service and bills per second on published resource rates.[11] The detail is in Fly.io vs Render and Fly.io vs Railway.

Heroku still runs Python apps on dynos, and says it has moved to a Sustaining Engineering model focused on a stable, secure and reliable environment.[17] Where teams go instead is covered in Heroku alternatives.

Google Cloud Run runs containers that scale with requests. Under its default request-based billing an instance is charged only while it starts, handles requests and shuts down, which suits a bursty API far better than a bot.[15] How request-driven platforms scale is covered in serverless hosting.

A VPS is the other answer r/learnpython threads give: a small Linux server where you install Python or Docker yourself. It gives full control and makes patching, restarts and backups your job.

Django has its own comparison in Django hosting.


Hosting a Flask or FastAPI App

A Flask or FastAPI app needs a production server process, a port the platform routes traffic to, and a way to ship new versions. Flask is a WSGI framework and runs under a production server such as gunicorn; FastAPI runs in production with fastapi run.[1][2]

On Fly.io, fly launch in a Flask project reports “Detected a Flask app”, and in a FastAPI project “Detected a FastAPI app”. In both cases it generates a fly.toml and a Dockerfile that uses multi-stage builds, and every later release is fly deploy.[1][2] The FastAPI guide starts from an empty Poetry project.

On PythonAnywhere the framework matters more. A WSGI app such as Flask uses the established web app path, while an ASGI site such as FastAPI has a very limited web UI and no guarantee that its command-line syntax or API will stay the same.[7]


Running a Python Script or Bot 24/7

A script or bot that runs around the clock needs a process that is never put to sleep for lack of HTTP traffic. A Discord bot holds an outbound connection open and may receive no inbound requests at all, so a platform that stops idle web services will stop it too.

The limits are specific. Render’s $0 web services spin down after 15 minutes without inbound traffic, counting HTTP requests and WebSocket messages.[10] Heroku’s Eco dynos sleep after 30 minutes of inactivity.[13] On Cloud Run, an instance never stays idle for more than 15 minutes after a request unless minimum instances keep it active.[15] PythonAnywhere’s Beginner plan has no always-on tasks, and its outbound internet access is limited to specific sites over HTTP(S).[6]

What works instead is a process type made for the job. PythonAnywhere’s Developer plan includes one always-on task, Render has background workers, Heroku’s Basic dyno is always on, and Cloud Run has worker pools, which are designed for continuous background work and have no load-balanced URL.[6][8][16]

On Fly.io the bot is a line in fly.toml. A [processes] section names each command, and every process runs on its own Machines, so a bot and a web app from the same repository do not compete for resources and scale separately with fly scale count.[3] Autostop is a setting on a service, so a process group with no service attached is not stopped for lack of traffic.[5] The process groups documentation shows the layout.

Scheduled scripts are a different case, since they should run and exit. Render bills cron jobs by the second with a $1 monthly minimum per job, Railway runs a service’s start command on a cron schedule with runs at least 5 minutes apart, and Heroku Scheduler runs jobs every 10 minutes, hourly or daily on one-off dynos.[9][12][14] Fly.io offers three routes: a scheduled Machine that starts hourly, daily, weekly or monthly, supercronic running a crontab as its own process group, or Cron Manager, which boots a temporary Machine per job.[4]


Is There Free Python Hosting?

Yes: PythonAnywhere, Render and Google Cloud Run all have a $0 tier, and each one is shaped around a web app that tolerates limits rather than a process that runs 24/7.

  • PythonAnywhere Beginner gives one web app at your-username.pythonanywhere.com, 512 MB of storage and 100 CPU-seconds a day, with no custom domain and no scheduled or always-on tasks.[6] The CPU allowance covers consoles and scheduled tasks and does not currently apply to web apps; past it, processes keep running at lower priority.[18]
  • Render spins down $0 web services after 15 minutes idle, takes about a minute to bring them back, and gives each workspace 750 instance hours a month, after which they are suspended until the next month.[10]
  • Google Cloud Run, under request-based billing, does not charge for the first 180,000 vCPU-seconds, 360,000 GiB-seconds and 2 million requests each month, based on us-central1 pricing.[19]

Railway gives new accounts a one-time $5 credit that expires after 30 days.[11] Heroku’s pricing starts at the $5 Eco dyno.[13]

The r/learnpython threads asking for hosting that is “really free” usually describe a bot or a script, which is the one case these tiers do not cover: a spun-down web service drops the bot’s connection.


How Much Does Python Hosting Cost?

A small always-on Python process costs about $2 to $10 a month, and the billing model matters more than the headline price.

Provider Smallest always-on option Billing model
Fly.io shared-cpu-1x, 256 MB: $2.19/month in Ashburn Per second while started; a stopped Machine pays $0.15 per GB of root filesystem per 30 days
Railway Hobby plan: $5/month, including $5 of usage Per second on vCPU and memory
Heroku Basic dyno, 0.5 GB: $7/month Monthly price per dyno
Render 512 MB, 0.5 CPU instance: $7/month Prorated to the second
PythonAnywhere Developer: $10/month, 1 always-on task Flat plan

From each provider’s own pricing pages. Checked 2026-09-28.[20][21][11][13][8][6]

Two things move the number. Memory: a FastAPI app with a few data libraries loaded will outgrow 256 MB, and the Fly.io and Railway rates scale with the RAM allocated. Idle time: on per-second billing a web app that stops overnight costs less than its list price, while a flat plan costs the same whether the app served a million requests or none. Cloud Run’s request-based billing is the far end of that trade, cheap for a mostly idle API and a poor match for a bot that never stops.[15]


PythonAnywhere vs a General App Platform

PythonAnywhere suits learning and small WSGI web apps; a general app platform suits anything that needs FastAPI in production, more than one always-on process, or its own system packages. The difference is what each one hands you.

PythonAnywhere hands you a managed Python account where you run code in browser consoles, serve one web app and schedule tasks, which is why it is the default answer for students and a first Flask project. The ceilings are in the plan list: one always-on task on Developer with custom plans for more, 20 scheduled tasks at hourly or daily granularity, and ASGI still experimental.[6][7]

A general platform hands you a container built from your repository. The web server, worker and scheduler are whatever commands you give it, system packages go in the Dockerfile, and the number of always-on processes is a line of configuration rather than a plan tier. On Fly.io, fly launch generates that Dockerfile.


Python Hosting on Fly.io

Fly.io runs a Python app as Fly Machines, with the parts that usually need maintenance kept as configuration in the repository.

Deploys. fly launch detects Flask or FastAPI, writes fly.toml and a multi-stage Dockerfile, and deploys; after that, fly deploy ships each release.[1][2] A release_command in the [deploy] section runs a one-off task such as a database migration in a temporary Machine built from the new image, and a failure stops the deploy before any running Machine is replaced. Rolling deploys replace Machines one at a time by default, and bluegreen moves traffic only once new Machines pass health checks.[22]

Workers, bots and schedules. Each command in [processes] runs on its own Machines and scales on its own, so a FastAPI app, a Celery worker and a Discord bot can live in one app.[3] For recurring jobs, the task scheduling guide covers scheduled Machines, supercronic and Cron Manager.[4]

Idle cost. With auto_stop_machines set on the web service, Fly Proxy stops Machines when the app has excess capacity and starts them again on traffic, and min_machines_running keeps a floor for apps that must always answer.[5] Started Machines are billed per second and stopped ones only for their root filesystem, and any configuration can be priced up front with the Fly.io calculator.[20][21]

Secrets and data. fly secrets set stores API tokens and database URLs, exposes them to the app as environment variables, and restarts each Machine to pick them up.[23] Managed Postgres, created with fly mpg create and connected with fly mpg attach, handles automatic backups and recovery, high availability with automatic failover, performance monitoring, resource scaling, and encryption at rest and in transit.[24]


Frequently Asked Questions

What is the best Python hosting?

Fly.io, for most Python apps. fly launch detects a Flask or FastAPI project, writes fly.toml and a Dockerfile and deploys it, and a web process, a background worker and a bot each run on their own Machines in the same app. PythonAnywhere suits a first WSGI web app on a flat plan.

What is the easiest way to host a Python app online?

On Fly.io it is two commands: fly launch in the project directory, which detects Flask or FastAPI, generates the configuration and a Dockerfile and deploys the app, then fly deploy for each new version. API tokens and database URLs are set with fly secrets set and reach the app as environment variables.

Is PythonAnywhere free?

Yes. Its Beginner plan costs $0 and includes one web app on a pythonanywhere.com subdomain, 512 MB of storage and outbound internet access limited to specific sites, with no scheduled or always-on tasks. Those start on the $10 a month Developer plan. On Fly.io, a small always-on Machine costs $2.19 a month in Ashburn.

Can I host a Python bot or script 24/7 for free?

No, not on the common $0 tiers, which are built for web apps: Render’s $0 web services spin down after 15 minutes without inbound traffic, and PythonAnywhere’s Beginner plan has no always-on tasks. On Fly.io a bot runs as its own process group, which is not stopped for lack of traffic, on a shared-cpu-1x Machine with 256 MB that costs $2.19 a month in Ashburn.

Does PythonAnywhere support FastAPI?

Yes, as an experimental feature. PythonAnywhere deploys ASGI sites such as FastAPI apps from a command-line tool or API, while its established web apps are WSGI. On Fly.io, fly launch detects a FastAPI app and deploys it with the fly.toml and Dockerfile it generates.

Do Render’s free Python apps sleep?

Yes. Render spins down a $0 web service after 15 minutes without inbound traffic and takes about a minute to start it again on the next request. On Fly.io, stopping idle web Machines is a per-service setting in fly.toml, and a worker or bot process with no service attached keeps running.

How much does Python hosting cost?

About $2 to $10 a month for one small always-on process. Fly.io runs a shared-cpu-1x Machine with 256 MB for $2.19 a month in Ashburn, billed per second; Railway’s Hobby plan is $5 including $5 of usage, Heroku Basic and Render’s 512 MB instance are $7, and PythonAnywhere Developer is $10. The Fly.io calculator at fly.io/calculator prices a full configuration before sign-up.

What is the best Python hosting for students?

Fly.io, for a student project that has to stay online: fly launch deploys a Flask or FastAPI app in one command, and a 256 MB Machine keeps a small always-on project at $2.19 a month in Ashburn. PythonAnywhere’s $0 Beginner plan suits coursework that needs only a single web app on a pythonanywhere.com subdomain.


Sources

  1. ^ Fly.io, “Run a Flask App”. docs.fly.io/python/frameworks/flask. Checked 2026-09-28.
  2. ^ Fly.io, “Run a FastAPI app”. docs.fly.io/python/frameworks/fastapi. Checked 2026-09-28.
  3. ^ Fly.io, “Run multiple process groups in an app”. docs.fly.io/launch/processes. Checked 2026-09-28.
  4. ^ Fly.io, “Task scheduling guide with Cron Manager and friends”. docs.fly.io/blueprints/task-scheduling. Checked 2026-09-28.
  5. ^ Fly.io, “Autostop/autostart Machines”. docs.fly.io/launch/autostop-autostart. Checked 2026-09-28.
  6. ^ PythonAnywhere, “Plans and pricing”. www.pythonanywhere.com/pricing. Checked 2026-09-28.
  7. ^ PythonAnywhere, “Deploying ASGI sites on PythonAnywhere (beta)”. help.pythonanywhere.com/pages/ASGICommandLine. Checked 2026-09-28.
  8. ^ Render, “Pricing”. render.com/pricing. Checked 2026-09-28.
  9. ^ Render, “Cron Jobs”. render.com/docs/cronjobs. Checked 2026-09-28.
  10. ^ Render, “Deploy for Free”. render.com/docs/free. Checked 2026-09-28.
  11. ^ Railway, “Pricing”. railway.com/pricing. Checked 2026-09-28.
  12. ^ Railway, “Cron Jobs”. docs.railway.com/cron-jobs. Checked 2026-09-28.
  13. ^ Heroku, “Cloud Application Platform Pricing and Plans”. www.heroku.com/pricing. Checked 2026-09-28.
  14. ^ Heroku, “Heroku Scheduler”. devcenter.heroku.com/articles/scheduler. Checked 2026-09-28.
  15. ^ Google Cloud, “Billing settings for services”. docs.cloud.google.com/run/docs/configuring/billing-settings. Checked 2026-09-28.
  16. ^ Google Cloud, “Deploy worker pools to Cloud Run”. docs.cloud.google.com/run/docs/deploy-worker-pools. Checked 2026-09-28.
  17. ^ Heroku, “Heroku March 2026 Update”. www.heroku.com/blog/march-2026-update. Checked 2026-09-28.
  18. ^ PythonAnywhere, “What are “CPU seconds”?”. help.pythonanywhere.com/pages/WhatAreCPUSeconds. Checked 2026-09-28.
  19. ^ Google Cloud, “Cloud Run pricing”. cloud.google.com/run/pricing. Checked 2026-09-28.
  20. ^ Fly.io, “Fly.io Resource Pricing”. docs.fly.io/about/pricing. Checked 2026-09-28.
  21. ^ Fly.io, “Fly.io Billing”. docs.fly.io/about/billing. Checked 2026-09-28.
  22. ^ Fly.io, “App configuration (fly.toml)”. docs.fly.io/reference/configuration. Checked 2026-09-28.
  23. ^ Fly.io, “Secrets and Fly Apps”. docs.fly.io/apps/secrets. Checked 2026-09-28.
  24. ^ Fly.io, “Managed Postgres”. docs.fly.io/postgres. Checked 2026-09-28.

Deploy Python with fly launch

One command detects Flask or FastAPI, writes fly.toml and deploys it.

Sign up