Skip to content

Instantly share code, notes, and snippets.

@Udara-Dananjaya
Created August 15, 2023 06:56
Show Gist options
  • Save Udara-Dananjaya/b3d03a27f94064d5066121b8d9c9d4c3 to your computer and use it in GitHub Desktop.
Save Udara-Dananjaya/b3d03a27f94064d5066121b8d9c9d4c3 to your computer and use it in GitHub Desktop.
Install HestiaCP on Ubuntu: Setup swap, firewall rules, hostname, and HestiaCP installation with SSL. Simplify web hosting!
# 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 :80,443,8083
# 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 HestiaCP
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh
bash hst-install.sh -f
# Answer 'Y' to continue with installation
# Provide admin email address and FQDN hostname
# Fix SSL Certificate Error
v-change-sys-hostname hestia.example.com
v-add-letsencrypt-host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment