Free Domain Certbot: Nginx Deployment Overview on Server¶
Prerequisites¶
The following conditions are required for the application to function correctly:
-
Operating System: Linux (with Docker installed).
-
Access Rights:
rootprivileges to manage containers and system directories. -
Domain Name: Configured DNS for the target domain.
-
Ports: Ports
80and443must be open in the external firewall.
FQDN of the final panel on hostkey.in domain¶
| Parameter | Value |
|---|---|
| Prefix | nginx-certbot |
| Domain | hostkey.in |
| Full Template | nginx-certbot{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
All primary configuration files and application data are located in the following directories:
-
/data/nginx/— project working directory containingdocker-compose.yml,.envenvironment file, and custom Nginx configurations. -
/data/nginx/user_conf.d/— directory for storing virtual host configuration files (.conf). -
/etc/letsencrypt/— the contents of this path inside the container are linked to the external Docker volumenginx_secrets.
Application Installation Process¶
Deployment is performed by creating the necessary directories, generating configuration files based on templates, and starting containers via docker compose. The application uses the jonasal/nginx-certbot:latest image.
Docker Containers and Execution¶
One main container is deployed in the system.
nginx¶
-
Image Name:
jonasal/nginx-certbot:latest -
Ports:
-
80:80(HTTP) -
443:443(HTTPS) -
Volumes:
-
nginx_secrets:/etc/letsencrypt— for storing SSL certificates. -
./user_conf.d:/etc/nginx/user_conf.d— for custom Nginx configurations. -
Environment Variables:
-
Variables File:
./nginx-certbot.env -
Restart Policy:
unless-stopped
Application Update Instructions¶
Updates are performed using the command:
This command pulls the latest image versions and restarts containers applying the new settings.Permissions Settings¶
The following directory permissions are set to ensure security:
-
/data,/data/nginx,/data/nginx/user_conf.d— ownerroot, grouproot, access mode0640. -
Configuration files in
/data/nginx/— ownerroot, grouproot, access mode0644.
Location of Configuration Files and Data¶
| File / Directory | Host Path | Purpose |
|---|---|---|
| Docker Compose | /data/nginx/docker-compose.yml | Docker service description |
| Environment Variables | /data/nginx/nginx-certbot.env | Container environment parameters |
| Nginx Configuration | /data/nginx/user_conf.d/{prefix}{server_id}.{zone}.conf | Virtual host and SSL settings |
Available Ports for Connection¶
-
80— for Certbot challenge validation (HTTP). -
443— for accessing the service via secure HTTPS protocol.