This is the second time I have had to run through install of a minecraft client and server. I decided I need documentation this go around for the next time I want to install a modded minecraft server.
I decided to use ansible to make deployments easy. My biggest struggle was upgrading from an older version of ansible using python 2.7 to ansible 2.9.6 using python 3.5.
Getting the client setup wasn’t too difficult.
I am running the Minecraft Client from my XPS workstation which runs Ubuntu 18.04.
I knew I had run Minecraft from the workstation before, but when I went to find the
.jar client I didn’t know where it was.
I couldn’t find it anywhere. I looked recursively in
/home/jack and in
/opt. It was nowhere to be found.
I started to install the forge client on my workstaion when I stumbled upon MultiMC which supports linux.
I then stumbled upon MultiMC already installed on my workstation with some older clients installed.
MultiMC allows to set the RAM. I have 16GB of RAM available. I allocated 8GB to the MC instance/ to JVM. I haven’t run into any issues thus far.
Installing the E2E ModPack
Installing the Modpack was relatively simple besides the fact that the modpack is reccomended to be installed using the Twitch client. I had to find the zip file of the client. The version I wanted was here. It was about 20MB.
The filename is a zip,
Enigmatica2Expert-1.77.zip. In MultiMC
add an instance and then choose a zip file modpack. Also make sure to have the correct Minecraft Version installed. This modpack uses MC 1.12.2.
The client requires 5GB, but recommends 6GB to 8GB. I wanted chunk loading and a few other compute and ram intensive features of Minecraft to run on a server so my workstation isn’t completely bogged down with processes.
The server also allows for other players to join.
I know I will want to spin up a MC server again and since I have done this before I have decided to create an ansible playbook for the service.
The playbook will need to be revised, but currently everything is in the common role. As I start to add more servers for games I will revise the roles for the different applications.
The directory service looks like the following:
. |____group_vars | |____all |____site.yml |____roles | |____common | | |____files | | | |____forge-1.12.2-220.127.116.1147-installer.jar | | | |____eula.txt | | | |____mc13.service | | |____tasks | | | |____configure_modpack.yml | | | |____main.yml | | | |____install_java.yml | | | |____install_forge.yml | | | |____start_server.yml |____hosts |____host_vars
site.yml in the playbook root directory calls the common role (
The common role runs as root. Really this is a prelimenary playbook that runs everything as root. It is really a temporary server meant to be run for fun. A more permanent solution would run as a minecraft user and take more variables into account.
This example uses a server with 8gb of ram and 2 cpus.
The one note I will make on this ansible setup is that the
roles/common/tasks/configure_modpack.yml file copies files from my user profile up to the server. (I had trouble pulling down
zip server files..) Here is what the task looks like:
- name: (Configure Modpack) Copy Folder - Mods copy: src: /home/jack/.local/share/multimc/instances/Enigmatica2Expert-1.77/minecraft/mods dest: /root - name: (Configure Modpack) Copy Folder - Scripts copy: src: /home/jack/.local/share/multimc/instances/Enigmatica2Expert-1.77/minecraft/scripts dest: /root - name: (Configure Modpack) Copy Folder - Schematics copy: src: /home/jack/.local/share/multimc/instances/Enigmatica2Expert-1.77/minecraft/schematics dest: /root - name: (Configure Modpack) Copy Folder - Resources copy: src: /home/jack/.local/share/multimc/instances/Enigmatica2Expert-1.77/minecraft/resources dest: /root - name: (Configure Modpack) Copy Folder - Config copy: src: /home/jack/.local/share/multimc/instances/Enigmatica2Expert-1.77/minecraft/config dest: /root - name: (Configure Modpack) Copy Folder - Manifest.json copy: src: /opt/minecraft/manifest.json dest: /root - name: (Configure Modpack) Add Eula copy: src: eula.txt dest: /root
Forge Installer vs Forge Universal
Forge installer is required to install MC Server. The Forge Universal is required to run the server.
Turning the Minecraft Server into a Service
The service runs java from an absolute path specifying 8gb of ram allocated to the JVM pointing to a jar file at the root users directory. The
nogui at the end specifys to forge not to open a GUI.
[Unit] Description=Minecraft Server After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=never RestartSec=1 User=root WorkingDirectory=/root ExecStart=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xms8G -jar /root/forge-1.12.2-18.104.22.16847-universal.jar nogui [Install] WantedBy=multi-user.target