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:
-
The system removes any legacy Docker repository keys or sources to prevent package conflicts.
-
Essential dependencies such as
gnupg2,curl, andwgetare installed viaapt. -
The Webmin signing key is added to
/etc/apt/keyrings/webmin-developers.asc. -
The official Webmin repository is added to the system sources.
-
The
webminpackage is installed usingapt.
For RHEL, CentOS, Rocky Linux, and AlmaLinux:
-
An installation script (
setup-repos.sh) is downloaded from the official Webmin repository. -
The script is executed to configure the necessary repositories.
-
The
webminpackage is installed usingyum.
Post-Installation Configuration: After the core application is installed, the following steps are performed:
-
SSL is disabled within the Webmin internal server configuration (
/etc/webmin/miniserv.conf) to allow the reverse proxy to handle encryption. -
The
hostparameter in/etc/webmin/miniserv.confis updated to match the public FQDN. -
The Webmin service is restarted to apply changes.
Access Rights and Security¶
Security is managed through system firewalls:
-
Ubuntu/Debian: Uses
ufw. The rule10000/tcpis allowed, and the firewall is reloaded. -
RHEL/CentOS/Rocky/AlmaLinux: Uses
firewalld. A permanent rule is added to allow port10000/tcpin thepubliczone.
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:
-
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:
-
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. -
Proxy Headers: Specific headers are injected into the
location /block to ensure Webmin recognizes the correct host and protocol: -
proxy_pass http://127.0.0.1:10000; -
proxy_set_header Host $host; -
proxy_set_header X-Forwarded-Proto $scheme; -
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/nginxand usedocker compose up -dordocker 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.