---
title: "Python hosting on Fly.io: deploy Flask, FastAPI and workers with one command"
description: "Python hosting on Fly.io. fly launch detects Flask or FastAPI and writes the config; web apps, workers and bots run as separate processes, billed per second."
---

# Python hosting on Fly.io: deploy Flask, FastAPI and workers with one command

Build and scale Python apps on a developer-focused public cloud.

[Launch Now](https://fly.io/app/sign-up)

Ready, Set, Go!

## Speedrun Your Python App Onto Fly.io

Deploy a Python app to Fly.io in a few minutes with the Fly.io command line tool, `flyctl`.

[Get Started](https://docs.fly.io/python/frameworks)

```
> Install flyctl on GNU/Linux
$ curl -L https://fly.io/install.sh | sh

> Run from Django project root
$ fly launch
  Scanning source code
  Detected a Django app

> Scale CPU, memory, instances & regions
$ fly scale
```

```
> Install flyctl on GNU/Linux
$ curl -L https://fly.io/install.sh | sh

> Run from FastAPI project root
$ fly launch
  Scanning source code
  Detected a FastAPI app

> Scale CPU, memory, instances & regions
$ fly scale
```

```
> Install flyctl on GNU/Linux
$ curl -L https://fly.io/install.sh | sh

> Run from Flask project root
$ fly launch
  Scanning source code
  Detected a Flask app

> Scale CPU, memory, instances & regions
$ fly scale
```

```
> Install flyctl on GNU/Linux
$ curl -L https://fly.io/install.sh | sh

> Run from Streamlit project root
$ fly launch
  Scanning source code
  Detected a Streamlit app

> Scale CPU, memory, instances & regions
$ fly scale
```

Not on GNU/Linux? [Install flyctl for your platform.](https://docs.fly.io/flyctl/install)

Effortless Deployments

## From Project Root to Production in One Command

Run `fly launch` from your Python project root. It scans the source, detects Django, FastAPI, Flask or Streamlit, writes a `fly.toml` and a Dockerfile (or uses the Dockerfile you already have) and offers to create a database. Every release after that is one `fly deploy`. There are no servers to set up and no load balancer to configure: Fly Proxy routes requests to your Machines and terminates TLS with managed certificates.

Idle-Free Infrastructure

## Save Costs With On-Demand Scaling

Fly.io automatically scales your Python app based on demand, handling traffic spikes effortlessly. Built-in load balancing ensures even traffic distribution, maintaining optimal performance and reliability without overloading any single instance. No traffic? No worries. With Fly Proxy, your instances can dynamically stop based on incoming requests, optimizing costs and resources during idle periods.

Rock-Solid Security

## Safe and Sound, All Around!

Deploy your Python app with Fly.io's robust security features. Benefit from encrypted private networking, automated SSL/TLS certificate management, and secure data volumes. With Fly.io, you can focus on crafting exceptional Python apps, knowing that your infrastructure is fortified.

[Read more about our security features](https://fly.io/security/)

## Trusted by teams at

- **S3-Compatible Object Storage**
  Tigris is S3-compatible object storage run on Fly.io. Run `fly storage create` and it creates a bucket and sets its credentials as secrets on your app, so an S3 client such as boto3 reads them from the environment with no extra configuration.
  
  [Read more](https://docs.fly.io/tigris)
- **Databases & Services**
  We do offer Fly Postgres. Not enough? Opt for Supabase. Is SQLite enough? Choose LiteFS. Need an in-memory cache? Use Upstash. With Fly.io, you can integrate databases and services right next to your app.
  
  [Read more](https://docs.fly.io/database-storage-guides)
- **Built-in Observability**
  Monitor, troubleshoot, and fine-tuned your Python apps with real-time metrics and logging through Fly.io's built-in observability tools, featuring Grafana with integrated Prometheus metrics directly from the dashboard.
  
  [Read more](https://docs.fly.io/monitoring)

## Ready for Liftoff?

Fly.io is designed for Python developers looking to deploy robust, efficient, and scalable applications effortlessly. Get your Python app live in minutes with `fly launch`, and add Machines, CPU or memory later with `fly scale`. Eliminate infrastructure concerns and focus on crafting exceptional applications.

[Get Started](https://fly.io/app/sign-up)
