Setting Up a Spigot Server for Minecraft on Ubuntu 14.04

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

This guide shows you how to setup your own Minecraft server on a Linode running Ubuntu 14.04/14.10. You can play online with your friends or host a public server.

We’ll compile the Spigot Minecraft server (1.8.3 at the time of publication) so you can use the whole expanse of Bukkit plugins available.

Preparation

  1. Make sure your system is up to date:

    sudo apt update && sudo apt upgrade
    
  2. Install git and openJDK:

    sudo apt install git openjdk-7-jre-headless
    
    Note
    If your Linode is running Ubuntu 14.10 or higher, you can choose to install openjdk-8-jre-headless instead.
  3. Run java -version to confirm. You should see something like this:

    java version "1.7.0_75"
    OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~trusty1)
    OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
    
  4. If you’re running an IP tables firewall (as shown in the Setting Up and Securing a Compute Instance guide), add an exception to your iptables rules:

    sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT
    

    If you’re running a different firewall, an exception will also need to be added.

Create a Minecraft user

  1. Create a Minecraft user:

    sudo adduser minecraft
    
  2. Login to the Minecraft user:

    sudo su - minecraft
    

Install SpigotMC

  1. Download and build SpigotMC:

    mkdir build
    cd build
    wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
    java -jar BuildTools.jar
    
    Note
    This may take approximately 10 minutes, depending in the size of the Linode you are building on.
  2. When the build has finished, move the resulting .jar file to a server folder:

    mkdir ../server
    cd ../server
    mv ../build/spigot-1.*.jar spigot.jar
    
  3. We’ll make a few scripts to make sure that your server’s always up. Open a file called wrapper.sh in your preferred text editor. In the text editor, insert the following:

    File: /home/minecraft/server/wrapper.sh
    1
    2
    3
    4
    
    #!/bin/bash
    cd /home/minecraft/server;
    
    java -XX:MaxPermSize=1024M -Xms512M -Xmx1536M -jar spigot.jar

    The values in this file are suggested for a Linode 2GB. You may want to change the RAM allocation depending on your Linode size.

  4. Make the file executable:

    chmod +x /home/minecraft/server/wrapper.sh
    
  5. Start SpigotMC for the first time:

    java -Xms512M -Xmx900M -jar spigot.jar
    

    It will terminate with the message:

    INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
    
  6. Open eula.txt and set the value to true:

    File: /home/minecraft/server/eula.txt
    1
    2
    3
    
    By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
    #Fri Apr 17 17:02:15 UTC 2015
    eula=true

Configure SpigotMC to start on boot

  1. Exit out of the minecraft user:

    exit
    
  2. As the root user or with sudo, open /etc/rc.local and add the following before the exit 0 line:

    File: /etc/local.rc
    1
    
    su -l minecraft -c "screen -dmS minecraft /home/minecraft/server/wrapper.sh"

    This line will, at reboot, create a new Screen session as the Minecraft user, and launch SpigotMC in it.

  3. Manually start Spigot:

    sudo su -l minecraft -c "screen -dmS minecraft /home/minecraft/server/wrapper.sh"
    

    To access the console, type screen -r as your minecraft user (note if you su to the user, you will need to run script /dev/null before you can attach to the Screen session).

    You can now follow the Connecting to your Minecraft Server steps from our vanilla Minecraft guide to log in to your new SpigotMC server.

    To run admin commands during the game, first run op username from the console, replacing username with your in-game username. Have fun playing on your new Minecraft server!

Customization

Server Properties

Customize the server by editing values in /home/minecraft/server/server.properties.

  • Enable command blocks: Values available are true and false.

    enable-command-block=false
    
  • Gamemode: Values available are 0 through 3; 0 is survival, 1 is creative, 2 is adventure and 3 is spectator.

    gamemode=0
    
  • Difficulty: Values available are 0 through 3; 0 is peaceful, 1 is easy, 2 is normal, and 3 is hard.

    difficulty=1
    
  • MOTD: Stands for Message Of The Day. Accepts a string value.

    motd=A Minecraft Server
    
  • PVP: Values available are true and false.

    pvp=true
    
  • Other: See the Minecraft wiki for more details.

Plugins

Plugins can be found from the Spigot Resources or Bukkit Plugins pages.

  1. To add plugins, download the .jar file to the /home/minecraft/server/plugins directory:

    wget -P /home/minecraft/server/plugins/ --content-disposition <plugin url>
    
    Note
    When downloading plugins from Spigot, the wget flag --content-disposition will help ensure the plugin is downloaded with the correct filename.
  2. From within your screen session, enter stop to stop the server and exit the screen session. Your plugin will be loaded when you next start the SpigotMC server:

    su -l minecraft -c "screen -dmS minecraft /home/minecraft/server/wrapper.sh"
    

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.