Run Python on cPanel: Step-by-Step Beginner’s Guide with Python Selector

Python on cPanel: Complete 7-Step Beginner’s Guide with Python Selector

🐍 Introduction

Do you want to run Python applications on cPanel without a dedicated server?
With CloudLinux’s Python Selector, you can easily choose your Python version and manage your applications directly from cPanel.

This comprehensive beginner-friendly guide shows you step by step how to create, upload, configure, and launch your Python application.

With this guide, you will learn how to:

  • Create a Python application on cPanel
  • Upload and organize your files properly
  • Install dependencies using pip
  • Restart and manage your application easily

You don’t need a dedicated server or advanced skills to follow this tutorial.

🔧 What You’ll Need

  • A cPanel account with a CloudLinux-compatible hosting provider.
  • The Setup Python App module enabled (Python Selector).
  • A Python version such as 3.9, 3.10, or 3.11.
  • Your Python project ready to upload (Flask or Django recommended).
  • SSH or FTP/SFTP access to transfer your files.

🚀 Step 1: Creating Your Python Application

  1. Log in to cPanel: https://yourdomain.com:2083
  2. Go to Software → Setup Python App.
  3. Click Create Application and configure:
    • Python Version: choose the version you want.
    • Application Root: e.g., pythonapp
    • Application URL: e.g., https://yourdomain.com/pythonapp
    • Startup File: e.g., app.py or wsgi.py
  4. Click Create, then temporarily stop the application (we’ll start it after uploading your code).

📂 Step 2: Uploading Files

  1. Log in via FTP/SFTP or cPanel File Manager.
  2. Upload all files except your local venv (virtual environment).
  3. Ensure that requirements.txt and the startup file are present.

📦 Step 3: Installing Dependencies

Open the integrated terminal or connect via SSH, then type:

cd pythonapp
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Tip: Always install dependencies on the server for the application to work correctly.

🧠 Step 4: Managing Your Application

  • Restart the application after each change using the Restart button.
  • Change Python version if needed via Python Selector.
  • Check logs: ~/pythonapp/logs or via SSH: tail -f ~/pythonapp/logs/error.log
  • Environment Variables: configure your keys and secrets in cPanel (e.g., SECRET_KEY).

🧩 Step 5: Example Flask Application

# app.py
from flask import Flask
app = Flask(__name__)

@app.route("/")
def home():
    return "Welcome to your Python application via cPanel Python Selector!"

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)

💡 Step 6: Tips for Beginners

  • Follow the order: creation → upload → install dependencies → start.
  • Never copy your local venv folder; always create the environment on the server.
  • Test your application after each change to quickly detect errors.
  • Document your environment variables to avoid losing keys or secrets.

❓ Step 7: Beginner FAQ

  • Q: Can I use any Python version?
    A: Use a version supported by your hosting provider, such as 3.9, 3.10, or 3.11.
  • Q: Should I copy my local venv folder?
    A: No, always create the virtual environment on the server.
  • Q: How do I know if my application is working?
    A: Visit the application URL defined in cPanel and check that the page loads correctly.
Christian – Linux & Mobile Developer

✍️ Christian H

Senior Linux administrator, web & mobile developer, and security strategist with over 10 years of field experience.
Graduated in Information Technology from Uganda Martyrs University in 2013.
Specialized in live server recovery, DNS/SPF troubleshooting, mobile-first web apps, and terrain-ready documentation for African sysadmins.

📡 Follow updates on Facebook or explore guides on CongoCloud.net.

Lisez Avant de Partir !

✅ Rejoignez plus de 6 000 organisations francophones 
🇫🇷 qui nous font déjà confiance.
  • Nous rendons l’hébergement web accessible
  • Équipement moderne pour un prix dérisoire
  • Votre participation nous aide à améliorer l’entrepreneuriat des personnes à faible revenu.
VOIR NOS OFFRES
close-link
//></div>
Notre équipe de support client est sur WhatsApp pour répondre à vos questions. Demandez-nous n'importe quoi !</div></div></div><div class=