Skip to content

Deployment Overview of Minecraft Java Edition Server on Server

Prerequisites and Basic Requirements

The following requirements must be met before deploying the Minecraft Java Edition Server:

  • Operating System: Ubuntu (specific version compatible with the installation script)

  • Privileges: Root access or sudo privileges are required for installation and configuration

  • Domain: The hostkey.in zone is configured for domain management

  • Network: The server must have access to the internet to download the installation script and SSL certificates

FQDN of the Final Panel

The fully qualified domain name (FQDN) for accessing the Minecraft Java Edition Server follows this format:

  • <prefix><Server ID>.hostkey.in:<external_port>

  • Example structure: minecraft<Server ID>.hostkey.in:12333

  • The daemon service uses the port range 12444 for its specific endpoint.

File and Directory Structure

The application and configuration files are organized in the following locations on the host system:

  • Nginx configuration directory: /root/nginx

  • Nginx user configuration: /data/nginx/user_conf.d/<prefix><Server ID>.hostkey.in.conf

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

  • SSL Certificates: Stored within the Docker volume nginx_secrets mounted at /etc/letsencrypt inside the container

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

Application Installation Process

The application is installed using a provided shell script that automates the setup of dependencies and the service container:

  1. Update system packages to ensure compatibility.

  2. Download the installation script from https://script.mcsmanager.com/setup_cn.sh to /root/setup_cn.sh.

  3. Execute the script with the following command:

    /bin/bash setup_cn.sh
    

  4. The script installs Docker and proceeds to configure the reverse proxy and application services.

Docker Containers and Their Deployment

The server deployment utilizes Docker Compose to manage the Nginx reverse proxy and SSL certificate management.

  • Image: jonasal/nginx-certbot:latest

  • Restart Policy: unless-stopped

  • Network Mode: host

  • Volumes:

  • nginx_secrets (external) mounted to /etc/letsencrypt

  • /data/nginx/user_conf.d mounted to /etc/nginx/user_conf.d

  • Environment Variables: Defined in /data/nginx/nginx-certbot.env and CERTBOT_EMAIL

  • Deployment Command:

    cd /root/nginx
    docker compose up -d
    

Proxy Servers

Nginx acts as the reverse proxy and SSL terminator for the Minecraft Java Edition Server.

  • SSL/TLS: Managed automatically via Certbot within the Docker container.

  • Certificates: Stored in /etc/letsencrypt/live/<prefix><Server ID>.hostkey.in/

  • Configuration: The Nginx configuration listens on external ports and forwards traffic to internal service ports.

  • Features:

  • Support for WebSocket upgrades

  • Client max body size set to 10240M

  • Proxy buffering is disabled

  • Real IP forwarding via X-Forwarded-For header

The configuration defines two server blocks:

  1. Main Service: Listens on the external port for standard traffic.

  2. Daemon Service: Listens on the external daemon port for specific daemon operations.

Both blocks use the same domain name and SSL certificate configuration.

Permission Settings

File and directory permissions are set as follows during the deployment:

  • /root/nginx: 0755 (owner: root, group: root)

  • /data/nginx/user_conf.d/<prefix><Server ID>.hostkey.in.conf: 0644 (owner: root, group: root)

  • /root/nginx/compose.yml: 0644 (owner: root, group: root)

  • Installation script /root/setup_cn.sh: Executable permissions (o+x)

Location of Configuration Files and Data

Key configuration and data files are located at:

  • Main Nginx Config: /data/nginx/user_conf.d/minecraft<Server ID>.hostkey.in.conf

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

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

  • Installation Script: /root/setup_cn.sh

Available Ports for Connection

The following ports are configured for external and internal communication:

Port Type Port Number Description
External (Main) 12333 Public facing port for the main Minecraft service
Internal (Main) 23333 Internal port used by the application container
External (Daemon) 12444 Public facing port for the daemon service
Internal (Daemon) 24444 Internal port used by the daemon service

Starting, Stopping, and Updating

Service management is handled via Docker Compose commands executed within the /root/nginx directory:

  • Start the services:

    cd /root/nginx
    docker compose up -d
    

  • Stop the services:

    cd /root/nginx
    docker compose down
    

  • Update the services: To update the image and configuration, pull the latest changes and restart:

    cd /root/nginx
    docker compose pull
    docker compose up -d
    

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