Skip to main content
Our cPanel hosting supports Python web applications through the Setup Python App feature (CloudLinux Python Selector), which runs WSGI applications such as Flask and Django via Phusion Passenger.

Creating a Python application

  1. Log in to cPanel.
  2. In the Software section, click Setup Python App.
  3. Click Create Application and complete the form:
    • Python version: choose the version your app needs.
    • Application root: folder for the app (e.g. pyapp), relative to your home directory.
    • Application URL: domain or subdomain/path where the app is served.
    • Application startup file: typically passenger_wsgi.py (created automatically).
    • Application Entry point: the WSGI callable, typically application.
  4. Click Create.
cPanel creates a virtual environment for the app and wires up the URL.

A minimal Flask example

Activate the app’s virtual environment over SSH (the activation command is displayed at the top of the app’s page in cPanel), then:
Create app.py in the application root:
Edit passenger_wsgi.py to load it:
Then click Restart on the app in cPanel.

Installing dependencies

With the virtual environment activated over SSH:
Or add packages one at a time with pip install. cPanel’s Python App page also lets you install packages listed in a requirements.txt via the interface.

Django notes

Django works well under this setup:
  • Point passenger_wsgi.py at your project’s WSGI module:
  • Run management commands (migrations, collectstatic) over SSH inside the virtual environment.
  • Serve static files from a folder mapped under your document root, or via WhiteNoise.

Troubleshooting

  • Check stderr.log in the application root for startup errors.
  • After code changes, always Restart the application.
  • Import errors usually mean dependencies were installed outside the app’s virtual environment — activate the right environment and reinstall.
If you need help getting a Python application running, our support team is happy to assist.