Skip to content

Deployment Overview of Webmin on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Compatible with Debian-based (Ubuntu) or RHEL-based (CentOS, Rocky Linux, AlmaLinux) distributions.

  • Privileges: Root or sudo access is required for package installation and configuration changes.

  • Network Ports:

  • 10000/tcp: Internal application port.

  • 443/tcp: External HTTPS access via proxy.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template based on the server ID.

Parameter Value
Prefix webmin
Domain hostkey.in
Full template webmin{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The deployment utilizes the following directory structure for configuration and data management:

  • /etc/webmin/: Main application configuration files (e.g., miniserv.conf).

  • /root/nginx/: Contains the Docker Compose file for the reverse proxy.

  • /data/nginx/user_conf.d/: Stores Nginx virtual host configurations and SSL-related settings.

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

Application installation process

The installation method depends on the detected operating system:

For Debian and Ubuntu:

  1. The system removes any legacy Docker repository keys or sources to prevent package conflicts.

  2. Essential dependencies such as gnupg2, curl, and wget are installed via apt.

  3. The Webmin signing key is added to /etc/apt/keyrings/webmin-developers.asc.

  4. The official Webmin repository is added to the system sources.

  5. The webmin package is installed using apt.

For RHEL, CentOS, Rocky Linux, and AlmaLinux:

  1. An installation script (setup-repos.sh) is downloaded from the official Webmin repository.

  2. The script is executed to configure the necessary repositories.

  3. The webmin package is installed using yum.

Post-Installation Configuration: After the core application is installed, the following steps are performed:

  1. SSL is disabled within the Webmin internal server configuration (/etc/webmin/miniserv.conf) to allow the reverse proxy to handle encryption.

  2. The host parameter in /etc/webmin/miniserv.conf is updated to match the public FQDN.

  3. The Webmin service is restarted to apply changes.

Access Rights and Security

Security is managed through system firewalls:

  • Ubuntu/Debian: Uses ufw. The rule 10000/tcp is allowed, and the firewall is reloaded.

  • RHEL/CentOS/Rocky/AlmaLinux: Uses firewalld. A permanent rule is added to allow port 10000/tcp in the public zone.

Docker Containers and Their Deployment

The deployment uses a Docker container to manage Nginx and SSL certificates via Certbot.

Nginx-Certbot Container

  • Image: jonasal/nginx-certbot:latest

  • Network Mode: host

  • Ports: Inherits ports from the host (specifically 443 for HTTPS).

  • Volumes:

  • nginx_secrets:/etc/letsencrypt: For SSL certificate storage.

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d: To provide custom Nginx configurations.

  • Environment Variables:

  • [email protected]

  • Restart Policy: unless-stopped

Custom Scripts and Additional Setup

The deployment performs several non-standard configuration steps to ensure the reverse proxy works correctly with Webmin:

  1. Nginx Configuration Injection: The system modifies the Nginx configuration file located at /data/nginx/user_conf.d/{prefix}{Server_ID_from_Invapi}.hostkey.in.conf.

  2. Proxy Headers: Specific headers are injected into the location / block to ensure Webmin recognizes the correct host and protocol:

  3. proxy_pass http://127.0.0.1:10000;

  4. proxy_set_header Host $host;

  5. proxy_set_header X-Forwarded-Proto $scheme;

  6. Nginx Reload: After configuration injection, the Nginx service inside the container is reloaded using docker compose exec -T nginx nginx -s reload.

Application Update Instructions

To update the Webmin application:

  • On Debian/Ubuntu: Run apt update && apt upgrade webmin.

  • On RHEL/CentOS/Rocky/AlmaLinux: Run yum update webmin.

Location of configuration files and data

  • Webmin Configs: /etc/webmin/

  • Nginx User Configs: /data/nginx/user_conf.d/

  • Docker Compose File: /root/nginx/compose.yml

Available ports for connection

Port Protocol Usage
443 TCP External HTTPS access (via Nginx Proxy)
10000 TCP Internal Webmin service

Starting and Stopping the application

  • Webmin Service:

  • Stop: /etc/webmin/stop

  • Start: /etc/webmin/start

  • Nginx Container:

  • Navigate to /root/nginx and use docker compose up -d or docker compose down.

Proxy Servers

The application uses an Nginx container with Certbot integration as a reverse proxy. It handles SSL termination for the domain {prefix}{Server_ID_from_Invapi}.hostkey.in and forwards requests to the Webmin service running on 127.0.0.1:10000.

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