Copy link
WHM and the CloudLinux Python Selector make it much simpler to manage several Python environments on a single server. This tutorial focuses on setting up Python web applications in cPanel, managing multiple Python versions, and installing the Python Selector in WHM. You can deploy apps using frameworks like Flask, Django, or FastAPI, assign distinct Python versions to each user, and create isolated virtual environments with CloudLinux with CageFS and alt-python-virtualenv. This tutorial covers everything you need for optimized Python hosting on CloudLinux, whether you’re using WHM to enable the Python Selector or cPanel to set up a Python application.
Make sure your system meets the following requirements:
Step 1: Install the Python selector package:
SSH into your server as root:yum groupinstall alt-python -yyum install lvemanager lve-utils cagefs alt-python-virtualenv ea-apache24-mod-passenger -y
Step 2: Update and Restart servicescagefsctl –force-update/usr/local/cpanel/scripts/restartsrv_cpsrvd
Enable Python selector in WHM:
Step 1: Log in to WHM
Step 2: Navigate toCloudLinux → LVE Manager → Options tab
Step 3: Enable the followingPython selectorVerify that the “Hide Python App in the web interface” option is not selected.
You can assign a version of Python by using the command line:cl-selector –select python –version 3.10 –user yourusername
Steps to Create a Python App via cPanel
cagefsctl --remount-all
lvemanager
cl-selector
alt-python-virtualenv
With WHM and CloudLinux Python Selector, it is simple and safe to handle multiple versions of Python. Install isolated virtual environments in cPanel, designate Python 3.9, 3.10, or 3.11 for each user with cl-selector, and host applications with Django, Flask, or FastAPI. Supported by CageFS and alt-python-virtualenv, our CloudLinux VPS Hosting is completely optimized for new Python web applications.
Save my name, email, and website in this browser for the next time I comment.
Or copy link