Login

How to convert a DirectAdmin server from CentOS to CloudLinux

This step-by-step guide covers how to convert your CentOS 8 server to CloudLinux 8 in a DirectAdmin environment, and then configure important CloudLinux features such as Alt-PHP, MySQL Governor, and the LVE Manager (CloudLinux Manager).

Important Notes:

  • Always back up your server (files, databases, user data) before converting.
  • Ensure you have a valid CloudLinux license key.
  • Your server must meet CloudLinux 8 requirements and have a functioning DirectAdmin installation.

1. Preliminary Steps

  1. Update your CentOS packages

    dnf clean all
    dnf update -y
    
  2. Reboot if necessary

    reboot
    

    This ensures any updated kernel or system libraries are fully loaded.

  3. Acquire a CloudLinux license key

    If you don’t have a CloudLinux license, purchase one from CloudLinux.com.


2. Convert from CentOS 8 to CloudLinux 8

  1. Download the CloudLinux conversion script

    cd /root
    curl -s https://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy -o cldeploy
    chmod +x cldeploy
    
  2. Run the script with your license key

    ./cldeploy -k YOUR_LICENSE_KEY
    

    Replace YOUR_LICENSE_KEY with your actual CloudLinux license key.

  3. Reboot the server

    reboot
    

    Your system should now boot into the CloudLinux kernel.

  4. Verify the CloudLinux kernel

    uname -r
    

    You should see something like 4.x.x-xxxx.cloudlinux in the output.

  5. Check the conversion status

    cldetect --detect
    

    This confirms the system is recognized as CloudLinux.


3. Post-Installation Setup in DirectAdmin

3.1 Ensure LVE Manager Plugin is Enabled

  1. Install the LVE Manager plugin (if not already installed)

    yum install lvemanager
    

    Then, in DirectAdmin, go to Admin Level > Plugin Manager and verify LVE Manager is listed.

  2. Enable LVE Manager

    In DirectAdmin’s Administrator Settings, check for any CloudLinux or LVE options to ensure they’re active.

  3. Restart DirectAdmin

    systemctl restart directadmin
    

4. Install and Configure Alt-PHP

Alt-PHP allows you to provide multiple PHP versions to your users.

  1. Install desired Alt-PHP packages

    For each PHP version you want:

    yum install alt-php74 alt-php74-pear alt-php74-php alt-php74-php-cli alt-php74-php-common -y
    yum install alt-php80 alt-php80-pear alt-php80-php alt-php80-php-cli alt-php80-php-common -y
    yum install alt-php81 alt-php81-pear alt-php81-php alt-php81-php-cli alt-php81-php-common -y
    
  2. Enable Alt-PHP in DirectAdmin

    Go to Admin Level > LVE Manager (or PHP Version Selector), and confirm the new PHP versions are available.

  3. Configure default/selectable PHP versions

    Use the Selector tab in LVE Manager to enable or disable specific versions and set default PHP modules and options.


5. Install and Configure MySQL Governor

MySQL Governor manages and limits MySQL resource usage per user.

  1. Install MySQL Governor

    yum install db-governor
    
  2. Enable it for MySQL

    dbgovernor-mysql --install
    

    This may prompt you to align your MySQL/MariaDB version with CloudLinux’s supported builds.

  3. Optional: Enable monitoring mode

    dbgov_ctl monitor on
    

    This collects usage data without enforcing limits.

  4. Switch to enforcement mode

    dbgov_ctl enforce on
    

    This actively limits MySQL resources as configured.

  5. Configure resource limits

    In the LVE Manager under MySQL Governor or in /etc/sysconfig/db-governor, set CPU, I/O, and connection limits per user.

  6. Restart MySQL

    systemctl restart mysqld
    

6. Managing LVE Settings (CloudLinux Manager)

The LVE Manager allows you to fine-tune resource limits for each user or hosting package.

  1. Access LVE Manager

    In DirectAdmin, look for Admin Level > CloudLinux LVE Manager or Resource Usage.

  2. Set default limits

    Define CPU, memory, I/O, and other default resource limits for all users.

  3. Customize per user

    You can override defaults for specific accounts that require more (or fewer) resources.

  4. Apply changes

    After saving, changes apply immediately or within seconds. Restarting services (like HTTPD or PHP-FPM) may be done if needed.


7. Verifying and Testing

  1. Check CloudLinux status

    cldetect --detect
    

    It should confirm you’re running CloudLinux.

  2. Verify Alt-PHP versions

    Log in as a user in DirectAdmin, then check the available PHP versions in the Domain Setup or PHP Selector.

  3. Test resource limits

    Use a resource-intensive script on a test account to confirm LVE constraints are functioning as intended.

  4. Check MySQL Governor

    Run dbgov_ctl status or review logs in LVE Manager to confirm MySQL usage is being monitored or limited.


8. Routine Maintenance Tips

  • Keep packages updated: yum update -y regularly.
  • Monitor your license: Ensure your CloudLinux license is valid and up to date.
  • Review resource usage: Adjust LVE limits in LVE Manager as needed.
  • Maintain backups: Keep a solid backup strategy for all system data.
  • Stay informed: Follow the CloudLinux blog and DirectAdmin forum for updates and best practices.
avatar of chris danks

About Chris Danks

Chris Danks has written 88 post in this blog.

Need Help?
Contact our friendly team

Our highly skilled technical support agents are available to answer your questions 7 days a week through live chat and support ticket with a typical response time is under 1 hour. Having issues with your website or just need some advice? Contact us today and we'll be happy to help!

The Hosting Heroes - Join Up With Our Affiliate Programme!