Giter Club home page Giter Club logo

minecraftbedrockserver's Introduction

Minecraft Bedrock Server

日本語版 README はこちら

Sets up a Minecraft Bedrock dedicated server on Ubuntu / Debian with options for automatic updates, backups and running automatically at startup
View installation instructions at: https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/

Features

  • Sets up the official Minecraft Bedrock Server (currently in alpha testing)
  • Fully operational Minecraft Bedrock edition server in a couple of minutes
  • Ubuntu / Debian distributions supported
  • Sets up Minecraft as a system service with option to autostart at boot
  • Automatic backups when server restarts
  • Supports multiple instances -- you can run multiple Bedrock servers on the same system
  • Updates automatically to the latest version when server is started
  • Easy control of server with start.sh, stop.sh and restart.sh scripts
  • Adds logging with timestamps to "logs" directory
  • Optional scheduled daily restart of server using cron

Quick Installation Instuctions

To run the installation type:
curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash

Installation Guide

Minecraft Bedrock Dedicated Server Script Installation / Configuration Guide

Installing Resource Packs / RTX Support

For instructions on how to install resource packs (including optional RTX support) view my step by step Minecraft Bedrock Dedicated Server Resource Packs / Optional RTX guide here.

Tested Distributions

  • Ubuntu / Ubuntu Server 20.04
  • Ubuntu / Ubuntu Server 18.04
  • Debian Stretch / Buster

Tested Platforms

  • All PC X86_64 (WORKING)
  • Udoo X86 (WORKING)
  • Intel Compute Stick (WORKING)
  • Other X86_64 platforms (WORKING)
    • ARM 64bit (WORKING -- needs linker and other binaries used for emulation to be updated)
      • Raspberry Pi (WORKING, SLOW, Ubuntu required, not working on Pi OS 64 bit and has segfaults)
      • Tinkerboard (WORKING, SLOW)

Multiple Servers and Installation Paths

The server supports multiple servers at once. When you run SetupMinecraft.sh again pick the identical root path as any previous servers. The path structure of the scripts is $ROOTPATH/minecraftbe/yourservername which is why the "root" path SetupMinecraft.sh asks you for should always be the same.

The individual server folder is determined by the "server name" you enter for your server. If it's an existing server the scripts will be safely updated. If it's a new server then a new folder will be created under $ROOTPATH/minecraftbe/newservername.

Keep the installation the path the same for all servers and the script will manage all this for you.

Add systemd permissions (optional)

Some users track the Minecraft servers by the systemd service. If you are using the automatic daily restart feature the service will not show as "online" since restart.sh does not run as root so it doesn't restart the systemd service.

To fix this add a line to your sudoers file (sudo visudo) like this:

yourusername ALL=(ALL) NOPASSWD: /bin/systemctl start yourservername

This will give you

Update History

  • November 2nd 2021
    • Fixed extra / in front of permissions fix script (thanks MarkBarbieri, issue #109)
  • October 31st 2021
    • Fixed missing sudo from fixpermissions line in start.sh (thanks MarkBarbieri, issue #109)
    • Fixed missing -a parameter from /etc/sudoers file addition thanks MarkBarbieri, issue #109)
  • August 1st 2021
    • Updated documentation and root path selection prompt to make it more clear that the root directory should be the same for ALL servers
    • Don't change unless installing to a different disk, and then use the same root path for ALL servers as they will follow the structure $ROOTPATH/minecraftbe/yourservername
    • Choosing a perfect storm of invalid paths has resulted in people's server files being pruned before from being off by one folder sublevel etc. Please follow instructions carefully here and do not change it and make sure you have backups (saved outside of the main Minecraft backups folder) before ever trying to install an additional server or updating existing scripts.
    • Fortunately this person was starting a new server so the pruning didn't get anything serious but I can't stress enough to leave the paths alone unless you're legitimately an expert with a use case like having an entire separate disk for all the Minecraft servers. Use the same root directory every time (preferably the default)!
  • July 27th 2021
    • Cleaned up SetupMinecraft.sh and removed redundant code by organizing code into functions
    • Scripts now fix all server file permissions on startup
    • Added /etc/sudoers.d/minecraftbe file to contain passwordless sudo permission for fixpermissions and sudo systemctl start server
  • July 21st 2021
    • Updated documentation and restart.sh to document how to enable systemd's service showing as "online" after called by restart.sh (useful for people tracking the servers using the systemd service) by adding a line to the sudoers file to allow passwordless sudo for the sudo systemctl start yourservername command. Restart.sh now has commented lines at the bottom along with instructions on how to enable if you need this functionality (most people probably won't)
    • Added error redirection to crontab line to help diagnose failures during scheduled restarts and removed ExecStartPre from the service as it wasn't doing anything (run ./fixpermissions.sh if you need to fix the permissions) and caused compatibility issues with older systemd versions
  • July 17th 2021
    • Added in check to ensure start.sh and other scripts are not being ran as root. If this happens you have to use sudo screen -r to find the screen and the permissions will be wrong since root isn't the owner of the server files
    • If you know you ran the script/server as root (which starts creating files owned by root instead of the regular user) and your server won't start/is wonky run the fixpermissions script from your server folder with ./fixpermissions.sh and it will correct them for you!
  • July 15th 2021
    • Added update.sh convenience script to run SetupMinecraft.sh to update everything to the latest version
    • Added validation loop for directory path -- if you are upgrading from an old version you should use the default directory.
    • Nothing good can come from changing this and I've never seen or heard of it solving a single problem despite being requested for years (especially if you don't understand relative vs fully qualified Linux paths and other pitfalls -- leave it default!).
    • Attempting to solve this problem with safety checks in case this is useful to some people and I just haven't heard about it but it may be removed entirely or turned into a check that you have to download and modify the script to enable if it continues to be a source of strife for people.
    • Updated depends.zip for Raspberry Pis
  • July 4th 2021
    • Added missing sudo line to some prerequistes and removed apt-get install sudo as the script no longer runs as root (install sudo if missing) - thanks Rick Horn
  • July 3rd 2021
    • Added Accept-Encoding: Identity header to curl as a very small % of users are getting an "Access Denied" error without this header (thanks titiscan, pull request #95
    • Added default language header to curl as non-english computers were getting an Access Denied error
    • Script now checks for gawk being present in start.sh. If it's not installed (likely due to reusing old SetupMinecraft.sh files) timestamps will be disabled. This will prevent the server from failing to start. This is avoided by not running an old copy of SetupMinecraft.sh!
    • Removed broken screen -r command at the end of SetupMinecraft.sh as fixing it actually causes lockups -- instead now gives the command (screen -r) to pull up the Minecraft console. Press Ctrl+A then Ctrl+D to hide the console once you're inside it.
    • Added code to prevent SetupMinecraft.sh from being ran as a local file (please use the new method of curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash)
  • July 2nd 2021
    • Improved dependency detection and installation
    • Removed wget dependency
    • Added gawk dependency -- this should not have any impact on most systems but on systems that use mawk by default this will fix server startup issues related to timestamps since mawk doesn't support strftime
    • Fixed stop.sh's -t countdown option (thanks da99Beast, issue #76)
    • Fixed a nasty issue where the installation of libcurl3 over the top of libcurl4 was allowed in some configurations (like Ubuntu 18.04) and was clobbering curl (thanks Goretech)
    • Fixed an issue where empty folders could be created in the wrong location if start.sh was not ran from the server folder (thanks CobraBitYou, issue #93
  • July 1st 2021
    • Changed from wget to curl as wget is freezing (but curl works)
    • Added randomization to user agent
  • June 19th 2021
    • Fixed timestamps to display on every line (thanks murkyl)
    • Added chmod command after unzip line to make bedrock_server executable for issue #22 (thanks murkyl)
    • Merged pull request #91 from starkey-01 to add prompt for an alternate installation directory. This has been requested for a while so thanks starkey-01!
    • Merged pull request #88 clarifying instructions to run script as non-root user (thanks sparagi!)
  • May 23nd 2021
    • The fixpermissions.sh script now displays the last 5 lines from the latest log file to aid in troubleshooting. If your server won't start this script often will take care of it and the logs can give useful information otherwise!
  • May 22nd 2021
    • Added setting the path variable to each script to prevent service from failing to start due to not being able to find the right path.
    • Please redownload SetupMinecraft.sh for this update. The script will give you a warning each time you start up that it couldn't set the path variable without the new SetupMinecraft.sh script
    • Added user agent to wget string to prevent update check from failing
    • Added automatic update to SetupMinecraft.sh if it has not been modified for more than 7 days
    • Updated Raspberry Pi dependencies
  • April 22nd 2021
    • Added a safety check to prevent installing on 32 bit (i386 or i686) operating systems. The official Bedrock dedicated server has only been released as a 64 bit (x86_64) binary and attempts at emulation on 32 bit have failed to yield any successful results!
    • Added chmod +x bedrock_server to start.sh as updates seem to be removing executable permissions sometimes
    • Fix removing old backup directory context (thanks murkyl, issue #76)
  • April 20th 2021
    • Fully qualified route command with /sbin/route to alleviate network check breaking some servers
    • Added safety check to prevent using the server label 'minecraftbe' which can break the scripts
    • Added libc6 dependency check as several people have reported libns1.so.1 missing
    • Added curl and libcurl3 dependency as a fallback for older distros to avoid missing libcurl.so errors
    • Added libcrypt1 dependency check
  • April 7th 2021
    • If you are updating from an old version make sure you remove the old SetupMinecraft.sh and redownload the new version from scratch. If you are seeing something like userxname in the systemd service you're using an old version of SetupMinecraft.sh and need to download the latest
    • Updated fixpermissions.sh -- can fix issues with permissions if you are seeing them!
    • Fixed a bug with userxname appearing in start.sh and not being updated to the correct username
    • Fixed an issue that could trigger PAM authentication in start.sh
  • March 16th 2021
    • Fixed a incomplete sudo line in start.sh that was throwing an error (thanks /u/zfa from reddit!)
  • February 1st 2021
    • Added fixpermissions.sh utility script to take ownership of Minecraft server files manually (the systemd startup service does this automatically for you if you are using it)
  • January 31st 2021
    • Added .\ in front of the screen -q checks to prevent similar usernames from tripping up window detection
    • Server now takes ownership of server files on each start to prevent folks a whole heap of trouble and heartache when restoring backups/moving files/etc.
  • December 20th 2020
    • Added experimental QEMU support for 32 bit (i386, i686) similar to how the ARM support works
  • December 18th 2020
    • Added safety check to prevent the script from being ran as root or sudo. This would cause the script to be installed to the /root folder.
    • If you know what you are doing and want to override just edit the check out of SetupMinecraft.sh but otherwise just run it as ./SetupMinecraft.sh normally.
    • Fixed a nasty bug that could cause start.sh and stop.sh to disapper (thanks Paul and James). This was related to log pruning and not having a hard path. If you downloaded the SetupMinecraft script in the past 3 days update and try again here and you'll be set!
  • December 15th 2020
  • December 13th 2020
    • RTX beta is now supported as long as you aren't on the "beta" channel anymore. Unenroll from the RTX beta and downgrade to normal Minecraft. RTX is in normal Minecraft now.
    • Fixed ARM support for Raspberry Pi, Tinkerboard, and others. Be warned, it's still very slow on ARM!
    • Updated depends.zip
  • December 10th 2020
    • Cleaned up documentation
    • Added notice that the RTX beta version of Minecraft's dedicated server has not been released yet. Support will be added the moment it is!
    • Added alpha software notice for Bedrock dedicated server per issue 34
  • November 17th 2020
    • Fixed server autoupdating in start.sh
    • Minecraft.net had made a change where the "--spider" parameter would return a 503 -- removed this to fix automatic updates
  • July 24th 2019
    • Fixed Raspberry Pi support
  • July 10th 2019
    • Fixed OpenSSL error in 1.12 (thanks obviator!)
    • Fixed ports not choosing defaultS if nothing is entered (thanks sweavo!)
  • July 2nd 2019
    • Added libcurl4 Bedrock server dependency to installer script to prevent server startup from failing
  • July 1st 2019
    • Added support for multiple servers
    • Choose the folder name and port for the server in SetupMinecraft.sh (must be unique per server instance)
  • May 23rd 2019
    • Fixed typo in restart.sh where there was a space after stop command preventing the server from closing cleanly
    • Added 10 second sleep after a force close to give the server time to fully close before calling start.sh
    • Fixed server not restarting after scheduled nightly reboot (related to restart.sh bug)
    • Removed some direct (for example paths like /bin/sleep) that were harming cross platform compatibility
  • April 26th 2019
    • Tested new Bedrock dedicated server 1.11.1.2
    • Added startup counter to server instead of waiting a flat 4s to reduce unnecessary waiting
    • Fixed ARM support (64 bit required)
  • April 18th 2019
    • Changed StopChecks++ to StopChecks=$((StopChecks+1)) to improve portability (thanks Jason B.)
    • Added TimeoutStartSec=600 to server to prevent it being killed if taking longer than usual to download server
  • March 7th 2019
    • Added Armbian support
    • Tested with Tinkerboard
    • Fixed portability issue with route vs /sbin/route
  • March 2nd 2019
    • Running the SetupMinecraft.sh script after already installing now updates all scripts and reconfigures the minecraftbe service
    • Script now works on any Debian based distribution (Ubuntu, Debian, Raspbian, etc.)
    • Added *very slow* support for ARM platforms such as Raspberry Pi with QEMU emulation of x86_64
    • Renamed service to minecraftbe to avoid confusion with Java version
  • February 15th 2019
    • Backups now compress into .tar.gz format (saved in backups folder)
    • Startup service waits up to 20 seconds for an internet connection to allow time for DHCP to retrieve an IP address
    • Removed unnecessary sleep time on stop.sh script so it returns as soon as the minecraft server closes
  • February 8th 2019
    • Initial release

minecraftbedrockserver's People

Contributors

jordanmajd avatar kmpoppe avatar masayakondo999 avatar omkhar avatar rumyantsevmichael avatar sparagi avatar sweavo avatar theremote avatar titiscan 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.