Minecraft server manager (MCSM)

Minecraft server manager (MCSM)

Wouldn’t it be nice to be able to install the latest server with mcsm install? Or create a new world and load it, automatically backing up your current world first, by running mcsm switch my_new_world? I thought so, which is why I wrote this script.

Requirements

Even though I designed this script for my personal use, I’m sharing it because I think it might be helpful for others, but it does make quite a few assumptions:

  • This script is run using Python 3.7+ (some slightly older versions may work)
  • This script is run on Linux (or maybe macOS)
  • This script is run from the same machine as the server
  • The JRE used is on the path as java
  • There is a single server
  • The server executable is named server.jar
  • tmux is installed and available on the path as tmux
  • The server runs in a tmux session
  • The server is located in /srv/minecraft (editable under “File locations”)

It supports managing EssentialsX warps attached to multiple worlds and promoting players using LuckPerms. I use it with Paper, but it should also work with Spigot/Bukkit and maybe even Vanilla.

Getting started

  1. Download mcsm.py above (last updated 2020-06-14)
  2. Copy it to the directory of your server
  3. Configure the file locations by editing the variables at the top of the file
  4. Make it executable with chmod +x mcsm.py
  5. Run ./mcsm.py help to get the following information:

Other versions

  • If you like web interfaces and opening security holes to make things work (which I welcome PRs to fix), you may be interested in a PHP interface that preceded this script.
  • If you thirst after compiled binaries and/or Rust, you may be interested in the Rust CLI iteration, which eventually led to this script so that I could iterate it faster as I identified new tasks I needed the script to handle.