If your cPanel has the new design and you do not see Setup Python App, click Classic cPanel theme (top right): it is in the Software section.
With Setup Python App you publish a Python web application, such as Django or Flask, on your domain with the version you choose: 3.14, 3.13, 3.12 and older. cPanel creates a separate virtual environment for each application, so their libraries do not mix.
Before starting: your plan must include applications. Most Cloud Web Hosting plans allow up to four. If you do not see Setup Python App in cPanel, write to us.
1. Create the application
- In cPanel → Software, open Setup Python App and click Create Application.
- Python version: the one your project needs; for a new one, 3.14 if your libraries support it, otherwise 3.13.
- Application root: the folder for the code, e.g.
myapp. Do not use a name likepython314: it clashes with internal names and the app fails. - Application URL: the domain or subdomain, and a path if not at the root.
- Application startup file: leave
passenger_wsgi.py. Application Entry point: leaveapplication. - Click Create.
2. Connect your code
Upload your project to the application folder and edit passenger_wsgi.py so it exposes your app as application:
- Django:
from myproject.wsgi import application, where myproject is the folder containing wsgi.py. - Flask:
from app import app as application, if your Flask object is called app and lives in app.py.
3. Install dependencies
- On the application screen, under Configuration files, type
requirements.txtand click Add. - Click Run Pip Install and choose that file.
- Add to Environment variables what your app reads, such as
DJANGO_SETTINGS_MODULEor the database connection string. - Click Restart.
If your plan has SSH or Terminal, the command starting with source at the top of the screen puts you in the app's virtual environment, where you can run pip install, python manage.py migrate or collectstatic.
Changing version
Edit the application and choose another Python version. Each version has its own environment, so run Run Pip Install again afterwards and restart.
If it does not load
- 500 or “Something went wrong”: almost always an import failing in passenger_wsgi.py. The
stderr.logfile in the application folder says which. - You changed the code and nothing changes: click Restart.
- Django static files without styles: run collectstatic and serve the static folder from public_html or with your project's configuration.
More information
- Article (Spanish): Despliega tu primer aplicativo Python en cPanel
- Video (Spanish): Despliega tu primer aplicativo Python en cPanel