Light python script to create a Java Edition Minecraft Server
I have been using How to Make Minecraft Server on Ubuntu 20.04 to make a solid Minecraft server. This also works for Ubuntu 22.04. I am essentially breaking up this instructions into a python script to automate the process. I will then test it out in an Ubuntu 22.04 VM to ensure it works properly.
I initially crated bash scripts to automate the process. This can be found in Minecraft-Installer---Bash-Scripts.
Get the server link at: Java Edition server
- git
- build-essentials
- openjdk-21(or latest version)
- mcrcon repository:
https://github.com/Tiiffi/mcrcon.git - Optional: UFW Firewall to set firewall rules
- Ensure
sedis installed - Inquirer and subprocess for the python script
- Run the script with
sudo python3 mc-installer.py
- Enter the password for mcrcon when prompted
- Paste in the link to the Minecraft Jar file.
- When installation is complete, run the following to verify that everything worked:
sudo systemctl status minecraft
- Run the script with
sudo python3 mc-installer.py- Select
Uninstall - Enter the name of the minecraft server. If the default was left during installation, leave the default name during this process.
/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 -p 'strong-password' -t