Skip to content
HoganHost blog

Setting Up a Python App in cPanel

Python powers many web applications, including Flask and Django projects. Setup Python App lets you run a Python application on your account without configuring the server yourself. cPanel creates a separate environment for the app, installs its packages, and starts it under the address you choose.

This guide walks you through creating a Python app and getting it running.

Open Setup Python App

  1. Log in to cPanel.
  2. In the Software group, click Setup Python App.

Create the Application

  1. Click Create Application.
  2. Choose the Python version your app needs. Pick the recommended version unless your project specifies another.
  3. Enter an Application root. This is the folder that holds your app’s files, such as a folder named myapp.
  4. Enter an Application URL. This is the address where the app will appear.
  5. Enter passenger_wsgi.py as the Application startup file.
  6. Enter application as the Application Entry Point, if the field is not already filled in.
  7. Click Create.

The startup file is the script that starts your app. The entry point is the name of the object inside that file that runs your app. Both must match what your code actually contains.

Upload Your Files

Upload your app’s files to the application root, using File Manager or FTP, as covered on Day 4. Include a requirements.txt file that lists the packages your app needs.

Install the Packages

On the application’s page, click Run Pip Install and select requirements.txt. Wait for the installation to finish. If the button is greyed out, save the requirements file first, then return to the page.

Restart and Test

Click Restart on the application’s page. Open the Application URL in a browser. If you see a 500 Internal Server Error, check the stderr.log file in the application root for the error message. A missing package is the most common cause.

Keep the App Secure

Store passwords and keys as environment variables in the app’s settings rather than inside your code. Never publish the file that holds them.

Running a Python app on a plan built for it? Compare HoganHost’s VPS hosting options for more control, or HoganHost’s cPanel shared hosting plans for simpler sites.

Share this article
Written by

Join the conversation.

Your email address will not be published. Required fields are marked *

Your next chapter starts here

Put your next big idea online.

The right hosting. A name of your own. A real team in your corner.

Explore Hosting