Skip to content

Deployment Overview of Free Domain Certbot on Server

Prerequisites and Basic Requirements

To successfully deploy this application, the following requirements must be met:

  • Operating System: A Linux-based system with Docker installed.

  • Privileges: Root or sudo access is required for directory creation and Docker management.

  • Domain: A registered domain name configured to point to the server's IP address.

  • Ports: The following ports must be open and available in the firewall:

  • 80/TCP (HTTP)

  • 443/TCP (HTTPS)

FQDN of the final panel on the hostkey.in domain

The application uses a dynamic subdomain based on the server ID. The template for the Fully Qualified Domain Name (FQDN) is provided below:

Parameter Value
Prefix nginx-certbot
Domain hostkey.in
Full template nginx-certbot{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The application data and configuration files are organized in the following directory structure:

  • /data/nginx/: Main application directory.

  • /data/nginx/docker-compose.yml: Docker Compose configuration file.

  • /data/nginx/nginx-certbot.env: Environment variables for the Nginx container.

  • /data/nginx/user_conf.d/: Directory containing custom Nginx server configurations.

  • /data/nginx/user_conf.d/nginx-certbot{Server_ID_from_Invapi}.hostkey.in.conf: Specific configuration file for the domain.

Application installation process

The application is deployed using Docker Compose with a pre-configured environment. The installation involves the following steps:

  1. System Preparation: Installation of the Docker engine on the host system.

  2. Directory Creation: Creation of the /data/nginx/ and subdirectories with specific permissions (0640).

  3. Host Configuration: The local /etc/hosts file is updated to include a mapping for 127.0.0.1 nginx-certbot{Server_ID_from_Invapi}.hostkey.in.

  4. Configuration Generation:

  5. A docker-compose.yml file is generated in /data/nginx/.

  6. An Nginx configuration file (user.conf) is created in the user_conf.d directory to handle SSL termination and domain routing.

  7. An environment file (nginx-certbot.env) is placed in the application directory.

  8. Docker Volume Creation: A Docker volume named nginx_secrets is created to persist Let's Encrypt certificates.

  9. Container Deployment: The containers are started using docker compose up -d from within the /data/nginx/ directory.

Access Rights and Security

  • File Permissions: Configuration files in /data/nginx/ are owned by root:root with permissions set to 0644.

  • Directory Permissions: Data directories are created with 0640 permissions.

  • Firewall: Only ports 80 and 443 should be exposed to the public internet for web traffic.

Docker Containers and Their Deployment

The deployment utilizes a single primary container managed via Docker Compose:

Image Ports Volumes Environment Variables Restart Policy
jonasal/nginx-certbot:latest 80:80, 443:443 - nginx_secrets:/etc/letsencrypt
- ./user_conf.d:/etc/nginx/user_conf.d
[email protected] (via .env file) unless-stopped

Note: Certbot is utilized within this container to automate the acquisition and renewal of SSL certificates via Let's Encrypt.

Application Update Instructions

To update the application, navigate to the installation directory and pull the latest images:

cd /data/nginx/
docker compose pull && docker compose up -d

Location of configuration files and data

  • Nginx Configuration: /data/nginx/user_conf.d/

  • Docker Compose File: /data/nginx/docker-compose.yml

  • Environment Variables: /data/nginx/nginx-certbot.env

  • SSL Certificates (Volume): Managed via the nginx_secrets Docker volume.

Available ports for connection

  • HTTP: 80

  • HTTPS: 443

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×