Learn how to effortlessly ‘Upgrade CyberPanel’ with our easy guide. Master the ‘cyberpanel upgrade command’ and keep your server updated and secure. Here we provided a step-by-step tutorial on How to upgrade your CyberPanel to latest version. Also, we provided a tutorial that updates CyberPanel automatically every week.
Are you tired of constantly checking for CyberPanel updates manually? Worry not! In this tutorial, we will walk you through an automated process to upgrade CyberPanel on your Ubuntu server every week. Even better, your server will reboot if needed, all by itself. So, let’s simplify your web management experience and give your website an SEO boost with the latest CyberPanel features.
Table of Contents
Why Upgrade CyberPanel Regularly?
- Security: Regular updates ensure that any vulnerabilities discovered are patched.
- New Features: With every update, you might get access to new and improved features that can enhance your website’s performance.
- Compatibility: Ensuring that you’re on the latest version helps with compatibility issues that might arise with other software or plugins.
Prerequisites
Before we dive in, ensure you have:
- A running Ubuntu server.
- CyberPanel installed.
- Basic knowledge of terminal commands. But don’t worry, we’ll guide you step by step.
Let’s Get Started!
How to Setup Auto Upgrade in CyberPanel
1. Create the Bash Script
Firstly, we’ll craft a script that’ll be the heart of this operation.
Open a terminal and type:
nano upgrade_cyberpanel
This command will open a text editor named nano
. Here, we’ll write our script.
Or, you can also use this code to skip steps 1, step 2 and step 3:
wget -qO upgrade-cyberpanel https://gist.githubusercontent.com/TheMukeshPatel/fcf178e65315ea58d221e2e8b8c3333c/raw/7e30a8637062be86b1a188df4d86034552b6b429/Auto_Upgrade_CyberPanel.sh && chmod +x upgrade-cyberpanel
NOTE: You can use ./upgrade-cyberpanel
in future to upgrade CyberPanel.
2. Scripting for Automation
Now, copy and paste the following code into the nano editor:
#!/bin/bash
# ANSI color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting CyberPanel Upgrade...${NC}"
# Upgrade CyberPanel
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/upgrade.sh)
# Show Success message after CyberPanel Upgradation
echo -e "${GREEN}CyberPanel Upgraded Successfully.${NC}"
# Check if reboot is required
if [ -f /var/run/reboot-required ]; then
echo -e "${RED}Rebooting the server as it's required after the upgrade...${NC}"
reboot
else
echo -e "${YELLOW}No reboot required.${NC}"
fi
After pasting, press CTRL+O
to save, and then CTRL+X
to exit nano.
3. Granting Execution Permissions
We must grant the right permissions to our script to ensure it runs without hiccups.
Type:
chmod +x upgrade-cyberpanel
This command makes your script executable.
4. Automating the Process with Cron
Now, we’ll schedule our script to run at a fixed time every week.
Type:
crontab -e
This command lets you schedule tasks. Add the following line to make the script run every Sunday at 4 AM:
0 4 * * 7 /bin/bash /root/upgrade-cyberpanel >> /root/upgrade_log.txt 2>&1
Replace /root/
with the actual location of your script if you changed the script location in Step 1. This also logs any messages to upgrade_log.txt
.
With this code, the script /root/upgrade-cyberpanel will be executed using the Bash shell every Sunday at 4 AM. All the output (both regular and error messages) from the script will be appended to the upgrade_log.txt file in the /root/ directory.
Conclusion
Congratulations! You’ve automated the CyberPanel upgrade process, ensuring your web server remains updated and secure. Regular updates not only enhance website security but also improve performance – a crucial factor for SEO rankings. By combining automation with regular updates, you’ve taken a significant step toward ensuring your site’s health and search engine visibility.
Remember: Digital landscapes evolve, and so does software. Regular upgrades are essential. Now, with this automation, you can relax and let the magic happen!
If you liked this tutorial? Share it with fellow webmasters and help them automate their CyberPanel upgrades too!