notes/Setting up Minecraft as a systemd service..md
2023-07-23 08:16:03 -06:00

19 lines
609 B
Markdown

This enables minecraft to run in the background, restart if it crashes, etc etc.
In `/etc/systemd/system`, place this file and tailor it to your liking.
```
[Unit]
Description=Minecraft Servre
# I don't know what these mean I'm getting them from here:
# https://gist.github.com/dotStart/ea0455714a0942474635
Wants=network-online.target
After=network-online.target
[Service]
# If wanted, you can set a particular group or user to run the service under
# User=foo
# Group=bar
# This command is run when the service is started
|ExecStart=/usr/bin/java -Xmx3G -jar /path/to/server.jar --nojline --noconsole
```