This tutorial assumes that you are a normal user (not-root) and have sufficient rights to sudo. This is because using the AUR to build packages should not be done as root, but as a normal user.
Using the AUR package “spigot” is a great way to install Spigot as it builds a package that is tracked by pacman. This allows you to remove it quickly and upgrade it quickly. Plus, the package uses systemd and tmux to manage the server, and it has all of the scripts ready for you to use.
Before we begin building the package, we need to install some dependencies first.
sudo pacman -Sy base-devel jdk8-openjdk jre8-openjdk fontconfig tmux git
Now with those installed, we can begin to build the spigot package. Using curl, download the tarball for the package.
curl -O https://aur.archlinux.org/packages/sp/spigot/spigot.tar.gz
After the download finishes, extract it and change into the spigot folder.
tar -xvzf spigot.tar.gz
cd spigot
Now, using makepkg, build the package. This can take a few minutes.
makepkg -ci
If you didn’t pass the -i
flag to the makepkg command, you use pacman to install it.
sudo pacman -U *.pkg.tar.xz
Start your server for the first time to gain access to the eula.txt
file. Then, immediately stop it.
sudo systemctl start spigot
sudo systemctl stop spigot
After that’s done, open the file /srv/craftbukkit/eula.txt
and change the line eula=false
to eula=true
. This provides you with a working server, but you may still want to modify the /srv/craftbukkit/server.properties
file. Information about this file can be found on the Minecraft Wiki.
Once you are happy with your settings, fire up the server!
sudo systemctl start spigot
To start it on boot:
sudo systemctl enable spigot
You now have a working Spigot server!
The contents of the server are located in /srv/craftbukkit/
and are owned by the user craftbukkit and group craftbukkit. You must make sure when installing plugins or other files that they are owned by craftbukkit:craftbukkit.
If you want to access the server console, run the following command (assuming that you have the correct sudo permissions).
sudo -u craftbukkit tmux attach
To close out of the server console, press Ctrl + B, then D.
Another thing to consider is if you want to allocate more RAM to the server. If so, run the following command. The $newram
placeholder is where you specify the new value. This will also create a backup file in case you need to revert to it.
sudo -u craftbukkit sed -i.bak 's/1024M/$newram/g' /srv/craftbukkit/spigot.sh
If you put in a bad value for the new amount of ram, you can revert by running this command.
sudo -u craftbukkit mv /srv/craftbukkit/spigot.sh.bak /srv/craftbukkit/spigot.sh
]]>It is recommended to run all commands as a user with sudo privileges that is not root.
Start by ensuring that your server is up to date.
sudo apt-get update && sudo apt-get upgrade -y
Install the needed packages.
sudo apt-get install git openjdk-7-jre tar -y
Allocate the desired amount of memory. Replace 1G accordingly.
sudo fallocate -l 1G /swapfile
Secure the permissions of your new swap file.
sudo chmod 600 /swapfile
Allocate the swap space.
sudo mkswap /swapfile
Turn on swap.
sudo swapon /swapfile
Make your swap file permanent. Add the line below to the bottom of the fstab
file.
sudo nano /etc/fstab
/swapfile none swap sw 0 0
Ensure you are in the home directory of the user used for installing Spigot.
cd ~
Create a folder for BuildTools.
mkdir build
cd build
Download BuildTools.jar Look for updates on their Jenkins page.
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
Configure git.
git config --global --unset core.autocrlf
Run BuildTools.jar.
java -jar BuildTools.jar
Make note of the name of your spigot.jar
file. For example, spigot-1.8.3.jar
.
ls
Make a directory for your server.
cd ~
mkdir server
cd server
Move your spigot.jar
into your server directory. Replace spigotname.jar
with the name of your file.
mv ~/build/spigotname.jar ~/server/spigot.jar
Create a start up script for your server.
nano start.sh
Make start.sh
match the following, replacing -Xmx1024M
with the amount of RAM installed on your server.
#!/bin/sh
java -Xms512M -Xmx1024M -XX:MaxPermSize=128M -jar spigot.jar
Make start.sh
executable.
chmod +x start.sh
Start your server.
./start.sh
Install screen.
sudo apt-get install screen -y
Open an instance of screen.
screen -S "Spigot Server"
Start your server script.
~/server/start.sh
Accept EULA.
If you are asked to confirm eula.txt
, change eula
to true
.
nano eula.txt
BuildTools.jar wont run?
You need more RAM on your server or a larger swap file.
start.sh can’t run the file
command on your jar file?
Check to ensure everything is typed exactly the same, Linux IS case sensitive.
Want to download a specific Minecraft version?
java -jar BuildTools.jar --rev 1.8.4
Replace 1.8.4 with the version of your choice.
]]>First, install the required libraries.
yum -y install m4 automake autoconf make gcc libtool
Once these libraries have finished installing, you must install the server script. We will be using PocketMine.
wget http://downloads.sourceforge.net/project/pocketmine/linux/installer.sh
Chmod the server script to make it executable.
chmod +x ./installer.sh
Begin the install process. This may take up to 5 minutes to install.
./installer.sh
Next, start the server.
./start.sh
Voila. We just need to make sure that port 19132 is open so that people can join. To open it in CentOS 6, run the following commands.
iptables -A INPUT -p tcp -m tcp --dport 19132 -j ACCEPT
service iptables save
service iptables restart
If you are running CentOS 7, then you must use firewalld to open it. To do so, perform the following commands:
firewall-cmd --zone=dmz --add-port=19132/tcp --permanent
firewall-cmd --reload
Your server is ready to go! Happy building!
]]>It is recommended to run all commands as a user with sudo
privileges that is not root.
Start by ensuring that your server is up to date.
sudo apt-get update && sudo apt-get upgrade -y
Install the needed packages.
sudo apt-get install openjdk-8-jre -y
Allocate the desired amount of memory. Replace 1G
accordingly.
sudo fallocate -l 1G /swapfile
Secure the permissions of your new swap file.
sudo chmod 600 /swapfile
Allocate the swap space.
sudo mkswap /swapfile
Turn on swap.
sudo swapon /swapfile
Make your swap file permanent by modifying the fstab
file.
sudo vim /etc/fstab
Add this line to the bottom of the file.
/swapfile none swap sw 0 0
Ensure you are in the home
directory of the user you are planning to use to install PaperSpigot.
cd ~
Create a folder for PaperSpigot.
mkdir paper
cd paper
wget -O paperclip.jar https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/artifact/paperclip.jar
This will download the latest build of PaperSpigot. If you would like to use a different Minecraft version, replace lastSuccessfulBuild
with a corresponding build number which you can find here.
Create a start up script for your server.
vim start.sh
Make start.sh
match the following, replacing 1024M with the amount of RAM installed on your server.
#!/bin/sh
java -Xms512M -Xmx1024M -XX:MaxPermSize=128M -jar paperclip.jar
Make start.sh
executable.
chmod +x start.sh
Start your server.
./start.sh
The first time you start your server, it will download files necessary to setup PaperSpigot. After the first run, your server will launch faster.
Install screen.
sudo apt-get install screen -y
Open an instance of screen.
screen -S "paper"
Start your server script.
cd ~/paper
./start.sh
You can now configure your server’s settings and install plugins.
If you are asked to confirm eula.txt
, change eula to true.
vim eula.txt
You need more RAM on your server or a larger swap file.
Check to ensure everything is typed exactly the same, Linux IS case sensitive.
]]>Your server needs a minimum of 1GB of RAM for 8 players. More players means more memory. Before you begin, you need a non-root user account set up on your server. We will be using the demo
user here.
Install GCC and other build tools. If you are using a 32-bit version Debian, you will not need to install gcc-multilib.
sudo apt-get update
sudo apt-get install perl gcc g++ make automake libtool autoconf m4 gcc-multilib
Download and compile PocketMine-MP and PHP. This process may take up to 20 minutes.
wget -q -O - http://get.pocketmine.net/ | bash
Upon success, you will see the following output.
...
[INFO] Cleaning up... done!
[PocketMine] You should start the server now using "./start.sh."
[PocketMine] If it doesn't work, please send the "install.log" file to the Bug Tracker.
Start your server in screen.
screen
./start.sh
On the first run, you will be prompted for settings, such as language, server name, and RAM. Upon success, you will see the following output.
18:05:05 [INFO] Starting Minecraft: PE server version v0.10.5 alpha
18:05:05 [INFO] Loading pocketmine.yml...
18:05:05 [INFO] Loading server properties...
18:05:05 [INFO] Starting Minecraft PE server on 0.0.0.0:19132
18:05:05 [INFO] This server is running PocketMine-MP version 1.4.1-980 "絶好(Zekkou)ケーキ(Cake)" (API 1.11.0)
18:05:05 [INFO] PocketMine-MP is distributed under the LGPL License
18:05:06 [INFO] Preparing level "world"
18:05:06 [INFO] Starting GS4 status listener
18:05:06 [INFO] Setting query port to 19132
18:05:06 [INFO] Query running on 0.0.0.0:19132
18:05:06 [INFO] Default game type: CREATIVE
18:05:06 [INFO] Done (0.611s)! For help, type "help" or "?"
The settings can be changed again at any point by editing the server.properties
file and restarting the server.
Congratulations, you now have Minecraft PE running on Debian.
]]>You may want to install wget
, nano
, and screen
by running the following command:
pkg install screen nano wget
Install OpenJDK 7 by running the following command:
pkg install java/openjdk7
Once it is done, run the following command to verify the installation of OpenJDK 7:
java -version
If you see the following, then you can proceed to the next step:
openjdk version "1.7.0_71"
OpenJDK Runtime Environment (build 1.7.0_71-b14)
OpenJDK 64-Bit Server VM (build 24.71-b01, mixed mode)
Run the following commands to download Minecraft:
cd ~
mkdir mcserver
cd mcserver
wget https://s3.amazonaws.com/Minecraft.Download/versions/1.8/minecraft_server.1.8.jar –no-check-certificate
Once it is downloaded, you will want to create a file called eula.txt
and populate it with eula=true
. This is applicable to any server after version 1.7.9. By creating this file, you agree with the Mojang EULA which can be found here.
Next, create a file called startup.sh
and populate it with the following:
java -Xmx1500M -Xms750M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=4 -XX:+AggressiveOpts -jar minecraft_server.1.8.jar nogui
Save the file and run the following command to start the server:
screen sh startup.sh
If all is successful, you will be able to connect to the IP address of your VPS with the Minecraft game client. You have just setup Minecraft on FreeBSD 10.
It is recommended to create a new user specifically for your server to make sure that the Minecraft server does not have root access. Giving a server or application root access poses a security risk. To create a new user, run adduser
and follow everything being prompted, but make sure that when it asks about the shell, to choose nologin
as a security measure for this user. Once completed, enter into your server directory and run the following command (Change “minecraft” with the username and group you have created):
chown -R minecraft:minecraft .
This will change the owner of the content of that directory to minecraft
. Next, run the following command to start the server:
screen su -m minecraft -c "sh startup.sh"
This will start your server as the user minecraft
. If everything is successful, the server will be running.
This article assumes that you have logged into your server with RDP, and that you have Java installed.
You will need a folder to store the Minecraft server files. I recommend using a sub-folder of your Desktop (such as C:\Users\Administrator\Desktop\Minecraft
).
Download the Minecraft files to your server. We’re going to use the default Minecraft server, which can be downloaded from the Minecraft website. You will find the latest server version at the bottom of the page.
If you have connected to your Windows Server from a Windows client with the default RDP program, you will be able to simply copy + paste files. If you are on a Mac and are using the official Microsoft Remote Desktop application, you will need to enable folder redirection which will create a share, allowing you to share files between the client and the server.
Put the .jar
file you have just downloaded for your server in the folder.
start.bat
fileI recommend setting up your server by using a .bat
file. Windows will execute a command every time the .bat
file is opened which will properly initialize the Minecraft server. A sample .bat
file for launching Minecraft looks like this:
java -Xms1024M -Xmx1024M -jar name.jar -o true
PAUSE
There are a number of things you will have to change here.
-Xms1024M
– this is the minimum amount of RAM your server will use. If you want this to be a certain amount of MB’s you can use 1M
if you’d like to allocate 1 MB of RAM, for example. If you’d like to allocate an amount of GB, use 1G
given that 1 is the amount of GB’s you’ll allocate.-Xmx1024M
– this is the maximum amount of RAM your server will use. This is the same with Xms
in terms of MB’s and GB’s to allocate.name.jar
– this is the name of the .jar
file you have downloaded.Put your .jar
file and .bat
file in the same folder (C:\Users\Administrator\Desktop\Minecraft
) and double-click your .bat
file. Its name can be anything (you could call it start.bat
, for example).
You will need to accept the EULA by opening the eula.txt
file and changing eula=false
to eula=true
. This indicates that you agree with the EULA.
After accepting the EULA by editing the eula.txt
, start your server again with the .bat
file. This will create a number of files and folders that are required to use your server, among others the server.properties
file. Find the following line:
server-port=25565
This is the server-port
value. If you change this to something different, you will have to type the port after your IP when you join the server in the Minecraft client. For example, you’d have to type [YourServerIP]:25569
if you changed the port to 25569. If you leave it the default value of 25565, Minecraft will recognize that automatically. Another option would be to use a DNS SRV record and have a registered domain name.
If there’s no obvious reason to change the port, I recommend leaving it on 25565. The most common reason for changing the server port is to run multiple Minecraft servers on one VPS.
You will now need to open the port you have chosen for your Minecraft server in the firewall. If you would like to learn how to open a port in the firewall on Windows Server 2012, read the article Open a Port in Windows Firewall on Server 2012 and open the port you have chosen to use for your Minecraft server.
Your Minecraft server is ready for use. You can now login with the Minecraft game client.
]]>Bukkit is a extension of Minecraft which offers some exclusive features as well as plugins which can greatly improve your gaming experience.
Bukkit is a community-driven project that allows every Java developer to write their own plugins and create additional features.
Installing Java on Debian Wheezy can be done using the apt-get
command as follows:
apt-get install openjdk-7-jre
You can verify whether or not the Java installations as successful by funning the below command:
java -v
The first step is to create the directory in which Bukkit will be installed:
mkdir /root/mc/
Next, we download Bukkit:
cd /root/mc/ && wget http://tcpr.ca/files/craftbukkit/craftbukkit-latest.jar
The the command below to initialize and run Bukkit:
java -jar craftbukkit-latest.jar
Once all the libraries has been initialized, you will receive a message advising that you need to accept the Bukkit EULA
. In order to do so, you need to open the file name eula.txt
and change the variable to True
.
Once completed, you will need to re-run the same Java command referenced above.
Bukkit does not run in the background by default. As such, it is recommended that you run it in a screen session to ensure that it remains active even after you log out of your server.
You can use the command below to run Bukkit in a screen session:
screen java -jar craftbukkit-latest.jar
This concludes our tutorial. For more information how to use and customize Bukkit, please refer to the official Bukkit documentation.
]]>Java
wget
screen
unzip
nano
Step one – updating our packages:
yum update -y
Step two – installing java
, screen
, and unzip
:
yum install java screen unzip -y
Step one – create a new directory:
cd ~
mkdir server
cd server
Step two – download Forge:
wget http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.12-14.21.1.2443/forge-1.12-14.21.1.2443-installer.jar
Step three – run the installer:
java -jar forge-1.12-14.21.1.2443-installer.jar --installServer
Now that we have Forge ready, we need to download the Age of Engineering modpack:
wget https://addons-origin.cursecdn.com/files/2419/378/Age%20of%20Engineering-1.0.0.zip
Once this is complete, extract the archive:
unzip "Age of Engineering-1.0.0.zip"
Step four – creating the start file:
nano start.sh
Once in, paste the following:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar
Save and exit (CTRL
+ O
, followed by the Enter
or Return
key).
Step five – setting the appropriate permissions:
chmod 755 start.sh
An important thing to note is that Minecraft servers will not continue to run in the background. automatically As such, we need to use a utility called screen
.
Step one – paste the following to open a screen
:
screen -S server
Step two – start the server:
./start.sh
Step three – exit the screen. You can do this by pressing the following on your keyboard: CTRL
+ A
+ D
.
Congratulations! You’ve successfully installed an Age of Engineering server.
You can connect to it by finding the IP address of your server in the Aklweb host control panel. Paste the IP address into your Minecraft client, and you will be good to go. Enjoy!
]]>Sponge is an open-source project that expands the capabilities of Minecraft servers through plugins. Combined with the modding API Forge, server hosts can create a highly unique experience for their players. In this tutorial, you will learn to setup a Minecraft server with both Forge and Sponge on a Aklweb host instance.
Note: While Sponge plugins only need to be installed on the server, Forge mods will often require any players on your server to also have the mod installed. If you choose to install any mods like that, be sure to give your players a heads-up.
In order for the Minecraft server to run, we’re going to need Java. We also need a tool called screen
that we’ll be using later. To install both of these at once, we’ll use Debian’s apt
command. While we’re at it, we’ll also update the whole system.
Note: The #
and $
symbols at the beginning of these lines are not meant to be typed, they are visual indicators of the command prompt.
# apt update && apt upgrade && apt install default-jre screen
When asked if you want to continue, type “y
” and press “Enter
“.
It’s generally a good idea to create a non-privileged user when running servers. While this isn’t required, it’s recommended to mitigate damage in the event of a security exploit.
First, we will create our new user named minecraft
.
# adduser minecraft
Create a password and work your way through the prompts.
After that’s been done, logout of the SSH client and reconnect using your new username and password. Your prompt will now look something like this.
minecraft@my-server:~$
Create a new folder for the server files with the mkdir
command and cd
into it.
$ mkdir minecraft && cd minecraft
Create another folder called mods
and cd
into that.
$ mkdir mods && cd mods
Visit the SpongeForge download page and find a build that matches the version of Minecraft you’ll be using for your server. For this tutorial, we’ll be using version 1.10.2
.
Instead of downloading the file, right click on the download link and click “Copy Link Location
“. Go back to your SSH session and paste the URL in a wget
command.
$ wget https://repo.spongepowered.org/maven/org/spongepowered/spongeforge/1.10.2-2477-5.2.0-BETA-2731/spongeforge-1.10.2-2477-5.2.0-BETA-2731.jar
Take note of the number after the Minecraft version in the URL. This is the Forge build number. In this case, it’s 2477
. We’ll need this in the next step.
Once you’ve finished that, return to the previous folder.
$ cd ..
Go to the Forge download page, select your version of Minecraft, and hunt down the build number found in the last step. It will be after the last “.
” in Forge’s full version numbers. For example, 12.18.3.2477
in our case. “Click Installer
“.
Once again, right click on the “Skip
” button after the timer runs out and use “Copy Link Location
“. Paste this into a wget
command.
$ wget http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.10.2-12.18.3.2477/forge-1.10.2-12.18.3.2477-installer.jar
We’ll need to run this file in Java. Type java -jar forge
and press the “Tab
” key to automatically complete the the filename. Type --installServer
to complete the command.
$ java -jar forge-1.10.2-12.18.3.2477-installer.jar --installServer
Take note of the Forge installer’s filename as we’ll use part of it in the next step.
Next, we’re going to write a script that can start up the server. We’ll use nano
to do this.
$ nano start.sh
From here, write the follow lines.
#!/bin/bash
java -Xmx[memory]M -jar [filename]
Replace [memory]
with the amount of heap memory in megabytes you’d like the Minecraft server to use. Remember to leave some for the OS. On a 1GB server, use something around 768MB.
Replace [filename]
with the filename from earlier but substitute -installer.jar
for -universal.jar
.
Here is an example of what it should look like.
#!/bin/bash
java -Xmx768M -jar forge-1.10.2-12.18.3.2477-universal.jar
Use “Control+X
“, press “y
“, and press “Enter
” to save and exit.
Next, you need to mark the file as executable.
$ chmod +x start.sh
You will now be able to run the script.
$ ./start.sh
The server will run for a little while and exit with an error. This is because Minecraft requires server owners to agree to its End User License Agreement. You can accept these terms by opening the newly created eula.txt
and changing false
to true
.
$ nano eula.txt
After making your changes, once again use “Control+X
“, press “y
“, and press “Enter
” to save them.
In order to keep the server running after closing the SSH window, we’ll use a utility called screen
.
$ screen
Press “Spacebar
” to move past the information screen and then run the script file again.
$ ./start.sh
The Minecraft server will now successfully start.
Lastly, use “Control+A
” and press “D
” to suspend screen
and then logout of your SSH client. You will now be able to connect through Minecraft using the Aklweb host server’s IP address.
Should you need access the Minecraft server again (e.g. restarting it after installing mods/plugins or running Minecraft commands such as op
), log back into the SSH client and use the command screen -r
to resume the screen
session.
In this tutorial you learned how to setup a Minecraft server with Minecraft Forge and Sponge. At this moment, however, it’s still a mostly vanilla Minecraft experience. To start extending Minecraft’s functionality, check out Forge mods at CurseForge and Sponge plugins at Ore.
Use an SFTP client or the wget
technique described earlier to add these to the server. To install Forge mods, just place them in the mods
folder. Sponge plugins belong in the plugins
subfolder of mods
. You might have to make this folder, however.
$ mkdir ~/minecraft/mods/plugins