Knowledgebase

How to Deploy a Python (Flask/Django) Application on cPanel Print

  • 0

A step-by-step guide to configuring Passenger WSGI and running Python applications on Web Savanna server environments.

Web Savanna provides built-in Python support through cPanel’s Setup Python App tool powered by CloudLinux LVE / Phusion Passenger.

Step 1: Create the Python Environment

  1. Log into cPanel.

  2. Under the Software section, click Setup Python App.

  3. Click Create Application.

  4. Configure your application settings:

    • Python Version: Select Python 3.10 or 3.11 (recommended).

    • Application Root: Enter your application directory (e.g., myapp).

    • Application URL: Select your domain/subdomain path.

    • Application Startup File: Set to passenger_wsgi.py.

    • Application Entry Point: Set to application.

  5. Click Create.

Step 2: Install Virtual Environment Dependencies

  1. Copy the virtual environment activation command shown at the top of your Python App page (e.g., source /home/username/virtualenv/myapp/3.11/bin/activate).

  2. Log into your account via SSH or open cPanel Terminal.

  3. Paste the activation command and press Enter.

  4. Install your project requirements:

    Bash
     
    pip install -r requirements.txt
    

Step 3: Restart the Application

Whenever you modify your Python scripts or update packages, return to Setup Python App in cPanel and click Restart Application to apply changes.


Was this answer helpful?
« Back