Skip to content
Daniel Hodgson edited this page Jan 7, 2012 · 1 revision

Setup:

This script is designed to be as easy to use, and as useful as possible. However, there is a bit of setup required.

Step 1: Directory Setup

This script expects certain folders to be placed in certain directories. We'll be telling the script the name of these folders in Step 2, but we need to create them first. Any variable ending in PATH should contain a full directory path (i.e. anything that starts with "/", for example: /mnt/codecraft).

  • The exception to this is the ROOT_BUPATH variable which can also begin with the ROOT_PATH variable instead of a "/"

Any variable ending in DIR should contain the name of the folder only.

  1. Make the root directory for your server. This will be used by the $ROOT_PATH variable.
  • Example: /mnt/codecraft
  1. Make a folder for your server versions/configuraitons inside of the root directory. This will be used by the SERVER_DIR variable.
  • Example: servers located at /mnt/codecraft/servers
  1. Make a folder for your server's core files inside of the SERVER_DIR directory. This should be given the same name as the build or version number of the server software you're using. This will be used by the BUILD variable.
  • Example: We use bukkit build 1597 so for us, BUILD="b1597 and we have a folder named "b1597" located at /mnt/codecraft/servers/b1597
  1. Make a folder for your worlds. This will be used by the WORLD_DIR variable.
  • Example: worlds located at /mnt/codecraft/worlds
  1. Make a folder for the ramdisk. This will be used by the RD_DIR variable.
  • Example: ramdisk located at /mnt/codecraft/ramdisk
  1. Make a folder for your backups. This will be used by the ROOT_BUPATH variable.
  • You can make this folder anywhere you want, just remember that you need to put the full path location into the ROOT_BUPATH variable.
  • The script will make folders inside of this one later to keep your backups organized.

### Step 2: *Installation and Configuration*

First things first. If you haven't already, go grab the latest version of the script from the Github repo. You can find it in the downloads section.

  1. Download either the vanilla minecraft server software or bukkit and place it in $ROOT_PATH/$SERVER_DIR/$BUILD

  2. Place your worlds into the $WORLD_DIR directory and place symbolic links in $ROOT_PATH/$SERVER_DIR/$BUILD which point to the worlds in $ROOT_PATH/$WORLD_DIR

  • To do this, open up a terminal and type the following (replacing the variables with your chosen directory paths):

  • cd $ROOT_PATH/$SERVER_DIR/$BUILD

  • ln -s $ROOT_PATH/$WORLD_DIR/[world_name_here] [world_name_here]

  • Repeat the last command for every world on your server.

  • Note: If you don't currently have any worlds, you'll need to run the service first (bukkit/minecraft will automatically create them), and then move the worlds into the $WORLD_DIR directory and issue the afformentioned commands.

  1. Extract the script from the tarball and change the settings and file paths/directory names as you see fit.
  • More information on configuraiton can be found in the Notes section.
  1. Place the script in your /etc/init.d folder.
  • Make sure the script has permission to execute (just chmod +x minecraft and that should do it).
  1. Configure the script to start Minecraft/Bukkit on startup and stop it on shutdown.
  • RHEL / CentOS: Run in terminal chkconfig --add minecraft
  • Debian / Ubuntu: Run in terminal update-rc.d -n minecraft defaults

### Step 3: *Start the Service*

As root, run service minecraft start


###Congratulations, you now have Minecraft/Bukkit running as a service on your server!

As always, make sure your firewall, plugins, and bukkit/vanilla minecraft are configured properly. Though this script may still be in development, if your server fails to start properly or it starts and you can't connect to it (especially the latter), it's likely due to an issue with your configuration, so check that first before reporting bugs.

Clone this wiki locally