Skip to content

Instantly share code, notes, and snippets.

@Udara-Dananjaya
Created August 15, 2023 06:51
Show Gist options
  • Save Udara-Dananjaya/55843c0b21bb3c5bf68bac049d195d1c to your computer and use it in GitHub Desktop.
Save Udara-Dananjaya/55843c0b21bb3c5bf68bac049d195d1c to your computer and use it in GitHub Desktop.
Install AApanel on Ubuntu: Set up swap, update, define firewall rules, hostname, and AApanel installation with SSL.
# Gain superuser privileges
sudo -i
# Create swap area for managing memory
sudo dd if=/dev/zero bs=1M count=5024 of=/mnt/swapfile.swap
sudo chmod 600 /mnt/swapfile.swap
sudo mkswap /mnt/swapfile.swap
sudo swapon /mnt/swapfile.swap
echo '/mnt/swapfile.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab
# Check available RAM and disk space
free -m
df -h
# Define firewall rules for specified ports and sources
# Subnet > Ingress Rule > Source CIDR > 0.0.0.0/0
# TCP PORTS :7800,888,80,443,20,21
# Update the list of available software packages
sudo apt update -y
# Upgrade installed packages to their latest versions
sudo apt-get upgrade -y
sudo apt-get full-upgrade -y
# Clear existing iptables rules
sudo iptables -P INPUT ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -F
# Set hostname
hostnamectl set-hostname hostname.domain
hostname
# Install AApanel
sudo apt update -y
sudo wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh
sudo bash install.sh aapanel
# Answer 'y' to install AAPanel to /www directory
# Answer 'yes' to enable the panel SSL
# Remove the "Security Entrance"
sudo rm -f /www/server/panel/data/admin_path.pl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment