Skip to content

JonathanTippy/minecraft_server_scripts

Repository files navigation

minecraft_server_scripts

These scripts are for managing a forge or fabric headless minecraft server while tunneling with playit.gg. They were written on debian bullseye and might not work on other distributions.

Installing Dependancies

playit

mcrcon

java

  • sudo apt update
  • sudo apt install openjdk-17-jre-headless

Installing Scripts

Setting up Minecraft Server

  • mkdir /opt/minecraft
  • sudo chown $USER /opt/minecraft -R
  • run either minecraft_update_fabric or minecraft_update_forge
  • sudo cp minecraft.service /etc/systemd/user
  • sudo loginctl enable-linger username
  • systemctl --user daemon-reload
  • systemctl --user enable minecraft
  • systemctl --user start minecraft

Installing playit.service

  • playit (set up playit on their website with the link in the program)
  • sudo cp playit.service /etc/systemd/system
  • sudo systemctl daemon-reload
  • sudo systemctl enable playit
  • sudo systemctl start playit

adding a server backup to crontab (optional)

you can also use the restic option for super compact backups, but this will require you to create a restic repo. I will not explain how to do that. Also, I will not explain how to retrieve the data from the restic repo. There isn't much of a reason for this, I just don't want to do it right now but i wanted to add the restuc backup script

  • mkdir /var/local/minecraft
  • sudo chown $USER /var/local/minecraft
  • crontab -e
  • add the following line to the bottom of the file
  • 0 0 * * * /usr/local/bin/minecraft_backup

adding mods to the server (optional)

  • curseforge_mods_downloader
  • download the mods and copy the links afterwards
  • add each mod link in its own line
  • press ctrl + s to save the mods list file and then ctrl + x to close the file
  • watch the server boot and answer weather it works or not
  • if it doesn't work, wait a few seconds and try again with different mods

Screenshot_2022-10-06_11-04-50

About

some scripts and .service file I wrote to manage a headless minecraft server

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages