Server Setup

From Boot's Crafting Wiki

Jump to: navigation, search

So, you are ready to begin setting up your Minecraft server? Here is the expanded step by step with explanations and everything.

Contents

Download the Base System

Everything here begins with the mod server and for my server, it has to be Bukkit. Create your folder for Minecraft wherever you want the files to be stored. I suggest something at the root level of your home directory (OS X) or within /etc (Linux):

OS X:

~/minecraft_server

Linux:

/etc/minecraft_server (use the mkdir command for this)

Place your Bukkit server jar in this minecraft_server directory. For the example, I use the current download Bukkit filename, craftbukkit-0.0.1-SNAPSHOT.jar, but change it to craftbukkit.jar on copy for ease.

OS X:

Rename craftbukkit-0.0.1-SNAPSHOT.jar to craftbukkit.jar and drag it to the ~/minecraft_server.

Linux:

Execute the command:

sudo cp craftbukkit-0.0.1-SNAPSHOT.jar /etc/minecraft_server/craftbukkit.jar

Setup your Server Start Commands

Now, I suggest creating a command or script to start your server with the nogui command.

A word on the syntax: The numeric values represent the min and max of RAM to be allocated and used by the Minecraft server. The default is 1GB of RAM minimum and maximum.

OS X:

Open TextEdit and paste the following in:

#!/bin/bash
cd "`dirname "$0"`"
java -Xmx1G -Xms1G -jar craftbukkit.jar

To change the maximum amount of RAM the server can use, simply change the second value to whatever you want. For example, if you want the server to be allowed 4GB of RAM, the command should read:

#!/bin/bash
cd "`dirname "$0"`"
java -Xmx1G -Xms4G -jar craftbukkit.jar

Save this file with the extension .command, for instance, I use startbukkit.command. Copy this command file to the minecraft_server directory and double click it to start the server. You will need to give yourself permission to execute this command via chmod, so open up Terminal, navigate to the minecraft_server directory where your command file is, and execute this command:

chmod a+x startbukkit.command

Now, you may simply run the command by double-clicking startbukkit.command in the OS X GUI, or, via Terminal using:

./startbukkit.command

""Linux:""

Simply execute the following from command line:

java -Xms1024M -Xmx1024M -jar craftbukkit.jar nogui

To change the maximum amount of RAM the server can use, simply change the second value to whatever you want. For example, if you want the server to be allowed 4GB of RAM, the command should read:

java -Xms1024M -Xmx4096M -jar craftbukkit.jar nogui

When the server runs, you will see text appearing alerting you to any problems and also see the world generation progress. Once this is complete, you will see something to the effect of "Done! For help, type "help" or "?"". This is your server console windows and you can pass commands to the server as the server admin. Type in 'stop' to stop your server from running.

Initial Configuration

When your server runs for the first time, you will see several files and folders get created in the minecraft_server folder. Three of these items are important for initial configuration:

  • op.txt
  • server.properties
  • plugins

op.txt

If the server is currently running, stop it by typing 'stop' in the server console. Once the server is stopped, lets begin with configuring yourself as OP (operator). Open the op.txt file in a text editor, type your Minecraft username on the first line, and save the file. The next time you start the server, your Minecraft username will be recognized as an OP allowing you to use server commands within the game client itself. Any subsequent users you wish to add as OP can be done in the same method by placing each user on its own separate line within the op.txt.

The op.txt file can be modified while the server is running as well, allowing for the game to recognize those promoted to OP without needing a server restart. This can be done from the server console or from within the game client if you are already defined as OP. The command for the server console is (where $USER = the Minecraft username of the person you are promoting to OP):

op $USER

To promote someone to OP within the Mionecraft game client, press 't' to bring up the chat window and use the following command:

/op $USER

To remove someone from OP status you can remove them from the op.txt manually and restart the server. You may also use the deop command from either the server console or from within the Minecraft game client with yourself as OP. The syntax is the same as the above, simply use replace 'op' with 'deop'.

server.properties

There are several configurable options for your server within the server.properties file. A typical default server.properties file has the following content:

level-name=world
hellworld=false
spawn-monsters=true
online-mode=true
spawn-animals=true
max-players=20
server-ip=
pvp=true
server-port=25565
plugins=

Most of these are self explanatory. Two deserve special attention, max-players and plugins. First up, max-players; This is generally fluid and depends on your needs and RAM of course. I generally keep mine at 8-12 players for 2GB of RAM maximum allocated to the server. Simply changing the value set for max-players changes how many players are allowed on the server at a time. For example:

max-players=10

This allowed for a maximum of 10 players logged in to the server at a time.

Next, the plugins field. This is where you will list the plugins the server will load. Since there are no items in the plugins folder yet, this should be left blank. As soon as you have installed plugins, this is where you will list them for the server to recognize and load the plugins. As an example, if you installed 2 plugins WorldGuard and WorldEdit, the plugins field should look like this:

plugins=WorldGuard,WorldEdit

The next time the server is started, the settings here will be implemented.

Plugins

Installing plugins is a relatively simply process. Basically, plugins are packaged as .jar files, just like the server. To install a plugin, simply place the jar file of that plugin within the /minecraft_server/plugins/ directory. Once the jar file for the plugin is in the proper folder, add the name of the plugin to the plugins field of server.properties as outlined above. What you place in the plugins field is based on the filename of the plugin jar. For instance, if you want to install the plugin Essentials, you copy Essentials.jar to the /minecraft_server/plugins/ folder, then add Essentials to the plugins field of server properties. The rule is, the entry in the server.properties plugins field is the filename of the plugin's jar file without the .jar extension.

To put this into a real world example, I have the following plugins:

  • Essentials
  • Permissions
  • WorldGuard
  • WorldEdit

This means I have copied the following jar files to the /minecraft_server/ directory:

  • Essentials.jar
  • Permissions.jar
  • WorldGuard.jar
  • WorldEdit.jar

My server.properties plugins field should look like this:

plugins=Essentials,Permissions,WorldGuard,WorldEdit

After a plugin is installed, the typical behavior when starting the server is that a folder for each plugin is created within the /minecraft_server/plugins/ directory. This folder will hold the configuration files for each plugin, depending on what files the plugin needs to run. Start your server after installing the plugins in order to generate these folders. Then, stop the server to configure these plugin files.

Troubleshooting

Whenever troubleshooting problems with starting your server and/or plugins, the best initial place to look is the text within the server console when starting the server. You will typically see errors relating to the server or a plugin here with a description of what is having issues. If this text reports an error with the WorldGuard plugin, then likely the WorldGuard features will not be available within the game. Check to be sure your plugin is verified to work with the current version of your mod server and also that the plugin is set correctly within the server.properties file. Also be mindful of overlapping plugin functionality, which plugin will supersede the other, etc.

And example of overriding plugins is, WorldGuard and WorldEdit both have the ability to apply permissions to users. The Permissions plugin will override whatever permissions are set within the specific WorldGuard and WorldEdit plugins.

Keep in mind that plugin authors are not Minecraft server authors. These are third party wrappers that are coded to work with the game, but there can always be issues.

Personal tools