Installation Guide


Content

Requirements

For the all-in-one package you only need to have Java installed.
For all the packages the following requirements have to be fulfilled:
  • Java runtime (i.e. you can run the Minecraft server)
  • Webserver with PHP 5.2 support
  • SQLite or MySQL PDO extension for PHP (all distributions have packages for this or include it by default)

Quick Guide

Linux

Please note that if you unpack the archive under Windows you might end up with a 0 byte executable because there is a hardlink in the archive. Please unpack it directly on the Linux machine

The following commands are meant to be run with superuser privileges.

Download Multicraft:
# wget http://www.multicraft.org/download?arch=linux64 -O multicraft.tar.gz
(32 bit link: http://www.multicraft.org/download?arch=linux32)

Extract the Multicraft archive:
# tar xvzf multicraft.tar.gz

Change into the extracted directory:
# cd multicraft

Run the setup.sh script:
# ./setup.sh

Then simply follow the instructions.

SELinux note: If you're using SELinux we recommend you use MySQL instead of SQLite, otherwise you'll have to change the security context for the database file located in the Minecraft users home directory (chcon -u user_u -r object_r -t httpd_sys_content_t /home/minecraft/multicraft/data)

The script does the following: click to expand

The setup script will tell you what to do next, here's a summary of that:
  • Access the control panel under http://your.address/multicraft/, it will start the front end installer
  • Start the daemon (the setup script shows the command for that: "<multicraft dir>/bin/multicraft -v start")
For security purposes, please delete the "install.php" as soon as everything is working.

You can now proceed to downloading Minecraft and creating your first server:
  • Log in as admin
  • Go to "Settings" -> "Update Minecraft"
  • Click on "Download" to fetch the latest version of Minecraft.
  • As soon as it says "The update is ready to be applied." you can click on "Install" to put the downloaded file in place.
  • It should say "Update successful" after that. Minecraft is now installed
  • Create your servers under "Servers" -> "Create Server"


Windows all-in-one

Note: If you have rented a server somewhere else you don't need to install Multicraft. Please ask your hosting provider where their Multicraft installation is located.

Simply extract the downloaded archive and run "start.bat". This will run Multicraft in place, you don't need to install it.

The panel can then be reached under http://localhost/

If the above link doesn't work after running start.bat, your computer may already be running something that is using port 80.

You can try changing the port of the built-in webserver like this:
Edit "Multicraft\nginx\conf\nginx.conf" line 16, change 80 to 8080, then run "stop.bat", then run "start.bat" then go to http://localhost:8080/



Windows advanced

If you have downloaded the Windows all-in-one package you don't need to follow these instructions. Running "start.bat" is sufficient for this package!

This advanced installation is for people who require greater control over their Multicraft deployment or already have a webserver installed and wish to use that with Multicraft.


  1. Download the Windows release zip file
  2. Extract the contents of the archive to your user directory (For Windows 7 this is: c:\Users\YOURUSER), this can also be changed in your "multicraft.conf" if you want to put it in a different place.
  3. Rename "multicraft.conf.dist" to "multicraft.conf", edit it to suit your needs
  4. If you have purchased a license you can create a file called "multicraft.key" in the multicraft directory and put your license key in there
  5. Make sure you have the "Microsoft Visual C++ 2008 Redistributable Package" 32bit version installed. (download)
  6. Copy the contents of "panel\" to the web root of your webserver
  7. Run the front end installer (e.g., http://your.address/install.php)
  8. For the daemon database, either enter the path to your "data.db" (e.g., "C:\Users\YOURUSER\multicraft\data\data.db") or use MySQL
  9. Start "multicraft.exe" in "multicraft\bin". If the window closes immediately you'll have to run the program from command line to see the error message or have a look at the "multicraft.log" file

For security purposes, please delete the "install.php" as soon as everything is working.


You can now proceed to downloading Minecraft and creating your first server:
  • Log in as admin
  • Go to "Settings" -> "Update Minecraft"
  • Click on "Download" to fetch the latest version of Minecraft.
  • As soon as it says "The update is ready to be applied." you can click on "Install" to put the downloaded file in place.
  • It should say "Update successful" after that. Minecraft is now installed
  • Create your servers under "Servers" -> "Create Server"


Instructions for Manual Installations

After extracting multicraft.tar.gz you'll find a folder "multicraft" with the following contents:
  • bin/ - contains the daemon software
  • jar/ - contains .jar.conf files, required to update the JARs over the panel
  • panel/ - contains the control panel
  • eula.txt - The Multicraft End User License Agreement
  • multicraft.conf.dist - The default config file, rename to multicraft.conf to use it
  • setup.sh - The installation helper script

Installing the Daemon

Place the folders "bin" and "jar" wherever you'd like the daemon to run from and then edit multicraft.conf to suit your needs and place it in the bin folder. By default it will expect a user "minecraft" with group "minecraft" on the system and create everything related to multicraft in a folder "multicraft" under this users home.
All of these paths can be changed in the "multicraft.conf" file.
Note that for security reasons the daemon will not crate the base folder if it doesn't exist and inform you that it is missing.

Using SQLite
If you're using an SQLite database (the default) the user running the control panel needs to have access to it. On a default Debian setup this user will usually be "www-data". In order to create files with the correct permissions the daemon has to be run as root (it will drop the privileges as soon as the files have been created and the permissions set).
Alternatively the daemon can be run under the user of the control panel. This implies that everything created by the daemon will be owned by the user running the control panel (e.g. "www-data").

Using MySQL
When using MySQL the user of the control panel doesn't need to access any files of the daemon directly and can even be installed on a different machine. The database is configured in "multicraft.conf" and there are example lines for MySQL.

Please see How To's for more advanced configurations.


Installing the Control Panel

Place the directory "panel" somewhere in your web root then visit the "install.php" in your browser and use the same settings you put in your "multicraft.conf".
The front end can also be configured manually by copying the file "protected/config/config.php.dist" to "protected/config/config.php" and editing it to suit your needs.


Starting the Daemon

Once the daemon and the panel have been installed and configured you can start the daemon by changing into the directory where you've put the "bin" and "jar" directories and running:
# ./bin/multicraft -v start
The "-v" stands for verbose output. If the control panel doesn't find the daemon, please check the "multicraft.log" for error messages.



User Contributions

Disclaimer: These are user contributed items, neither multicraft.org/xhost.ch GmbH nor the providing party assume any warranty whatsoever for any outcome as a result of using any of the listed scripts, programs, instructions or other items.




Upgrading

Be sure to always make backups of your data (databases and user files) before upgrading. The developer assumes no responsibility whatsoever for any damages. Note: the front end config files "main.php" and "daemon.php" do not exist anymore, they have been replaced by a single "config.php" which is generated by the installer (it can also be copied manually from "config.php.dist").

Upgrading in short:
  • Stop the daemon (e.g. "/home/minecraft/multicraft/bin/multicraft -v stop")
  • Replace the daemon and front end files either by re-running the setup script or by replacing the files manually.
    Don't forget to set the correct permissions if you're replacing them manually
  • Re-run the front end installer (http://your-panel/install.php)
  • Start the daemon (e.g. "/home/minecraft/multicraft/bin/multicraft -v start")
You can simply install the new release over the old one using the setup script. Be sure to take a look at the new "multicraft.conf.dist" and see if you need to merge any of the new options in your existing one.
Also make sure you don't just delete the old Multicraft front end or daemon directories as they contain your server files and if you're using SQLite also your database files.

All-in-one package note: Copying the new package over the old one will overwrite your config files and databases, be sure to back up everything in the "data" directory first.

Version Notes

1.8 Version Notes
If you didn't use the setup.sh script to update, please see the 1.7 version notes below.

It's recommended to delete the file protected/runtime/bukget.sqlite if it exists after applying this upgrade.


1.7 Version Notes
Version 1.7 is not a feature release, it mainly consists of changes to the back-end to make Multicraft more robust. Because of this it is strongly advised to test the upgrade procedure on a test system with your data first to ensure that your systems continue to work normally with the changes.

If you didn't use the setup.sh to upgrade or if you didn't let setup.sh overwrite the multicraft.conf file, the following changes might be necessary:
  • Change the "user" setting to "minecraft" (or any other user you chose to own the Multicraft files)
  • Update the multicraft.conf settings, see Config File Changes below
  • Make sure the file bin/useragent is owned by root with the group set to the Multicraft user. E.g.: chown root:minecraft bin/useragent
  • Make sure the file bin/useragent has the correct permissions set, e.g.: chmod 4550 bin/useragent


Configuration File Changes

Config File Changes in 2.0.0
New settings in 2.0.0
[multicraft]
## The maximum number of daemon connections a single client can open.
## default: 50
#maxClientConnections = 50

## The directory containing server templates
## default: templates (-> "baseDir"/templates)
templatesDir = templates

## This file defines the config file to use depending on the executable name
configsFile = server_configs.conf
## This config file contains the default server configuration. It is not
## in the "jar" directory so it does not get listed as a selection in the
## JAR File dropdown.
defaultConfigFile = default_server.conf

## Log all commands the daemon receives from the panel
## default: false
#logCommands = false

## The timeout for template setup operations in seconds
## default: 600
#templateSetupTimeout=600

## Disables the template functionality. Please use the setting in the panel to
## disable it there.
## default: false
#templatesDisabled=false

## Advanced: Use TCP keepalive for daemon connections
#default: true
#tcpKeepAlive = true
## Advanced: Use TCP keepalive for FTP connections
#default: true
#ftpTcpKeepAlive = true
## TCP keepalive parameters, use 0 for system default
#default: 0
tcpKeepAliveIdle = 60
tcpKeepAliveInterval = 5
tcpKeepAliveCount = 6

[ftp]
## Set the level of detail for FTP server log messages in the multicraft.log.
## Errors will always be logged, regardless of this setting.
## Available levels:
## full  - Log all messages
## basic - Don't log client/server communication
## none  - No FTP logging
## default: full
ftpLogLevel = full

[system]
## The command to pack a zip file. The following variables can be used:
## - {FILE} The name of the zip archive to create
## - {MULTICRAFT_DIR} The daemon base directory
packCmd = /usr/bin/unzip -quo "{FILE}"
## The same setting for Windows systems
packCmdWin = "{MULTICRAFT_DIR}\bin\unzip.exe" -quo "{FILE}"



Config File Changes in 1.8.0
New settings in 1.8.0
[multicraft]
## The maximum number of daemon connections to allow to this daemon.
## default: 500
#maxConnections = 500

## Allow symlinks where directories are expected. This check is done for
## security.
## default: false
#allowSymlinks = false

## Skip the integrity check for directories. This check is done for
## security, it verifies that a directory entry is consistent with its
## filesystem entry. You can disable this if this check causes issues
## on your particular filesystem.
#default: false
#skipIntegrityCheck = false


Config File Changes in 1.7.1
New settings in 1.7.1
[multicraft]
## Remote IP restrictions for daemon connections. This is a comma separated
## list of IPs that are allowed to connect to this daemon. Empty for all
## remote IPs allowed.
## default: empty
#allowedIps = 127.0.0.1

[useragent]
## The minimum allowed user and group IDs for server users
## default: 100
#userAgentMinUid = 100
#userAgentMinGid = 100

[system]
## Regular expression for filtering file names. Any match gets replaced by "_".
## Warning: Changing this is potentially dangerous
## default: [\\/<>:|*?"'&;$~%\0]
#fileFilter = [\\/<>:|*?"'&;$~%\0]


Config File Changes in 1.7.0
Changed default settings in 1.7.0
[minecraft]
## The path to the java executable
## default: /usr/bin/java
java = /usr/bin/java

[backup]
## The command to run a backup. The following variables can be used:
## - {WORLD} The name of the world being backed up
## - {SERVER_DIR} The directory of the server (working directory)
## - {MULTICRAFT_DIR} The Multicraft base directory ("baseDir" above)
## - {BASE_DIR} The directory containing all the servers ("serversDir above")
## Note that the resulting files is expected to be named "{WORLD}-tmp.zip"
command = /usr/bin/zip -qr "{WORLD}-tmp.zip" . -i "{WORLD}"*/*

[system]
## The commands to create and delete system users and groups
## The following variables can be used:
## - {USER} The full user/groupname
## - {USER} The full username
## - {GROUP} The full groupname
## - {ID} The server ID
## - {DIR} The server base directory, used as the users home
addUser = /usr/sbin/useradd -c "Multicraft Server {ID}" -d "{DIR}" -g "{GROUP}" -s /bin/false "{USER}"
addGroup = /usr/sbin/groupadd "{GROUP}"
delUser = /usr/sbin/userdel "{USER}"
delGroup = /usr/sbin/groupdel "{GROUP}"

## The command to unpack a zip file. The following variables can be used:
## - {FILE} The name of the zip archive to restore
unpackCmd = /usr/bin/unzip -quo "{FILE}"
New settings in 1.7.0
[multicraft]
## A list of section names in .conf files that can safely be defined
## or overridden by users. Note that this is just a default value that
## can itself be overridden in the .conf files in the daemon directory.
## Use * to allow all sections or a regular expression matching allowed
## sections only.
## default: ^(encoding|commands|parse_.+)$
#safeConfSections = ^(encoding|commands|parse_.+)$

[useragent]
## The path to the Multicraft useragent. This program is used in
## multiuser mode to access user files.
## default: bin (-> "baseDir"/bin, same as daemonDir)
#userAgentDir = bin
## The executable of the Multicraft useragent. Note that a config
## file with the same name as this setting (plus .conf) will be
## generated next to this file.
## default: launcher (-> "baseDir"/"userAgentDir"/useragent)
#userAgentFile = useragent
## The script to run when a server is being prepared. The path is
## relative to the userAgentDir.
## NOTE: This script will be run as the superuser.
## default: empty
#userAgentSuperuserPrepare =
## The script to run when a server is being prepared. The path is
## relative to the baseDir.
## default: empty
#userAgentPrepare =
## Various useragent configuration options
#userAgentCp = /bin/cp
#userAgentCpOpts = --preserve=mode,timestamps
#userAgentUnzip = /usr/bin/unzip
#userAgentUnzipOpts = -qql
#userAgentUnzipRe = ^(?:\s+[^\s]+){3}\s+(.*)$

[launcher]
## The path to the Multicraft launcher. This launcher program enables
## Multicraft to run servers that need a console to run correctly.
## default: launcher (-> "baseDir"/launcher)
#launcherDir = launcher
## The executable of the Multicraft launcher
## default: launcher (-> "baseDir"/"launcherDir"/launcher)
#launcherFile = launcher

[system]
## The name format for new groups, the following variables can be used:
## - {ID} The server ID
## - {USER} The full username
## default: same as userFormat
#groupFormat = {USER}


Config File Changes in 1.6.0
Changed default settings in 1.6.0
[backup]
command = zip -qr "{WORLD}-tmp.zip" "{WORLD}"*/
commandWin = "{MULTICRAFT_DIR}\bin\zip.exe" -qr "{WORLD}-tmp.zip" "{WORLD}"*/

[system]
unpackCmd = unzip -quo "{FILE}"
unpackCmdWin = "{MULTICRAFT_DIR}\bin\unzip.exe" -quo "{FILE}"
New settings in 1.6.0
[multicraft]
## Synchronize log writes. Disabling this will improve performance at the
## risk of having some log entries overlap.
## default: true
logSync = true

## Use thesyslog facility instead of logging to a file.
## default: false
logSyslog = false

## The syslog facility to log to. Possible values: auth, cron, daemon,
## kern, lpr, mail, news, security, syslog, user, uucp, local10-17
## default: daemon
logFacility = daemon

## Delay between server auto-starts in milliseconds.
## default: 750
autostartDelay = 750

[ftp]
## Masquerade IP address to use for passive FTP connections when
## Multicraft is running behind a router.
## default: empty
ftpNatIp =
## A port range to use for passive data transfers. If this is not
## specified the FTP server will use random ports.
## Format: 4000-8000
## default: empty
ftpPasvPorts =

[system]
## Display the output of this command in the panel under
## "Settings"->"Multicraft Status"
## default: empty
infoCmd = uptime
infoCmdWin =