How To Set Up a Minecraft Server Network with Bungeecord and Velocity

When setting up a Minecraft server, you may want to have multiple different gamemodes available to your players. The best way to do this is to have each gamemode on a completely separate server. This guide will explain how you can easily accomplish this.

When configuring a server network, your players will be connecting to your network through a piece of software called a proxy. The proxy is responsible for deciding which server to send players to. It does not run servers itself, but rather manages the connection between your players and your backend servers. There are two primary proxy software packages available that you can choose from. The first is the Bungeecord family of proxies (most commonly Waterfall is used), and the second is the Velocity proxy. In the first part of this guide, we will discuss how to configure a Bungeecord proxy, and in the second part, we will discuss how to configure a Velocity proxy.

How To Configure A Bungeecord Proxy

In order to set up Bungeecord for your network, you are going to need a second hosting plan. You can click here to get an affordable plan just for Bungeecord. You should now have at least two servers available, one for Bungeecord, and one for each of your backend servers.

Configuring Bungeecord

For this guide, we recommend using Waterfall, which is a well-maintained fork of Bungeecord by the PaperMC team that fixes many bugs and improves performance. To install Waterfall, click here to download the jar file, and upload it to your server. Make sure you either rename it properly or change the startup option in the "Startup" tab in the panel. After this is completed, start your bungeecord server in order to generate the configuration files.

After the configuration files have been generated, the most important configuration file to locate is the config.yml file. Open this file and locate the line that starts with servers. Here, you need to define the name, IP address, and port for each server you'd like to be a part of your network. Enter all of your servers here. You may also want to adjust the priorities setting, which defines the first server that your players will reach when they join your network. Important: You will also need to set the ip_forward configuration option to true in this file. You are also encouraged to read the complete configuration guide for Waterfall located here. Once you have configured this file, you are ready to move on to the next step.

Configuring Backend Servers

The servers that Bungeecord connects your players to are called your backend servers. Some minor configuration is needed on your backend servers in order to ensure compatibility with Bungeecord. First of all, you will need to disable online mode. To do this, edit the server.properties file, and change online-mode=true to say online-mode=false.  Next, edit the spigot.yml file, find the option named bungeecord, and set it to true. Once you have saved both of these files, restart your backend server.

You will want to repeat these steps for all of your backend servers. Once you have finished this step, you should be able to connect to all of your backend servers. Congrats! You've set up your first Minecraft server network!

Security

This section is very important. When running your backend servers in offline mode like this, any player is able to join your server impersonating as you or your staff members, with full permissions. The way your network is set up is that Bungeecord handles authentication (which makes sure that you are, well, you), and the backend server trusts Bungeecord to do this task properly.

In order to fix this problem, we highly recommend the use of the BungeeGuard plugin. This plugin installs on both your Bungeecord server and all of your backend servers, and ensures that all connections are authentic, blocking any impersonation or spoofing attempts. To set up bungeeguard, download it from this link, and upload it to the plugins folder of your proxy and each of your backend servers. Once the plugin is uploaded to all servers, restart Bungeecord and all of your backend servers.

Once this is finished, find the plugins/BungeeGuard/token.yml file on your Bungeecord server. Copy the token out of this file, and save it. Next, select one of your backend servers and find the plugins/BungeeGuard/config.yml file. Add this token to the tokens section of the file. Make sure you remove any other tokens, including the example ones. When you are finished, it should look like this:

allowed-tokens:
  - "KUax93mll7B8WavaD2VI5p4J9Dkvt5T7A7NdfT0D1ZmSpZ1JYvm8heymWn6GHZBu"

Repeat this process for all of your backend servers, and make sure that you restart all of them. Make sure you keep this token secret.

In order to check if your server is secure, attempt to join one of your backend server IPs. If you see a message that says "Unable to authenticate," then your server is secure. If you see a message that mentions "IP Forwarding", or you are able to log in, then your server is not secured and you will need to troubleshoot what you did wrong.

How To Configure A Velocity Proxy

Velocity is a more modern Minecraft proxy software inspired by Bungeecord and Watefall. It is recommended to use Velocity instead of Waterfall/Bungeecord because it performs better and is secure by default.

Configuring Velocity

As with Bungeecord, you will need a separate server to run Velocity. You can find a link to purchase an affordable Velocity server here. Velocity can be downloaded here. After you have downloaded and installed velocity on your server, you will need to start your server in order to generate the proper configuration files. If your server already has configuration files from a previous Waterfall installation, you should delete all of these files before starting your server. Note: Most Bungeecord plugins do not support Velocity. Check to make sure that the plugins you want to use are available on Velocity before you choose this option. If your plugins are not available on velocity, then you may want to choose to configure a Bungeecord server instead.

After starting Velocity for the first time, you will want to edit the velocity.toml file. Locate the option player-info-forwarding-mode, and change it to modern. Next, find the forwarding-secret option, and save the value in it for later. This will be used to configure security. Under servers, configure all of your backend server names, IP addresses, and ports. To configure which minecraft server your players connect to first, edit the try option in this section. If you would like documentation on how to configure the other options in this file, you can view Velocity's docs here.

That's all there is to configuring Velocity. At this point, you will need to restart your Velocity server to apply the configuration changes.

Configuring Backend Servers

When configuring your backend servers, a few options need to be adjusted to allow Velocity to function properly. First, find the online-mode setting in your server.properties file. Next, edit the spigot.yml file and ensure that bungeecord is set to false. We are not using Bungeecord, so having this option enabled will interfere with Velocity. Finally, edit the paper.yml file. Under the velocity-support section, set enabled to true, set online-mode to true, and set secret to the forwarding-secret value you saved in the previous step. Restart your backend server, and repeat these steps on all of your other backend servers to finish the process.

Security

Velocity is secure by default! With the forwarding-secret option we configured earlier, your backend servers will automatically reject any connections attempting to impersonate you. To confirm this, you can attempt to join your server using one of your backend IPs and ports. If you get an error message, then your server is properly secured.

Conclusion

Configuring a Minecraft server network is easy to do and can be a very rewarding experience once you get it set up right. As long as you've followed all of the steps in this guide, your network should be properly set up to secure against attacks. If you are a Pufferfish Host customer and you are having any trouble following these steps, please reach out to us and we will help you through the process.