Deployment Overview of Hiddify on Server¶
Prerequisites and Basic Requirements¶
To successfully deploy Hiddify on the server, the following requirements must be met:
-
Operating System: Ubuntu (compatible with
aptpackage manager). -
Privileges: The deployment script and subsequent management tasks require root privileges (
sudoor directrootaccess). -
Domain: The application utilizes the
hostkey.inzone with a specific prefix. -
Ports:
-
External Traffic: Port
443(HTTPS). -
Internal Traffic: The internal port is configured dynamically or defaults to standard HTTP/HTTPS ports depending on the Nginx setup.
-
Network: The server must have outbound internet access to download dependencies and certificates, and inbound access on port
443.
FQDN of the Final Panel¶
The fully qualified domain name (FQDN) for accessing the Hiddify panel follows the pattern defined in the configuration variables. The endpoint is constructed using the prefix hiddify and the server identifier:
-
Format:
hiddify<ServerID>.hostkey.in:443 -
Note: The specific
<ServerID>is substituted during the deployment process to form the unique domain name (e.g.,hiddify123.hostkey.in).
File and Directory Structure¶
The deployment creates and utilizes the following directory structure for configurations, data, and certificates:
-
/root/nginx: Contains the Docker Compose file for the reverse proxy and SSL management. -
/root/nginx/compose.yml: The Docker Compose configuration for the Nginx and Certbot services. -
/data/nginx/nginx-certbot.env: Environment variables for the Nginx/Certbot container. -
/data/nginx/user_conf.d: Directory for Nginx user configuration files (SSL and proxy settings). -
/data/nginx/nginx-certbot.env: Environment file containing configuration for the Let's Encrypt email and other Nginx settings. -
/opt/hiddify-config: The installation directory for the Hiddify application and its components. -
/opt/hiddify-config/config.env: Environment configuration file for Hiddify.
Application Installation Process¶
The Hiddify application is installed via a shell script that automates dependency installation, downloading the release archive, and configuring the environment.
-
System Preparation:
-
The system updates package lists and upgrades existing packages.
-
Essential tools such as
curlandunzipare installed.
-
-
Download and Extraction:
-
The script downloads the latest release of
hiddify-configfrom the official repository. -
The archive is extracted to
/opt/hiddify-config.
-
-
Configuration:
- A
config.envfile is generated in/opt/hiddify-configwith theMAIN_DOMAINvariable set to the specific server instance domain (e.g.,{{ hostid }}.hostkey.in).
- A
-
Execution:
-
The installer script located at
/root/download.shis executed with thereleaseand--no-guiflags to install the core components. -
The main application installer (
install.sh) is run from the/opt/hiddify-configdirectory.
-
Docker Containers and Their Deployment¶
The deployment utilizes Docker to manage the reverse proxy and SSL termination. The containers are orchestrated using Docker Compose.
-
Directory:
/root/nginx -
Orchestration File:
/root/nginx/compose.yml -
Service:
nginx -
Image:
jonasal/nginx-certbot:latest -
Restart Policy:
unless-stopped -
Network Mode:
host -
Volumes:
-
nginx_secrets: Mounted at/etc/letsencrypt(External volume). -
/data/nginx/user_conf.d: Mounted at/etc/nginx/user_conf.d(Host directory).
-
-
Environment:
CERTBOT_EMAIL: Set to[email protected].
Proxy Servers (Nginx, Traefik, SSL, Custom Domains, Certbot)¶
The application uses an Nginx container integrated with Certbot for SSL certificate management and reverse proxying.
-
Proxy Type: Nginx with Certbot (
jonasal/nginx-certbot). -
SSL/TLS: Handled automatically via Let's Encrypt certificates stored in the
nginx_secretsvolume. -
Reverse Proxy Configuration:
-
The Nginx container maps incoming traffic on port
443to the internal Hiddify service. -
Custom domain configurations are loaded from
/data/nginx/user_conf.d. -
Environment: SSL certificates are issued for the domain
hiddify<ServerID>.hostkey.in.
Permission Settings¶
File and directory permissions are set during the deployment to ensure secure operation:
-
/root/nginx: Set to0755with ownerrootand grouproot. -
/root/nginx/compose.yml: Set to0644with ownerrootand grouproot. -
/opt/hiddify-config: Created by the installation script with default system permissions for the root user. -
/root/download.sh: Set to0755to allow execution.
Location of Configuration Files and Data¶
Key configuration and data files are located in the following paths:
-
Hiddify Configuration:
/opt/hiddify-config/config.env -
Nginx Compose File:
/root/nginx/compose.yml -
Nginx Environment:
/data/nginx/nginx-certbot.env -
SSL Certificates: Managed by the Docker volume
nginx_secrets, mapped to/etc/letsencryptinside the container. -
Nginx Site Configs: Located in
/data/nginx/user_conf.d.
Available Ports for Connection¶
The following ports are utilized for external and internal communication:
-
Port 443: External HTTPS traffic for accessing the Hiddify panel.
-
Internal Path: Traffic is routed to the internal path
/which maps to the Hiddify service. -
External Path: The external endpoint is accessed at
/.
Starting, Stopping, and Updating¶
Management of the reverse proxy service is handled via Docker Compose within the /root/nginx directory.
-
Start Service:
-
Stop Service:
-
Update Service: Since the Nginx image uses the
latesttag, pulling the latest image and restarting the container applies updates: -
Application Updates: To update the Hiddify application itself, the installation script located at
/opt/hiddify-configmust be re-executed or the specific update mechanism provided by the Hiddify package should be followed (typically re-running theinstall.shscript after downloading the latest release).