How to setup a custom CraftBukkit server (1.2.5-R1.0)

Discussion in 'Bukkit Help' started by LHammonds, Apr 9, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    LHammonds

    NOTE: My initial attempt at creating this thread said it was too large. I will re-submit and break it up into multiple posts.

    This document will describe how to setup a tricked-out CraftBukkit server.

    Goals:
    • Done - Install and configure a local CraftBukkit server on Windows
    • Done - Install, configure and test plugins
    • Done - Setup a production CraftBukkit server on Ubuntu Linux
    • Done - Setup server maintenance scripts
    Donations

    If you have the means and will to donate, please support Mojang 1st by buying a copy of Minecraft if you have not done so already, then to the authors of your favorite plugins. If by then you still want to send some my way, I would be grateful. Here is my link: PayPal for LHammonds

    Prerequisites

    • Minecraft ($30 USD)
    • Ubuntu Server
    • Java version 1.6 or 1.7 (free)
      • Java 6 for Linux x64 = jre-6u31-linux-x64.bin
      • Java 6 for Windows x86 = jre-6u31-windows-i586-s.exe
      • Java 6 for Windows x64 = jre-6u31-windows-x64.exe
      • Java 7 for Windows x86 = jre-7u3-windows-i586.exe
      • Java 7 for Windows x64 = jre-7u3-windows-x64.exe
    • CraftBukkit (free)
    • CraftBukkit plugins (free)

    For CraftBukkit servers, I like to select plugins that do not have any client-side requirements. Simply install on the server and everyone immediately enjoys the new content added to the server.

    I will describe how to 1st setup the server on Windows and then transfer it to Ubuntu, however, all of this can be done starting with Ubuntu but I find it easier starting off with a pre-built installation (since I'm a Windows guy and somewhat lazy)

    Install a local CraftBukkit server on Windows

    These steps were documented on a Windows 7, 64-bit PC with Java 7 Update 3 (both 64-bit and 32-bit versions)

    1. Download the latest recommended build (version) of CraftBukkit (1.2.5-R1.0 at the time of this writing)
    2. Make a folder on your computer. Example: D:\CraftBukkit
    3. Copy the CraftBukkit jar file into this folder. Example: D:\CraftBukkit\craftbukkit-1.2.5-R1.0.jar
    4. Rename the jar file to "craftbukkit.jar" to keep things simple.
    5. Create a text file called D:\CraftBukkit\startcb.txt and copy the following text into it:

    Show Code for startcb.bat (open)

    Code:
    @ECHO OFF
    SET RAM2USE=2048
    CD /D D:\CraftBukkit
     
    REM ** Look for a version of Java 7 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre7\bin\java.exe" GOTO JAVA7DEFAULT
     
    REM ** Look for 32-bit version of Java 7 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" GOTO JAVA732BIT
     
    REM ** Look for a version of Java 6 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre6\bin\java.exe" GOTO JAVA6DEFAULT
     
    REM ** Look for 32-bit version of Java 6 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" GOTO JAVA632BIT
     
    :JAVA7DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 7 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 7 **
    "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :JAVA732BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 7 **
    "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :JAVA6DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 6 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 6 **
    "%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :JAVA632BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 6 **
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :DONE
    REM ** This will pause the screen so you can see any error messages after stopping the CraftBukkit server. **
    PAUSE

    NOTE #1: You might need to adjust the amount of memory used on the 2nd line (1024 = 1 GB RAM (minimum).
    NOTE #2: You might need to adjust the server folder on the 3rd line to reflect your system.
    NOTE #3: This batch script will choose the newer Java installed as well as picking the 64-bit version if present.

    6. Save and close the text file. Rename the file to "startcb.bat" (you might need to disable hidden filename extensions to make this work)
    7. Double-click "startcb.bat" and if things go well, CraftBukkit will start in black DOS window and go through the initial startup and generate the initial files and sub-folders.
    8. Once the server has finished loading, type "stop" at the server console to gracefully stop CraftBukkit. Get used to what it normally says when shutting down properly...it can be handy to know. Then press any key to close the window (this is that "pause" command at the end of the script)

    Configure the CraftBukkit Server

    At this point, we now have a default CraftBukkit server. Let's configure some of the basic settings. (Make sure the server is not running)

    Use a text editor to edit Server.Properties

    Notice the following line:

    Code:
    server-port=25565
    This is the default port the server will use to communicate to Minecraft clients. Make sure your firewall will allow traffic on this port.

    If you change this port to anything else, your Minecraft clients will need to add the port as part of the server IP when defining your server. Example: If you change it to 25500 and your IP is 192.168.1.100, your other PCs will need to add 192.168.1.100:25500 as the server address.

    If you plan to host this server on a private network which does not have or want Internet access, you need to change the following line from true to false:

    Code:
    online-mode=true
    The above is great for LAN parties and homes where young kids can play on local servers without being exposed to the big bad Internet...however, if you plan to run a public Internet server, it is a bad idea to by-pass the login authentication for many reasons.

    If you know how many people will be connecting to the server, be sure to set that amount on the following line (typically, it is a good idea to set it one higher than your expected maximum)

    Code:
    max-players=20
    It is also a good idea to set a good description for your server by using the following line:

    Code:
    motd=A Minecraft Server
    I have mine set to the following:

    Code:
    motd=CraftBukkit 1.2.5 R1.0 Build 2149
    Save and close Server.Properties

    Double-Click startcb.bat to start the CraftBukkit server with your new settings.

    Once it loads up, give yourself admin rights on the server by typing op YourMinecraftName at the server console. This adds your name to the following file: D:\CraftBukkit\ops.txt

    Start your Minecraft client and click Multiplayer from the main screen. Click the "Add server" button. Give the server a name and type in the IP address of the server (if on your PC, simply use "localhost" or something like "localhost:25500" if using a custom port number and then click Done.

    If the client sees the server, you should see your server with your custom description (e.g. CraftBukkit 1.2.5 R1.0 Build 2149) as well as the amount of currently logged in players and maximum amount of players (e.g. 0/20).

    If you get connected, see if you can survive the 1st night. :D Disconnect when you are satisfied that it works good enough.
     
  2. Offline

    LHammonds

    Updated CraftBukkit 1.2.4 to 1.2.5 and updated several other plugins to current versions.
     
  3. Offline

    corne22

    tnx this helped me alot with permisions but can you also explain how to give someone a permision wich other ones in the same group don't have like giving someone permision for world edit just that person and nobody else in his group
     
  4. Offline

    LHammonds

    The same permission lines that you would use in groups.yml would be copied to users.yml for the specific user you want to modify.

    The example I have show are all controlled at the group level...which is why most of the work is in the groups file.
     
  5. Offline

    corne22

    :D it worked tnx
     
  6. Offline

    zachhowell

    I am having some trouble. I did everything as specified. but when I went to run the .bat file it says
    "The system cannot find the path specified.
    Error: Unable to access jarfile craftbukkit.jar
    Press any key to continue . . ."
     
  7. Offline

    LHammonds

    You probably already figured out that you have to have a "craftbukkit.jar" file in the folder. You probably did not rename whatever version you downloaded to the generic "craftbukkit.jar" filename.

    I've been away for a while but now that CraftBukkit 1.3.1 R1.0 has been released and many mods are already updated to work with that version, I will likely be revisiting these instructions and make a similar thread for 1.3.1.

    LHammonds
     
  8. Offline

    jacklin213

    remember that some times computer hide extentions and you end up geting craftbukkit.jar.jar
     
Thread Status:
Not open for further replies.

Share This Page