Setup HestiaCP

Modified on Mon, 10 Aug at 1:10 AM

On AWS, make a new EC2 instance, use Debian 12 (ARM if t4g instance), and assign a static IP.


SSH to the server.


sudo su -
apt update && apt upgrade -y
hostnamectl set-hostname panel.yourdomain.com

# Enable Debian Unattended Upgrades
apt install -y unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades

# Install HestiaCP

# Download the installer
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

# Run the installer with your custom minimal flags
bash hst-install.sh \
  --apache no \
  --phpfpm yes \
  --multiphp yes \
  --vsftpd yes \
  --named no \
  --mysql no \
  --postgresql no \
  --exim no \
  --dovecot no \
  --clamav no \
  --spamassassin no \
  --iptables yes \
  --fail2ban yes \
  --interactive no \
  --email your-email@example.com \
  --hostname panel.yourdomain.com \
  --force

reboot


After the reboot, log back in with SSH.

sudo su -

# Setup HestiaCP auto updates
v-auto-update-system

# Add Microsoft GPG key and APT repository
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/mssql-release.list

# Update APT sources
apt update

# Install the MS ODBC 18 driver and tools non-interactively
ACCEPT_EULA=Y apt install -y msodbcsql18 mssql-tools18 unixodbc-dev

# Install PHP build requirements
apt install -y php-dev php-peer build-essential

# Compile MS SQL extensions via PECL
pecl install sqlsrv
pecl install pdo_sqlsrv

# Enable the extensions for installed PHP versions (Example: PHP 8.2 and 8.3)
for ver in 8.4 8.5; do
  if [ -d "/etc/php/$ver" ]; then
    echo "extension=sqlsrv.so" > /etc/php/$ver/mods-available/sqlsrv.ini
    echo "extension=pdo_sqlsrv.so" > /etc/php/$ver/mods-available/pdo_sqlsrv.ini
    phpenmod -v $ver sqlsrv pdo_sqlsrv
  fi
done

# Remove old PHP versions
v-delete-web-php 5.6
v-delete-web-php 7.0
v-delete-web-php 7.1
v-delete-web-php 7.2
v-delete-web-php 7.3
v-delete-web-php 7.4
v-delete-web-php 8.0
v-delete-web-php 8.1
v-delete-web-php 8.2
v-delete-web-php 8.3

# Set default PHP version
v-change-sys-php 8.5

systemctl restart php*-fpm
systemctl restart nginx

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article