- Minecraft Forums
- [Server Manager][Backup] Linux Minecraft Server Manager (LMSM)
- Saved searches
- Use saved searches to filter your results more quickly
- docent-net/mc-server-manager
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
Minecraft Forums
[Server Manager][Backup] Linux Minecraft Server Manager (LMSM)
- The Meaning of Life, the Universe, and Everything.
- Join Date: 5/26/2013
- Posts: 52
- Minecraft: Jared_Brian_
- Member Details
Linux Minecraft Server Manager (LMSM)
This is a simple program designed to run over your Minecraft server in order to run your server cleanly and without having to type in commands every time you want to start a server. You can also create and manage backups easily or not at all (if you want).
This program is specifically designed for Linux systems however this is a bash script and from what I understand is also supported on mac however it hasn’t been tested on any mac and I have no idea if it works on the mac OS at all (if someone can let me know if it does if you have a mac that would be great). And unless you are some kind of wizard it won’t work on windows at all.
Also, This is an open source project and you can use this to your heart’s content, just make sure to give credit
*This program has noGUI and must be run in a terminal (which shouldn’t be a problem because normally you would have to run a Linux server in a terminal anyway) it is designed to be as simplistic as possible as to be easy to use and require very little interaction after initial setup.
*It makes it so you can run a server with a desktop icon or launcher if setup correctly or with a single command in the terminal.
*It will create backups (or not at all) after you stop the server and will automatically delete the oldest backup after the max backup limit is passed (default is 4) and store the backups in any folder you want (as long as it was empty).
*I haven’t tested this fully but it should theoretically work with all types of servers. Vanilla, modded, bukkit, alpha 1.0 to the newest snapshots but if you find a version that doesn’t work please let me know.
*All of the same server commands such as /stop and /stay work and are unaffected.
*The files can be put anywhere on your computer and can run a server placed anywhere else as long as you set up the config correctly.
*It Can run the server with or without the Minecraft server GUI (not recommend as on Linux it creates a lot of lag).
*It Can run a server with any amount of ram you want.
There should be 3 files in the .zip file, a runnable bash file named LMSM, a LMSM.cfg file, and a README file.
To run the manager (the LMSM bash file) make sure you have given the bash file permission to run and have Java installed.
(on Linux mint 18.1 right click on the file go to properties then to permissions and check the box saying allow executing file as program).
then open up the LMSM config and adjust all of the settings as necessary.
***note if this is your first time using this program you will have to change the config in order for the server to run.
You can edit the config by opening the LMSM.cfg file and following the instructions there, for the first time setup, the most you should have to change is the server directory and the world name.
Then just double click on the bash file and click run in terminal and that’s it.
***These next instructions are specifically for Linux Mint 18.1 it depending on your Linux distro you may have to do your own research on this but from what I understand these instructions should be the same for most people.
If you would like to be able to make a desktop launcher for your server you can do that by making a «bin» folder in your home folder.
(if you do not already have one you may have to restart your computer after making the bin folder).
and then placing the entire LMSM file into there.
That will allow you to open any terminal and type LMSM and it will run the server.
*** if this does not work for some reason use the next set of instructions
So using this make a new launcher, right-click on your desktop and then go to Create new launcher here.
Then all you need to do is give it a name, enter LMSM as the command and check the box that says run in terminal and click Ok.
Now you can just run that launcher to start your server.
***note running the command LMSM will not work if it is not in your bin folder and requires at least one restart for your computer to see the bin folder as a place to see commands.
If you want to have it in a different directory you can just click the browse option in the launcher creation window and then find where you have your LMSM bash file located and it will do the same thing.
If you want multiple servers or more than one LMSM file in your bin folder you can just rename the LMSM bash file and folder to whatever you want.
***note the folder name and the bash file name do not have to be the same.
and then the new name of the bash file will be your new command to run the server with.
Just as long as you don’t change the name of the config file or move it into a different directory the server will run.
The backups folder will delete anything else that is in there (or at least most of it) besides the backups it creates so please do not use an existing folder for backups.
To reload a world from your backups folder all you have to do is delete the date given to the backup or rename the backup to exactly to what the world file is called and place it in your server directory (replacing the current one).
I am not responsible for any deleted files or corrupted game worlds. please use at your own risk.
*if you are unable to just run LMSM or whatever you have the name as in the terminal
make sure the whole LMSM file is in your bin folder
make sure you are typing the command correctly
*if you get this error «/FILE_TO_LMSM_DIRECTORY/LMSM: line 8: /FILE_TO_LMSM_DIRECTORY/LMSM.cfg: No such file or directory»
make sure the config file is the same folder as the bash file
*if you get this error «Error: Unable to access jarfile minecraft_server.VERSION.jar» or find: ‘backups/*’: No such file or directory
make sure all of your paths in the config are set correctly and that you have the correct version of Minecraft set
make sure if any of the directories have a space in the name that you use a \ just before the space
ex) «User/Home/Minecraft/Minecraft\ Servers/Example\ Server»
also, the version of Minecraft has to equal the version that is on the Minecraft jar file and has to be the default name
*if you get this error Error occurred during initialization of VM Too small initial heap
make sure you have the correct unit of memory on the end of your allocatedMemory slot in the config
this error could also mean your value is too low it should be at least 1G or 1024M
*if you get this error message cp: cannot stat ‘NAME_OF_MINECRAFT_WORLD’: No such file or directory mv: cannot stat ‘BACKUP_DIRECTORY/NAME_OF_MINECRAFT_WORLD’: No such file or directory
make sure you have your Minecraft world name set correctly in the config
and if there are any spaces in the name to use a \ just before the space
*if you get a lot more lag than usual
make sure that the Gui is set to false in the config
*if you are still having problems set the debug mode slot in the config and that might help you find errors in the config file
*** if none of these help you look in the comment section below and see if there is a solution there and if not give me the details and ill try to help you
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
docent-net/mc-server-manager
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
The main goal of this project is to manage Minecraft server instances on a container / virtual machine / physical server having only 1 instance running at a time.
- Any systemd-powered Linux server with Minecraft server installed.
- Python 3.8
- Installed libraries from requirements.txt
- enter backend directory
- test script installation and configuration: ./manage.py test
- activate specified server: ./manage.py activate —server_name=
- stop server: ./manage.py stop
- start server: ./manage.py start
- restart server: ./manage.py restart
- secure server: ./manage.py secure —server_name=
- delete server: ./manage.py delete —server_name=
- create a new server from template: ./manage.py create —server_name=
- start server (will bind to 8000 port): cd backend; python app.py
- api methods:
- /health (GET)
- /get_servers (GET)
- /activate_server (POST, GET: )
- /delete_server (DELETE: )
- /create_server (PUT: )
- /restart_server (POST, GET)
- /delete_server_instance/ (DELETE)
Installation and configuration
- clone this repository
- For backend/API server:
- copy minecraft-server.service to the **/USER_HOMEDIR/.config/systemd/user/minecraft-server.service
- edit above service file to match your environment and needs
- install required Python libraries ( pip install —user -r requirements.txt )
- confirm everything works fine: cd backend; ./manage.py test — this should list all servers found in USER_HOMEDIR/servers-data directory as well as should display current state of the Minecraft server.
- copy config.ini.template to /USER_HOMEDIR/.minecraft/mc-manager-config and edit its contents to match your environment**
- run backend server: python app.py
- For frontend / UI
- Install prerequities: cd frontend-ui; npm install
- Create configuration for prod: 1. cp .env.template .env.production 1. edit .env.production and fill with prod values 1. run via: node_modules/.bin/vue-cli-service serve —mode production
The main goal of this project is to provide user with a tool (CLI and UI) for managing many MC server instances within one Linux server instance.
Under the hood — how it works?
- Linux server instance is powered with systemd
- Minecraft server is installed in /USER_HOMEDIR/minecraft-server
- Servers data directory is in /USER_HOMEDIR/servers-data
- There is also a copy of srv-template directory (provided in this repo) under /USER_HOMEDIR/srv-template
- A systemd unit service is created in /USER_HOMEDIR/.config/systemd/user/minecraft-server.service and managed by this user (without a need for elevated permissions)
Now, in order to create a new server scripts/API basically copy all files from srv_template to a new subdirectory under servers-data (e.g. servers-data/new-server).
In order to activate a server script will remove all symlinks from minecraft-server directory and create new ones pointing at servers-data/new-server. Afterwards it will restart minecraft-server.service service.
Server template is basically a list of files that are customized per server instance and belongs to a specific server instance. All other files (binaries, libraries) are common.
- Server template files (that will be symlinked):
- banned-ips.json
- banned-players.json
- bukkit.yml
- commands.yml
- crash-reports
- logs ops.json
- permissions.yml
- server.properties
- spigot.yml
- usercache.json
- whitelist.json
- world
- world_nether
- world_the_end
Minecraft server versions
For now the whole machinery make a naive assumption that every server instance works on the same Minecraft server version.
There is a file git-hooks/pre-commit which contains pre-commit hooks used in this repo for running all required unit tests, lint checkers etc.
Copy it to .git/hooks/pre-commit in order to have it run on commit.
Same tests will be run before Pull-Request review.
All backend components are stored inside of backend directory.
For development purposes there is a minecraft-server-stub.service in this repo which might be used for testing various server scenarios.
Developing backend services requires Python 3.8 and libraries installed from requirements.txt. Using pyenv is recommended.
In order to start API server:
Above will start the server on 127.0.0.1:8000
UI uses vue.js library. All UI components are stored inside of frontend-ui directory.
In order to prepare your frontend development environment:
$ cd ftontend-ui $ npm install $ npm run server # or directly via vue plugin: $ node_modules/.bin/vue-cli-service serve --mode development