Deployment Overview of Linux Game Server Manager (LGSM and Web-LGSM) on Server¶
Prerequisites and Basic Requirements¶
The deployment requires a Debian-based Linux distribution with the following specifications:
-
Operating System: Debian or Ubuntu (tested with
aptpackage manager). -
Privileges: Root access or a user with
sudoprivileges is required for initial setup. -
User Account: A dedicated system user named
mcbserveris created during installation. -
Dependencies: The following packages are installed as part of the setup:
-
bsdmainutils,bzip2,jq,lib32gcc-s1,lib32stdc++6,netcat,pigz,unzip,git,python3,python3-venv,python3-pip. -
Ports:
-
Internal application port:
12357(localhost only). -
External HTTPS port:
443.
FQDN of the Final Panel¶
The Web-LGSM panel is accessible via the following Fully Qualified Domain Name (FQDN) format:
-
Domain:
hostkey.in -
Prefix:
web-lgsm -
Format:
<prefix><Server ID>.hostkey.in:<port> -
Example:
web-lgsmmcbserver.hostkey.in:443
File and Directory Structure¶
The application files, configuration, and data are organized within the home directory of the mcbserver user.
-
User Home Directory:
/home/mcbserver -
LGSM Server Directory:
/home/mcbserver/mcbserver -
Web-LGSM Directory:
/home/mcbserver/web-lgsm -
Nginx Configuration Directory:
/root/nginx -
Nginx User Configuration:
/data/nginx/user_conf.d -
SSL Certificates: Stored in the Docker volume
nginx_secretsmounted at/etc/letsencryptwithin the container. -
Ansible Temporary Directory:
/home/mcbserver/.ansible_tmp
Application Installation Process¶
The installation process involves setting up the Linux Game Server Manager (LGSM) and the Web-LGSM interface.
-
User Creation: A system user
mcbserveris created withsudoprivileges and passwordless sudo access. -
LGSM Installation:
-
The
linuxgsm.shscript is downloaded to/home/mcbserver/linuxgsm.sh. -
The script is executed to generate the
mcbservergame server instance. -
The
linuxgsm.shscript is removed after successful execution.
-
-
Web-LGSM Installation:
-
The Web-LGSM repository is cloned from
https://github.com/BlueSquare23/web-lgsm.gitinto/home/mcbserver/web-lgsm. -
The
install.shscript within the Web-LGSM directory is executed to finalize the setup.
-
-
Service Registration:
-
A
systemdservice unit file is created at/etc/systemd/system/web-lgsm.service. -
The service is enabled and started automatically.
-
Access Rights and Security¶
Security configurations are applied to ensure proper access control and system stability.
-
Sudo Configuration:
-
The
mcbserveruser is added to thesudogroup. -
Passwordless sudo is enabled via
/etc/sudoers.d/99-mcbserver-nopasswd. -
The
requirettyandtargetpw/rootpwdefaults are explicitly removed to ensure non-interactive sudo execution. -
Directory Permissions:
-
/tmpand/var/tmpare set to mode1777. -
The user-specific temporary directory
/home/mcbserver/.ansible_tmpis set to mode0700. -
Service Isolation:
-
The Web-LGSM backend runs as the
mcbserveruser, not root. -
The backend listens only on
127.0.0.1:12357, preventing direct external access to the application port.
Docker Containers and Their Deployment¶
Docker is utilized to run the Nginx reverse proxy and manage SSL certificates via Certbot.
-
Docker Installation: Docker is installed on the host system.
-
Compose File Location:
/root/nginx/compose.yml -
Container Image:
jonasal/nginx-certbot:latest -
Deployment Method: The container is deployed using
docker compose up -d. -
Container Configuration:
-
Network Mode:
host -
Restart Policy:
unless-stopped -
Environment Variables:
CERTBOT_EMAIL:[email protected]
-
Volumes:
-
nginx_secrets(external) mounted to/etc/letsencrypt. -
/data/nginx/user_conf.dmounted to/etc/nginx/user_conf.d. -
/homemounted to/hometo allow access to user directories.
-
Proxy Servers¶
Nginx acts as the reverse proxy to handle external traffic and SSL termination.
-
Proxy Software: Nginx (via Docker container).
-
SSL Management: Certbot is integrated within the Nginx container for automatic SSL certificate generation and renewal.
-
External Port:
443(HTTPS). -
Internal Routing: Traffic from port
443is proxied to the internal Web-LGSM service running on127.0.0.1:12357. -
Configuration Path: Custom Nginx configurations are stored in
/data/nginx/user_conf.d.
Permission Settings¶
File and directory permissions are strictly defined to maintain system integrity.
| Path | Owner | Group | Mode |
|---|---|---|---|
/etc/sudoers.d | root | root | 0750 |
/etc/sudoers.d/99-mcbserver-nopasswd | root | root | 0440 |
/home/mcbserver | mcbserver | mcbserver | 0755 |
/home/mcbserver/web-lgsm | mcbserver | mcbserver | 0755 |
/home/mcbserver/.ansible_tmp | mcbserver | mcbserver | 0700 |
/root/nginx | root | root | 0644 |
/root/nginx/compose.yml | root | root | 0644 |
/tmp | root | root | 1777 |
Location of Configuration Files and Data¶
The following locations contain the primary configuration files and data for the deployed services:
-
Systemd Service Unit:
/etc/systemd/system/web-lgsm.service -
Web-LGSM Application:
/home/mcbserver/web-lgsm/web-lgsm.py -
LGSM Game Server:
/home/mcbserver/mcbserver -
Nginx Compose File:
/root/nginx/compose.yml -
Nginx Environment File:
/data/nginx/nginx-certbot.env -
Sudoers Override:
/etc/sudoers.d/99-mcbserver-nopasswd
Available Ports for Connection¶
The following ports are configured for the application:
-
Port 443: HTTPS traffic for the Web-LGSM panel (external access).
-
Port 12357: Internal Web-LGSM backend (localhost only, not exposed externally).
Starting, Stopping, and Updating¶
The Web-LGSM backend is managed as a systemd service.
-
Start Service:
-
Stop Service:
-
Restart Service:
-
Enable Service on Boot:
-
Check Service Status:
-
Reload Systemd Daemon (after modifying the unit file):
For the Nginx proxy container, use the following commands in the /root/nginx directory:
-
Start/Update Container:
-
Stop Container: