How to set up a Python application in cPanel

January 15, 2025 / cPanel & WHM

This guide will walk you through the process of setting up a Python application in cPanel, either via the graphical interface or the command line.

Note: Python applications in cPanel are available for users with shared hosting or reseller hosting plans. If you are a managed VPS hosting customer, a CloudLinux license is required.

Steps to set up a Python application in cPanel:

  1. Log in to cPanel.
  2. Find the “Software” section and click on the “Setup Python App” icon.
    setup python
  3. On the Python selector page, click the “Create Application” button.
    create application
  4. Fill Out the application setup form:
    1. Python version: Select the Python version your application will use.
    2. Application root: Specify the directory where your application files will reside.
    3. Application URL: Provide the URL to access your application.
    4. Application startup file: Enter the path to the wsgi.py file (or equivalent startup file).
    5. Application Entry point: Leave this blank unless your application requires a specific value. cPanel will populate this automatically.
    6. Passenger log file: You can define the path along with the filename.
      create application
  5. Create the Application
    Click CREATE to complete the setup. Once done, a command will be displayed to activate the virtual environment. This is beneficial for executing commands manually through SSH or the terminal in cPanel.
  6. Click Run Pip Install to install any dependencies required by your application.
  7. Set up environment variables (Optional):
    1. Click “Add Variable” to define the name and value of any additional variables.
    2. After entering the details, click “Done” to save the variable.
  8. Save and Restart Your Application:
    1. Ensure everything is set up correctly.
    2. Click “Save” and “RESTART” to finalise your application setup.

That’s it! You have successfully set up a Python application using cPanel. You can now start building and managing your Python-based projects with ease.

Spread the love