Skip to content
By stack4 min read

Flask hosting for web apps and APIs

Short answer

Flask is a WSGI framework, so it runs directly behind Phusion Passenger with no adapter. It needs Python 3.9 or newer, a virtual environment and a passenger_wsgi.py file that imports your app object. On ArabyHost, Flask apps run on AI/Developer plans with SSH, Git and free SSL.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. What Flask needs in production
  2. Which plan fits Flask?
  3. How deployment works on ArabyHost
  4. Flask for bots and webhooks
  5. Limits to know up front
  6. On ArabyHost

Flask is one of the lightest and most popular Python frameworks for small dashboards, APIs and webhook bots. Because it speaks WSGI, it’s also the easiest framework to deploy on hosting that runs Phusion Passenger: no adapter, no extra server, just a small file that connects Passenger to your app.

What Flask needs in production

  • Python 3.9 or newer: current Flask releases require at least 3.9.
  • A virtual environment: holding Flask and your packages from requirements.txt.
  • A WSGI server: flask run and app.run(debug=True) are for development. In production a WSGI server calls your app object directly.
  • A fixed SECRET_KEY: used to sign sessions, read from an environment variable rather than the code.
  • A database: SQLite for a small app, or MySQL/MariaDB through SQLAlchemy and a driver such as PyMySQL.
  • HTTPS: required for logins and for receiving webhooks from services like Telegram.
What Flask needs What ArabyHost provides
Python 3.9+ Python 3.9 to 3.12 via Setup Python App
A WSGI server Phusion Passenger, no Gunicorn needed
Installing packages SSH in CageFS with pip, plus a Run Pip Install button on the app page
A database MySQL/MariaDB
An HTTPS URL Free SSL issued automatically
Shipping code Git from GitHub, ZIP upload, or Araby MCP from Claude and Cursor
Data protection Daily JetBackup backups

Which plan fits Flask?

Flask apps need an AI/Developer plan: shared, WordPress and WooCommerce plans run PHP only and offer neither SSH nor Python apps. Flask is light on resources, so a small API or internal dashboard usually fits the smallest AI plan. If the app processes images or large files, or runs a bot or worker alongside it, choose a plan with more memory and processes. The hosting calculator helps you estimate.

How deployment works on ArabyHost

  1. In cPanel, open Setup Python App and create an app: Python 3.12, a project folder such as flaskapp, and the URL (a subdomain like api.example.com is simplest).
  2. Upload the code from GitHub with Git Version Control, or as a ZIP.
  3. Write passenger_wsgi.py in the project folder:
import os, sys
sys.path.insert(0, os.path.dirname(__file__))

from app import app as application
# With an application factory:
# from app import create_app
# application = create_app()
  1. Install packages over SSH, or add requirements.txt on the app page and click Run Pip Install:
source ~/virtualenv/flaskapp/3.12/bin/activate && cd ~/flaskapp
pip install -r requirements.txt
  1. Add environment variables such as SECRET_KEY and DATABASE_URL, then click Restart.

A MySQL connection string for SQLAlchemy looks like this:

mysql+pymysql://dbuser:password@localhost/dbname?charset=utf8mb4

The complete walkthrough, including fixes for errors like ModuleNotFoundError, is in the Flask deployment guide.

Flask for bots and webhooks

Flask handles webhooks well: it receives the request, does a short piece of work and replies. That makes it a good fit for a Telegram bot in webhook mode or for payment notifications from a store. Long work, such as processing a file or waiting a long time on a language model, belongs in a separate background worker kept alive by cron; let the webhook record the job and reply straight away. See Telegram bot hosting for webhook versus polling.

Limits to know up front

  • WebSockets: Flask-SocketIO won’t fully work, because Passenger runs Python over WSGI.
  • Long requests: a request that runs for a long time may be cut off; move heavy work to a worker.
  • No root, no Docker: packages that depend on unavailable system libraries may not install.
  • Per-account resources: capped by plan, and Passenger may stop an idle app and start it again on the next request.
  • No public ports: traffic arrives through the domain, not on a port such as 5000.

On ArabyHost

Choose one of the AI/Developer plans, create the app in Setup Python App and connect your GitHub repository through Git Version Control so each update deploys from the panel. You get free SSL issued automatically, the LiteSpeed web server, daily backups and CageFS isolation for your account. If an error page shows up after a deploy, the Araby AI assistant reads the error log and explains the fix, and support helps in Arabic.

FAQ

What goes in passenger_wsgi.py for a Flask app?

Add the project folder to the Python path, then import your app object as application, for example: from app import app as application. With an application factory, write application = create_app().

Do I need Gunicorn to run Flask on ArabyHost?

No. Phusion Passenger acts as the WSGI server: it starts the app and restarts it when needed, so you don't need Gunicorn or an open port.

Does Flask-SocketIO work?

Not fully, because it relies on WebSockets and Passenger runs Python apps over WSGI. For simple live updates, polling from the browser works.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.