### Bash Script to Start Minecraft Server Source: https://github.com/vincss/mcsleepingserverstarter/wiki/[Linux]-Autostart-into-a-screen. This script is executed by 'start_screen.sh' and is responsible for launching the Minecraft server using 'npm start'. It logs the server startup. ```bash #!/bin/bash msg="$(date --iso-8601=seconds) ... Starting SleepingServer ... $(whoami) => $(pwd) " echo $msg >> start.log npm start ``` -------------------------------- ### Bash Script to Start Screen and Server Source: https://github.com/vincss/mcsleepingserverstarter/wiki/[Linux]-Autostart-into-a-screen. This script initiates a screen session named 'minecraft' and executes another script to start the Minecraft server. It logs the startup process. ```bash #!/bin/bash folder=$(dirname "$0") cd $folder msg="$(date --iso-8601=seconds) ... Starting screen and server ... $(whoami) -> $(pwd) " echo $msg echo $msg >> start_screen.log screen -S minecraft -d -m $folder/start.sh msg="$(date --iso-8601=seconds) ... Done ... " echo $msg echo $msg >> start_screen.log screen -ls ``` -------------------------------- ### Docker Compose Configuration Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Docker-Configuration Recommended Docker Compose setup for MCSleepingServerStarter. Includes port mappings, environment variables, and volume mounts for server data and settings. ```yaml version: '3.5' services: mcsleepingserverstarter: image: ghcr.io/vincss/mcsleepingserverstarter:latest container_name: mcsleepingserverstarter restart: unless-stopped tty: true stdin_open: true ports: - 19132:19132/udp # Bedrock port (udp must be specified!) - 25565:25565 # Java port - 8080:8080 # Web GUI port environment: - TZ=Etc/UTC # Change to your timezone so that the log timestamps are correct - DISABLE_FILE_LOGS=true # Disable the file logger volumes: - "/path/to/minecraft/server:/minecraft" - "/path/to/sleepingSettings.yml:/sleepingSettings.yml" ``` -------------------------------- ### Docker Container Management Commands Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Docker-Configuration Commands to view logs and attach to a running MCSleepingServerStarter container after starting it with `docker compose`. ```bash CONTAINER=$(docker compose ps -q mcsleepingserverstarter); docker logs $CONTAINER; docker attach --sig-proxy=false $CONTAINER ``` -------------------------------- ### Run MCSleepingServerStarter Docker Container Source: https://github.com/vincss/mcsleepingserverstarter/wiki/mcsleepingserverstarter-inside-docker Command to start the MCSleepingServerStarter Docker container. It maps ports for Java and Bedrock editions, mounts a volume for server data, and sets the container to restart automatically. ```bash docker run -d -p 65400:25565 -p 65401:19132/udp -v /home/minecraftserver:/home/mc --name pnpmc --restart=always jannik44/pnpmc ``` -------------------------------- ### Docker CLI Command Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Docker-Configuration Alternative Docker CLI command for running MCSleepingServerStarter. This command mirrors the `docker compose` setup with equivalent options. ```bash docker run -d \ --name=mcsleepingserverstarter \ -p 19132:19132 \ -p 25565:25565 \ -p 8080:8080 \ -e TZ=Etc/UTC \ -v /path/to/minecraft/server:/minecraft \ -v /path/to/sleepingSettings.yml:/sleepingSettings.yml \ --restart unless-stopped \ ghcr.io/vincss/mcsleepingserverstarter:latest ``` -------------------------------- ### Configure mcsleepingserverstarter for Dynmap Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Use-internal-SSS-WebServer-for-dynmap Set mcsleepingserverstarter to use Dynmap by configuring the web port, disabling web server stop on start, and enabling Dynmap serving. ```yaml webPort: 9696 webStopOnStart: false webServeDynmap: true ``` -------------------------------- ### Configure Minecraft Command in sleepingSettings.yml Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Sponge-Forge-support Specifies the command to execute for running the Minecraft server. Ensure this path is correct for your Forge installation. ```yaml minecraftCommand: run.bat ``` -------------------------------- ### MCSleepingServerStarter YAML Configuration Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Docker-Configuration Essential values to configure in `sleepingSettings.yml` for Docker container operation. Ensure ports match exposed ports in Docker setup. ```yaml minecraftWorkingDirectory: /minecraft serverPort: 25565 # must be the same port that you exposed in the compose / cli options bedrockPort: 19132 # specify only if you want bedrock - must be the same port that you exposed in the compose / cli options webPort: 8080 # specify only if you want the Web GUI - must be the same port that you exposed in the compose / cli options ``` -------------------------------- ### Make Scripts Executable Source: https://github.com/vincss/mcsleepingserverstarter/wiki/[Linux]-Autostart-into-a-screen. This command grants execute permissions to all .sh files in the current directory, which is necessary for running the startup scripts. ```bash chmod +x *.sh ``` -------------------------------- ### Crontab Entry for Autostart Source: https://github.com/vincss/mcsleepingserverstarter/wiki/[Linux]-Autostart-into-a-screen. This crontab entry configures the system to run the 'start_screen.sh' script automatically upon system reboot. The '&' detaches the process. ```bash @reboot /home/$LOGNAME/minecraft/server/start_screen.sh & ``` -------------------------------- ### Modify run.bat for Forge Server Startup Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Sponge-Forge-support Adjusts the `run.bat` script to include the `nogui` argument for a headless Forge server startup. Remove the `pause` command to prevent the console from staying open after shutdown. ```batch java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.19.3-44.1.0/win_args.txt nogui %* ``` -------------------------------- ### Attach to Screen Session Source: https://github.com/vincss/mcsleepingserverstarter/wiki/[Linux]-Autostart-into-a-screen. This command allows you to re-attach to the running screen session named 'minecraft' to view the server console. ```bash screen -r minecraft ``` -------------------------------- ### NGINX Reverse Proxy at Subdirectory Source: https://github.com/vincss/mcsleepingserverstarter/wiki/NGINX-Reverse-Proxy-Setup Configure NGINX to proxy requests to the web GUI running on a local port, accessible via a subdirectory. Requires `webSubPath` to be set in `sleepingSettings.yml`. ```nginx server { server_name example.com; # ...extra config here location /games/minecraft/ { proxy_pass http://localhost:12345; # Assuming you are hosting it locally, with 12345 set as your web GUI port # ...any extra proxy settings here } } ``` -------------------------------- ### NGINX Reverse Proxy at Root Source: https://github.com/vincss/mcsleepingserverstarter/wiki/NGINX-Reverse-Proxy-Setup Configure NGINX to proxy requests to the web GUI running on a local port. Assumes the web GUI is accessible at http://localhost:12345. ```nginx server { server_name example.com; # ...extra config here location / { proxy_pass http://localhost:12345; # Assuming you are hosting it locally, with 12345 set as your web GUI port # ...any extra proxy settings here } } ``` -------------------------------- ### Disable Dynmap Web Chat Source: https://github.com/vincss/mcsleepingserverstarter/wiki/Use-internal-SSS-WebServer-for-dynmap To prevent chat issues when using mcsleepingserverstarter, disable web chat in Dynmap's configuration. ```yaml allowwebchat: false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.