Last active
November 23, 2023 22:34
-
-
Save mshannaq/7881e1af3665ca8655c90acbd1dcd3b9 to your computer and use it in GitHub Desktop.
Install CloudPanel programmatically on Debian 11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CloudPanel Installation Script | |
# use this as an initialization script after creating a VM to install CloudPanel into | |
# your VM instance. | |
# you can use it in Digitalocean Initialization scripts or AWS user data. | |
# tested on DigitalOcean Droplets with Debian 11 on 24 Nov 2023 | |
# | |
# @author: @mshannaq , Extendy team | |
# @License: MIT | |
# Replace variables with your specific configurations | |
CLOUDPANEL_USERNAME="admin" | |
CLOUDPANEL_PASSWORD="ChoosePassword" | |
CLOUDPANEL_USER_EMAIL="YOUREMAIL@EXAMPLE.COM" | |
CLOUDPANEL_FIRSTNAME="YourFirstName" | |
CLOUDPANEL_LASTNAME="YourLastName" | |
LOG_FILE_NAME="/var/log/installing_cloudpanel.log" | |
# do not edit below unless you know what to do | |
# Check if the current Linux distribution is Debian | |
if [ -f /etc/os-release ]; then | |
source /etc/os-release | |
if [ "$ID" == "debian" ]; then | |
# Check if the version is Debian 11 | |
if [ "$VERSION_ID" == "11" ]; then | |
echo "This system is running Debian 11... try installing CloudPanel" >> $LOG_FILE_NAME | |
else | |
echo "Error: This script is intended for Debian 11, but the current version is $VERSION_ID." >> $LOG_FILE_NAME | |
exit 1 | |
fi | |
else | |
echo "Error: This script is intended for Debian systems, but the current distribution is $ID." >> $LOG_FILE_NAME | |
exit 1 | |
fi | |
else | |
echo "Error: Unable to determine the Linux distribution. This script is intended for Debian 11." >> $LOG_FILE_NAME | |
exit 1 | |
fi | |
sudo -s | |
sudo DEBIAN_FRONTEND=noninteractive apt -y update && \ | |
sudo DEBIAN_FRONTEND=noninteractive apt -y upgrade && \ | |
sudo DEBIAN_FRONTEND=noninteractive apt -y install curl wget | tee $LOG_FILE_NAME && \ | |
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh && \ | |
echo "85762db0edc00ce19a2cd5496d1627903e6198ad850bbbdefb2ceaa46bd20cbd install.sh" | \ | |
sha256sum -c && sudo bash install.sh | tee -a $LOG_FILE_NAME | |
clpctl user:add --userName=$CLOUDPANEL_USERNAME --email=$CLOUDPANEL_USER_EMAIL \ | |
--firstName=$CLOUDPANEL_FIRSTNAME --lastName=$CLOUDPANEL_LASTNAME \ | |
--password=$CLOUDPANEL_PASSWORD --role='admin' --timezone='UTC' --status='1' | \ | |
tee -a $LOG_FILE_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install CloudPanel programmatically on Debian 11 while creating a VM on platforms like DigitalOcean or AWS, utilize the above initialization script (user data)
After Creatinh the instance Wait for the instance to be running
Log into the server using SSH, Check the installation progress in the log file by A take look into file "/var/log/installing_cloudpanel.log" or by running the command:
tail -f /var/log/installing_cloudpanel.log
If you changed the log file name use the you defined in LOG_FILE_NAME in the initialization script.
After the initialization script completed (which may take few minutes depends on instance resources) you can visit CloudPanel on https://instanceIP:8443 (and accept the self-signed SSL certificate)
ang login with information you define for CloudPanel User information at the initialization script.
and enjoy CloudPaneling!