How to setup a Minecraft Server Network

Today I’m going to explain an easy way on how to protect and create your BungeeCord server on your VPS or Dedicated Server. I will be giving explanations with every command and action. If you like this tutorial please do not forget to leave a like!

I assume you have already installed: Java and Ubuntu

NOTE: This tutorial is about the security of your minecraft server, NOT about the security of your VPS or dedicated server. I do not advice to run your servers on root, but I do advice to use SSH keys and other types of security.

Step 1: Login via SSH.
Once you got your login credentials, you are able to log in.
I advice to use PUTTY on Windows and the terminal on Mac. The terminal is fairly easy to use, just execute this command: ssh {username}@{ip} . Your username will – most likely – be replaced by root. When connecting for the first time you will probably need to accept the connection by typing: “yes”.

Before we can start we should be root

Code :

sudo su

Now enter your password

You’re logged in now and you’re off to go!

Step 2: Change the password of your server. (optional)
You probably do not want to use the random password you received from your host. It’s easy to change your password with the passwd command.

Step 3: Install screen.
We want to run multiple servers at once and therefore we will be using screen. To install screen, we will firstly update our server.
Code :
sudo apt-get update && sudo apt-get upgrade
Secondly, we’ll install screen.
Code :
sudo apt-get install screen
Step 4: Creating the servers.
We will be creating multiple folders for all servers. I usually prefer to make a folder servers in my home directory. We will be using /home/servers in this tutorial.

First, create the folders.
Code :
mkdir /home/servers
Code :
mkdir /home/servers/BungeeCord
Code :
mkdir /home/servers/Lobby
Code :
mkdir /home/servers/Server1
Second, add the jars to the folders and create startup scripts.
Change your directory to the BungeeCord server and download the BungeeCord.jar file.
Code :
cd /home/servers/BungeeCord
wget -O BungeeCord.jar http://ci.md-5.net/job/BungeeCord/lastSuccessfulBuild/artifact/bootstrap/target/BungeeCord.jar
Then, create a startup script.
Code :
nano start.sh
Add the following code to that file:
Code :
cd /home/servers/BungeeCord; screen -dmS bungeecord java -Xms1G -Xmx1G -jar BungeeCord.jar
Press CTRL + X, press Y and press ENTER. Your bungeecord server is done now.

– Do this for each spigot server (eg. Lobby, Server1)! –
Change your directory to the Lobby or Server1 server and download the spigot.jar file.
Code :
cd /home/servers/{SERVERNAME}
wget -O spigot.jar {DIRECTLINKTOYOURSPIGTBUILD}
Then, create another startup script.
Code :
nano start.sh
Add the following code to that file:
Code :
cd /home/servers/{SERVERNAME}; screen -dmS {SERVERNAME} java -Xms1G -Xmx1G -jar spigot.jar
– Do this for each spigot server (eg. Lobby, Server1)! –

Step 5: Start all servers on startup.
Crontab is a list of tasks that gets executed when you want it. You can create timings etc.
To edit the crontab file of your current user, execute the following command:
Code :
crontab -e
– Do this for each spigot server (eg. BungeeCord, Lobby, Server1)! –
@reboot sh /home/servers/{SERVERFOLDER}/start.sh
– Do this for each spigot server (eg. BungeeCord, Lobby, Server1)! –

When all servers are configured, reboot your server.
Code :
reboot
Step 6: Managing your servers
Setup localhost.
Your servers should be running now, although your spigot servers have not been protected yet against cracked clients. Change the server-ip to localhost in all spigot servers.
Code :
server-ip=localhost

Ports

For the servers not to overlap we will have to change the ports of each server.

Code :

cd /home/servers/Lobby

server-port=23456

Now we will need to change the IP on the BungeeCord config.

Code :

cd /home/servers/BungeeCord

nano config.yml

Now change the IP of the Lobby

Code :

 – lobby
  bind_local_address: true
  host: 0.0.0.0:23456
  max_players: 1

If you don’t know how to add servers to your BungeeCord config.yml, consider reading the SpigotMC wiki.


Last tweaks.
Set ip-forwarding to true in the config.yml file of your BungeeCord server.


Code :
ip-forwarding: true
Change the ip of your bungeecord instance to 25565.
Set bungeecord to true in the spigot.yml file of all your spigot servers.
Code :
bungeecord: true
Change online-mode to false in all your backends.
Code :
online-mode=false


Screens explained.
You can get access to the console of every server with the screen -r command.
Code :
screen -r
Code :
screen -r {SCREENNAME}
If you want to get access to a screen when someone else is logged in too:
Code :
screen -x {SCREENNAME}
To leave the screen do: CTRL + A + D .

You are now able to connect to your minecraft server with the IP of your server ( localhost ) !

If you can please post your Minecraft Server IP into the comments 🙂 .

Thanks for reading this and I hope this has helped you !

Please donate :)

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *