Deployment Overview of HestiaCP on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the server must meet the following requirements:
-
Operating System: Ubuntu or Debian.
-
Privileges: Root access is required for the installation process.
-
Network Configuration:
-
TCP Port
8083must be open for the HestiaCP panel access. -
TCP Port
443(HTTPS) must be available for web traffic via the proxy. -
System Optimization: BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control is enabled to optimize network performance.
FQDN of the final panel on the hostkey.in domain¶
The management panel is accessible via a specific subdomain template:
| Parameter | Value |
|---|---|
| Prefix | hestiacp |
| Domain | hostkey.in |
| Full template | hestiacp{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
The following directories are utilized for configuration and management:
-
/root/nginx: Contains the Docker Compose configuration for the Nginx proxy service. -
/data/nginx/user_conf.d: Stores custom Nginx configuration files for domain routing. -
/data/nginx/nginx-certbot.env: Environment file containing settings for Certbot. -
/usr/local/hestia: The primary installation directory for the HestiaCP application and its binaries (e.g.,cron.php).
Application installation process¶
The installation of HestiaCP is performed using a dedicated installation script tailored to the operating system:
-
System Preparation:
-
The package manager cache is updated, and essential utilities are installed (
curl,wget,gnupg,apt-transport-https,ca-certificates,dnsutils,gawk,xterm,systemd-timesyncd). -
For Debian 12 systems,
software-properties-commonis also installed. -
The
adminuser and group are removed if they already exist to prevent conflicts. -
Script Execution:
-
An installation script is downloaded from the official HestiaCP repository:
-
For Ubuntu:
hst-install-ubuntu.sh -
For Debian:
hst-install-debian.sh -
The script is executed with the following parameters to configure the environment automatically:
-
--hostname: Set tohestiacp{Server_ID_from_Invapi}.hostkey.in. -
--port: Configured to8083. -
--username:admin. -
--apache,--phpfpm,--vsftpd,--named,--mysql,--exim,--dovecot,--clamav,--spamassassin,--iptables,--fail2ban, and--apiare all enabled. -
Security Configuration:
-
rsyslogis ensured to be running and enabled to allowfail2banto monitor authentication logs via/var/log/auth.log. -
fail2banis restarted to apply new logging configurations.
Access Rights and Security¶
-
Firewall: The installation includes
iptablesandfail2banfor automated intrusion prevention. -
User Management: A dedicated
adminuser is created for panel management. -
Log Monitoring: The system ensures
/var/log/auth.logexists with appropriate permissions (0640) so that security services can monitor login attempts.
Databases¶
HestiaCP installs and manages its own database environment:
-
Service: MySQL is installed as part of the core stack.
-
Management: Database management is handled through the HestiaCP control panel interface.
Docker Containers and Their Deployment¶
The deployment includes a dedicated Nginx container managed via Docker Compose to handle SSL certificates and reverse proxying.
Nginx Proxy Container
-
Image:
jonasal/nginx-certbot:latest -
Network Mode:
host -
Restart Policy:
unless-stopped -
Environment Variables:
-
CERTBOT_EMAIL: Set via/data/nginx/nginx-certbot.env. -
Volumes:
-
nginx_secrets:/etc/letsencrypt(External volume for SSL certificates). -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d(Mapping of custom Nginx configurations).
Application Update Instructions¶
To update the HestiaCP application, you must re-run the installation script with the same parameters used during the initial setup:
-
Locate the installation script in the
/root/directory (hst-install-ubuntu.shorhst-install-debian.sh). -
Execute the script again using the
--forceflag to apply updates and ensure all components are at their latest versions.
Location of configuration files and data¶
-
Nginx Proxy Configs:
/data/nginx/user_conf.d -
Docker Compose File:
/root/nginx/compose.yml -
HestiaCP Binaries:
/usr/local/hestia/bin/
Available ports for connection¶
| Service | Port | Protocol |
|---|---|---|
| HestiaCP Panel | 8083 | TCP |
| Web Traffic (Proxy) | 443 | TCP (HTTPS) |
Starting and Stopping the application¶
The main application is managed as a collection of system services. Use the following commands:
-
Manage HestiaCP Services: Since HestiaCP integrates multiple services (Apache, MySQL, Exim, etc.), these are typically managed via
systemctl. -
Manage Nginx Proxy Container:
-
To start the proxy:
docker compose up -dfrom within/root/nginx. -
To stop the proxy:
docker compose downfrom within/root/nginx.