How To Setup Flask On Python Hosting Print

  • 1

Flask is a lightweight Python web framework that can easily run on any Python-enabled hosting plan. Here’s a clear step-by-step guide to get your Flask application live on your cPanel Python hosting.

  1. Log in to your cPanel account.
  2. Under the “Software” section, click on “Setup Python App”.
  3. Click the “Create Application” button.
  4. Choose the Python version you need (e.g., 3.9, 3.10, or higher).
  5. Set the Application root (this is the folder where your Flask project will live, for example: flaskapp or myproject).
  6. Set the Application URL (choose the domain or subdomain where the site will be accessible).
  7. In the “Application startup file” field, type app.py (or the exact name of your main Flask file).
  8. In the “Application entry point” field, type app (this is the variable name of your Flask instance, e.g., app = Flask(name)).
  9. Click “Save” or “Create” at the top of the page.
  10. Once the application is created, click the “Restart” button to start it.
  11. Upload your Flask project files (including app.py, requirements.txt, etc.) to the specified application root folder using File Manager or FTP.
  12. Open the terminal in cPanel (or via SSH) and run the following inside the virtual environment folder to install dependencies:
    pip install -r requirements.txt
  13. Your Flask site should now be running and accessible via the domain/subdomain you selected.

Was this answer helpful?

« Back