Deploy your first Python app on NeoHeberg

2 min read07 November 2026

Python on application hosting works like Node.js: you provide an entry point, declared dependencies and a server that listens on the platform port. No system access or virtualenv activation is needed on the service side.

Prepare the project

The default entry point is main.py. A minimal Flask example:

Python
import os
from flask import Flask

app = Flask(__name__)

@app.get("/")
def index():
    return "Online"

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

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=int(os.environ.get("PORT", "8000")))

Declare dependencies in requirements.txt, with precise versions:

Text
Flask==3.0.3
gunicorn==22.0.0

pip install -r requirements.txt runs at startup. Avoid heavy system dependencies: you cannot install apt packages on this hosting.

Create the service

In the dashboard, choose application hosting, then Python and a version (3.12 or 3.11, for example). Name the service and check the allocated resources. The application must stay within these limits, memory included: a Python process loading a large model can exceed RAM before serving a single request.

Upload the files

Upload main.py, requirements.txt and your project files through the panel file manager, then extract the archive if needed. Do not upload .venv or __pycache__: they are local and may contain incompatible paths.

Start and verify

Start the service and open the console. You should see dependency installation, then server startup. Test the / and /health routes on the provided allocation. If Flask prints Running on http://0.0.0.0:..., the process is listening correctly.

For a real service, replace the Flask development server with Gunicorn if the start command allows it:

Bash
gunicorn --bind 0.0.0.0:$PORT main:app

Update and secure

After a change, upload the files, restart and check the logs. Put secrets (API key, connection string) in the panel environment variables. Do not write them in main.py or in a .env file uploaded by mistake.

Advertisement

Was this article helpful?

Read next