Run Python WSGI apps on cPanel via the Python Selector. Pick an alt-python version, set the entry point, manage with Pip Install.
The cPanel Setup Python App tool registers a Python WSGI app under your account, builds a virtualenv, and hands the running process to Phusion Passenger.CloudLinux ships Python interpreters as alt-python packages. Each app picks its own version, and the virtualenv lives separate from the system Python.
Reads requirements.txt and installs into the per-app virtualenv.
Stop App
Halts Passenger for this app. The URL returns 503.
Restart
Equivalent to touch tmp/restart.txt. Reloads the running app.
Edit
Reopens the form. Saving overwrites the .htaccess.
Destroy
Removes Passenger registration and the per-app virtualenv.
The Configuration files field accepts paths like requirements.txt (relative to the application root). The Environment variables editor sits below the buttons.
Your code does not run a development server. No app.run(), no manage.py runserver.
Calling app.run() (Flask) or runserver (Django) inside a Passenger-managed app makes Passenger see no application and return a 500 with passenger_wsgi.py did not provide an "application" callable. Remove the call.
Native ASGI (FastAPI, Starlette, Channels) needs a WSGI shim. The common bridge is asgiref.WsgiToAsgi reversed, but Passenger’s WSGI mode does not handle WebSockets or HTTP/2 streaming over ASGI. For a sync FastAPI subset, wrap with a2wsgi:
passenger_wsgi.py
from a2wsgi import ASGIMiddlewarefrom main import app as asgi_appapplication = ASGIMiddleware(asgi_app)
For real WebSockets, run Daphne or Uvicorn outside the Selector.
passenger_wsgi.py doesn’t expose a top-level name application. Either rename your callable to application, or alias it: application = app.
ImportError on a package that pip just installed
The package was installed against the system Python, not the per-app virtualenv. Run Pip Install from the cPanel UI, or activate the env in SSH first: source ~/virtualenv/<app>/<ver>/bin/activate.
Static files 404 on Django
Passenger only serves the WSGI app. Run manage.py collectstatic and serve /static/ directly from Apache. Add to .htaccess:
Alias /static/ /home/<user>/myapp/static/<Directory "/home/<user>/myapp/static"> Require all granted</Directory>
`pip install pandas` (or numpy) runs out of memory
PMEM is ~1 GB. Heavy compiled wheels can OOM. Use prebuilt wheels (the default for pandas / numpy on linux x86_64), avoid --no-binary, and consider installing one package at a time.
Boot times out on a Django app
Default Passenger startup timeout is 60 seconds. Long migrations or heavy INSTALLED_APPS initialization can exceed it. Bump the timeout in .htaccess: