Python application hosting

Run a Python API, bot or worker in the cloud. Choose a persistent application for a server process, or a function and pipeline for work triggered by a request or schedule.

Last updated: 2026-10-26

From source code to a running service

This example is a Flask web application served by Gunicorn. Add both files to your project, install requirements.txt during the build, and use the command below to start the server.

Deployment steps

1

Prepare the project

Add the example files or use your existing project. Install dependencies and check the start command locally before deploying.

2

Configure the application

Create an application in your workspace. Choose the source, start command, environment variables and resource allocation. Web services need a route port; polling bots can remain private.

3

Check the release

Deploy and inspect build and runtime logs. Test web routes on the preview URL. For a polling bot, send /start in Telegram and ensure another process is not using the token.

4

Publish and monitor

Promote a verified web release to production. Keep database migrations separate from application rollback. Monitor errors and resource use after the update.

A minimal project

These examples show application code and startup, not a preconfigured infrastructure template. Test and lock your dependencies before using them in production.

requirements.txt
Flask>=3,<4
gunicorn>=23,<24
app.py
from flask import Flask

app = Flask(__name__)

@app.get("/health")
def health():
    return {"ok": True}

@app.get("/")
def index():
    return {"message": "Hello from Python"}
Start command
gunicorn --bind 0.0.0.0:8080 app:app

Match the deployment mode to the process

A Flask or FastAPI server belongs in an application. A polling bot or queue consumer is a persistent private service. A finite transformation can run as a function; recurring work can be triggered by a scheduled pipeline.

Declare dependencies and storage

List packages in requirements.txt. For reproducible builds, pin the exact versions you have tested. Keep connection strings in environment variables and persistent files on a mounted volume.

FAQ

Can I deploy an existing Python project?

Yes: define its dependencies, working directory and start command. Projects needing system packages can use a Dockerfile. A script that exits after completing its work should be treated as a task rather than a continuously running web server.

Why does the app work locally but not in the cloud?

Check the build and runtime logs separately. Common causes are missing dependencies, an incorrect module name, a missing variable or binding to 127.0.0.1. A public web application must listen on 0.0.0.0 and the port configured for its route.

Does Python hosting include a database?

The example does not provision a database. Create or connect one separately and pass its connection string to the application. Account for database CPU, memory and storage when planning your resource pool.

How much does hosting cost?

Check the current plans and available payment offers in Plan & billing. Size the application and its dependencies against the shared resource pool. Preview replicas and databases also consume resources; an idle application is not automatically free.