Get 50% Discount Offer 26 Days

Recommended Services
Supported Scripts
WordPress
Hubspot
Joomla
Drupal
Wix
Shopify
Magento
Typeo3
How to Install and Use the Python Selector in cPanel on CloudLinux

The Python Selector in CloudLinux simplifies hosting Python applications by allowing users to manage multiple Python versions within isolated environments. In this walkthrough you will learn installing, configuring, and optimizing the Python Selector on a CloudLinux server integrated with cPanel.

Why Should We Use Python Selector?

Key Benefits

  • Version Flexibility: Switch between Python versions easily for different applications.
  • Environment Isolation: CageFS to secure applications without conflicts and unauthorized access.
  • Ease of Management: A nice and intuitive interface for deploying and managing Python applications.
  • Increased Security: It protects applications by isolating environments and robust server security features.

How to Prepare Your Server

Step 1: Verify Requirements

Obviously, before starting the installation process of your server, check if the server meets such requirements. The first is that we need root access to do administrative actions. There is already preinstalled software(CPanel and Cloudlinux) that has to be working, and CageFS enabled. Lastly, make sure that there are no compatibility issues and be sure that your system packages are up to date.

Step 2: Update the Server

Run the following commands to update the system packages:

sudo dnf update -y

sudo dnf upgrade -y

This command ensures your server has the latest updates and is ready for installation.

How to Install Python Selector

Install CloudLinux Components

Install the necessary Python tools provided by CloudLinux:

yum groupinstall alt-python -y

This command installs multiple Python versions and prepares the system for integration with CageFS.

How to Verify the Installation?

Log in to cPanel as a user to confirm Python Selector’s availability. Navigate to the Software section and check for the “Setup Python App” option. 

If visible, Python Selector is correctly installed, allowing users to manage Python applications directly from their cPanel interface.

Once the “Setup Python App” option appears under the Software section in cPanel, it confirms the successful installation of Python Selector. Users can now choose from many Python versions to deploy their applications seamlessly.

cPanel provides this interface that simplifies application management: specify environment variables, application directories, and more via cPanel.

How to Use the Python Selector

Step 1: Create a Python Application

  1. Log in to cPanel.
  2. For this, you can log in to your cPanel account and go to the Software section, where you will find a list of the tools available there and also will be able to manage Python Applications. Click on Setup Python App within this section. It provides a way to create, configure, and manage your Python applications. It also gives the tools to set versions of Python and environment variables.
  3. After navigating to the Setup Python App, click on (Create Application) to create a new one. This action allows you to configure your app by setting its environment, directory, and version. It initiates the application setup and provides customized options based on your requirements.
  4. Choose the Python version best suited for your application from the available options. This process ensures compatibility and optimal performance for your application. The selected version will give your app a given runtime environment; it’ll be flexible to meet your app’s development or deployment needs.
  5. Define the directory where the application will reside, such as /home/user/app. The root directory of your Python application consists of one critical file and some configurations. Permission to run an application or easy-to-set-up virtual environment for this directory path must be correct.

Step 2: Manage Existing Applications

Once created, manage your application by:

  • Starting or Stopping the Application

You can control the application by clicking StartStop, or Restart in the cPanel interface. These actions ensure that the application runs efficiently or is paused as needed for updates or maintenance.

  • Modifying Environment Variables

Adjust critical framework variables like DJANGO_SETTINGS_MODULE or FLASK_APP directly in cPanel. Add or update these variables to configure the application’s environment for optimized performance or feature updates.

  • Updating the Python Version:

If you want to update your application’s Python version, find the Python version dropdown menu within the cPanel interface. Choose the version of your choice, for example, the latest recommended (for example, 3.10.15). It is updated so that your application keeps getting the latest features, performance, and security updates.

How to Optimize and Maintain Python Selector

  1. Regular Updates

sudo dnf update -y

  • Update Python Selector components:

yum groupupdate alt-python -y

  1. Secure Environments

Use CageFS to prevent unauthorized access to application files and isolate resources between users.

Conclusion

Built on Cloud Linux and integrated with cPanel, Python Selector provides a powerful, flexible solution to control your Python applications. You can install and configure the Python Selector for a smooth as possible deployment and management. It will provide a secure and optimized hosting environment for Python development where we will similarly keep giving regular updates and proactive monitoring.

About the writer

Vinayak Baranwal Article Author

Vinayak Baranwal wrote this article. Use the provided link to connect with Vinayak on LinkedIn for more insightful content or collaboration opportunities.

Leave a Reply

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

Lifetime Solutions:

VPS SSD

Lifetime Hosting

Lifetime Dedicated Servers