minecraft-gcp
Personal minecraft server
Setup guide
- Follow this tutorial for the most part: https://medium.com/@manbobo2012/host-a-minecraft-server-on-google-cloud-with-automatic-deployment-and-backup-f00d49a1a306
- Install the appropriate openjdk version (not always 14). As of writing this, openjdk17 is installed in order to use papermc with minecraft 1.19.3.
- wget from papermc is needed, or other minecraft server files.
- Skip backup script
- crontab file in
crontab.txt, make sure to adjust the USER's home folder. You can choose to only use the lines you need. - Copy scripts. Always copy them to
/etc/init.d/<script_name>and runsudo chmod 755 /etc/init.d/<script_name>:- startup script in
startup.sh. It is triggered every reboot from crontab. This script contains the startup parameters, so feel free to adjust it based on the available resources. - auto-shutdown script in
autoshutdown.sh. It is triggered every 15 mins from crontab. The interval of 15 mins can always be changed to any interval as long as it is supported by cron. Don't forget to adjust the SERVICE and USER variables.
- startup script in
Operations
When inside the compute engine.
- To check screen status
sudo screen -r // to enter screen
ctrl + A, then D // to detach screen back to background
- Check if crontab scripts are executed
cat started_date.txt // To check startup script
cat shutdown_date.txt // To check shutdown script