Code Monkey home page Code Monkey logo

minecraftsystemdunit's Introduction

MinecraftSystemdUnit

Systemd Unit file for Minecraft Server

Installation

  1. Connect to your (v)root server or if you want to run the server on your machine, open a terminal.
  2. Become root using su or sudo. To check if you are root run "echo $EUID" if it returns "0" you are root.
  3. Next install the necessary packages "apt install openjdk-8-jre-headless curl screen nano bash grep dialog"
  4. Create the /opt folder if it doesn't already exist "mkdir /opt"
  5. Now you need to create the user for the service: "adduser --system --shell /bin/bash --home /opt/minecraft --group minecraft"
  6. Create the Systemd Unit file "nano /etc/systemd/system/[email protected]" : "curl https://raw.githubusercontent.com/FlamingPaw/MinecraftSystemdUnit/master/minecraft%40.service > /etc/systemd/system/[email protected]"

Setup Instance

Now you can Upload your FTB Modpacks into an subfolder of /opt/minecraft/. For example you would place the modpack "FTB Beyond" in "/opt/minecraft/FTBBeyond" (without spaces in the name).

If you want to run vanilla instances, just create a folder within /opt/minecraft and upload the minecraft_server.jar and create the eula.txt file (using: echo "eula=true" > /opt/minecraft/vanilla/eula.txt).

After you uploaded the minecraft server files, make sure, that "minecraft" is the owner and owning group. To do so just run "ls -la /opt/minecraft". If it is not, run "chown minecraft:minecraft /opt/minecraft".
You may also require to complete the installation. For current FTB packages you would run:

cd /opt/minecraft/FTBBeyond
echo "eula=true" > /opt/minecraft/FTBBeyond/eula.txt
su -c "/opt/minecraft/FTBBeyond/FTBInstall.sh" -s "/bin/bash" minecraft

Usage

Enable Autostart

systemctl enable minecraft@FTBBeyond

Disable Autostart

systemctl disable minecraft@FTBBeyond

Start Manually

systemctl start minecraft@FTBBeyond

Stop Manually

systemctl stop minecraft@FTBBeyond

Enter Server Commands

To connect to the console to enter commands, run the minecraftConsole.sh interactive script.
Note: To detach (exit) screen press [STRG] + [A] followed by [D].

./minecraftServerManager.sh

minecraftsystemdunit's People

Contributors

flamingpaw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.