Minecraft Blogs / Tutorial

[Tutorial] How to set up a locally hosted building server in minutes

  • 1,111 views, 3 today
  • 1
  • 0
Springstof's Avatar Springstof
Level 76 : Legendary Creator
736

Introduction



There are propably hundreds, if not thousands of tutorials out there on how to set up a server in Minecraft. However, most of these are aimed at setting up servers that are intended to be used by multiple players. For example, if you want to set up a server for a group of friends, or maybe want to give hosting a public server a go, you will need to set up a server that can be accessed by other players. But if you are just planning on building your own projects, or even to build for others without having to work on their server, you could easily set up a locally hosted server with all the tools you need to work on projects whenever you want, without having to pay for the upkeep of a server.

So, why would you want to set up a locally hosted server? Here are some benefits of hosting a locally hosted server:
  • It is completely free.
  • You can install every plugin you want, run any version you want, and do whatever you want with the settings.
  • You can allocate as much RAM and storage space to it as your own computer allows.
  • You can even use it without internet connection, and you will never have lag because of connection issues.
  • You do not have to depend on a server hosting service for the functionality of your server.
  • You can make back-ups by simply copying the files to another folder, drive or cloud storage.
  • You can still take the server with you if you save the files in the cloud or on a portable device/drive.
  • You do not have to upload or download any files or plug-ins using a (slow) FTP. All files are stored on your hard drive.
  • You can turn it on and off whenever you want.
  • You 'own' the files. You are not dependent on another person to access the files like on a public building server.
  • You can use modded clients and even modded server jars without risking getting banned for hacking like on a public building server.

What are some downsides to consider?
  • You cannot invite other players onto the server (unless you also enable port forwarding on your router, but the server will only be online when your computer is online, and the server is running. Most computers and routers are not ideal for running stable servers for larger groups of players)
  • If your computer is not very powerful, running a server could put extra strain on your hardware. This extra strain would be mitigated if your server is hosted elsewhere.
  • If you do not back up your files on external drives or in the cloud, if your hard drive breaks, you can also lose your server files.
  • If something is not working, or breaks down, you do not have any customer support available that can help you. You need some technical know-how to deal with unexpected issues.
  • You do not have a graphical user interface or server panel to work with.
  • Updating has to be done manually and can be somewhat challenging, especially if you are inexperienced with configuring Minecraft servers.

Okay, so when should you set up a locally hosted server then, instead of a modded single player world for example?

This is somewhat of a subjective question, but the main reason would be that you can use server plug-ins for server software such as SpigotMC. If you are a builder, mapmaker or developer, you are likely familiar with certain plug-ins that are commonly used on Minecraft servers, such as World-Edit, VoxelSniper, Essentials, etc. These plug-ins cannot always be used in a modded single-player world, and in the few cases where it is actually possible, it is usually not possible to use them all at the same time.

I personally use my locally hosted server to work on projects with the same tools I would want to use on an online building server.

If you are indeed convinced that hosting a local server for your projects, I think it is time to actually tell you how to do this.

Technical mumbo-jumbo



Firstly, you must understand on a basic level what a server is. If you already understand this, feel free to skip ahead.

What is a server, exactly?
A server is an instance of Minecraft that is running the game independently from the player(s). If you open a Minecraft singleplayer world, the world runs as long as you are actually in the world. A server can run an instance of the game without any players being in it. This is important for online servers, because players may want to join at any time without having to boot everything that is used to run the instance. Servers are ran using a 'jar'-file that contains the game code for Minecraft. When a player joins the server, they are also running that same code, and whenever a player interacts with the game world, the player sends that information to the server, and the server then send that information back to the player themselves, and/or other players, so that players can see what others are doing. Because the code that is ran on the server is ran independently from the game installation of the player, programmers have created custom server 'jars' that allow for the game to act differently than the unmodded 'vanilla' version of the game. So-called unmodded server jars are limited to the usage of game mechanics and assets that also exist in the installation of the game that the player is running, because otherwise the server could send back information to the player, such as custom blocks, that the player's version of the game does not recognize. However, with a customized jar that allows for plug-ins to be installed on the server, the game can still be heavily 'modified' within the bounds of the vanilla game code. For example, World-edit allows for the manipulation of the game world by placing, removing, replacing or moving large amounts of blocks in seconds - When these actions are performed, the player can also see this happening, because the player's client can just accept that the server has modified or updated their world files. This is a bit of an oversimplification, but the baseline is that the server can be modified without requiring actual 'mods', as long as those modifications consist of mechanics that can be understood by the player's client. Thus, all changes to the world and player files in a server can be understood by any other client running the vanilla game. This means that editing a world on a server will not make it so that that world cannot longer be loaded on a vanilla client.


Step 1: Compiling a jar



[Tutorial] How to set up a locally hosted building server in minutes

The first step in setting up a server is to find the version of the game you want to play. For example, if you want to run your server on 1.16.5, you will have to find a jar for that version. In this tutorial I will be using SpigotMC 1.16.5. Unfortunately, it is not allowed to share compiled versions of server jars online, so you will have to find or compile a jar yourself. Luckily enough, there is a tool called BuildTools that has an executable program with an interface that allows you to compile a jar for any version you might want. Simply download the latest release of BuildToolsGUI on this Github page, select the version of Minecraft you want in the top right corner of the interface, and press 'Run BuildTools'. Wait for the program to compile your jar, and once it is done, the jar will be saved on your computer. This process can take a while. Alternatively, if you already have a jar compiled, you can skip that step. Some websites offer direct downloads of pre-compiled server jars for SpigotMC, but this is technically not allowed, so I will not recommend doing so. If you decide to download a jar file directly anyways, do so at your own risk, and make sure to scan any files you download for viruses before using them.

If you used BuildTools to compile a jar, once the jar has been compiled, the jar is saved to a folder, likely in your 'Local' folder in your 'AppData' folder. The exact address of the jar will be displayed in the log of the BuildTools interface. Go to this address and copy the jar.

The exact address where it is saved will be different for you, but here is an example address. Navigate to this location on your hard drive, and copy the jar file:
C:\Users\Admin\AppData\Local\Temp\scoped_dir[numbers]\BuildTools\.\spigot-1.16.5.jar


Step 2: Creating the server directory and batch file



[Tutorial] How to set up a locally hosted building server in minutes

Now you will have to run your server for the first time. When you run the jar for the first time, it will generate all the required files in the directory you are running it from in the futre. So, create a folder somewhere on your computer, wherever you want to store your server files - this includes the world files for your server world. Make sure you have enough space for those! Also make sure you don't put anything else in that folder - it would make it more difficult to configure your server and find the right files in the future. Remember: the server is literally just going to be a folder on your desktop, so make sure it is saved somewhere safe and easy to access. Once you have moved the jar file to this folder, you will have to make a batch file to run the jar file. This is really easy to do. Simply create a file in the same folder using notepad, and paste the following lines of commands into the file (Windows only):

@echo off
java -jar spigot-1.16.5.jar --nogui
pause

The part "spigot-1.16.5.jar" refers to the exact name of the server jar. If your jar has a different name or version, make sure to match the name of the file exactly.

Now save the text file in notepad, and name it 'Run.bat', and select the type 'All files (*.*)' in the dropdown menu under the file name.

If you are using another operating system than Windows, please refer to the SpigotMC installation guide for the instructions on how to run your server on the corresponding operating system. The steps after this one should be roughly the same.

If you know what you are doing, you can also add a parameter to allocate a specific amount of RAM, and a parameter that stops the jar from telling you to update your jar with a forced delay of several seconds each time you boot your server. I personally use the following statement on the second line of the batch file:

java -DIReallyKnowWhatIAmDoingISwear -Xmx4G -jar spigot-1.16.5.jar --nogui
When the file is succesfully saved, you can click on it (or use a Terminal command on other operating systems) to run it. This will run your server for the first time. This file is also the 'start' button for your server from now on! If you want, you can create a shortcut on your desktop to this file to run it more easily. Otherwise, you can start the server from within this folder.

The server will first tell you that you have to accept the EULA of Minecraft. To do so, type 'stop' and click on the newly generated 'eula.txt' file that should have appeared in the folder. Make sure you read the EULA on the Mojang website if you haven't already, and then change the third line of the text file from 'eula=false' to 'eula=true'. Save the file, and run the 'run.bat' file again. This time, it will create the remaining files as well as a world folder. Note that your server is running in the command kernel that is opened when you run the batch file. If you close this kernel, it will also close the server! So keep it running in the background as long as you want to use your server. It is also your console - you can type commands in the command kernel like you would in a console on a hosted server. You can teleport players, stop or restart the server, etc.

Congratulations! You have just created your own locally hosted server!

Step 3: How do I access my server?



[Tutorial] How to set up a locally hosted building server in minutes

This step is incredibly easy. Simply boot Minecraft using the same version as the server jar, go to your server list, and add your server or simply join directly using the IP 'localhost'. If your server is running, you will join it instantly.

To stop your server, you can type /stop in your game chat, or simply type 'stop' in the command kernel. To restart, either type 'restart', or stop it, and run the batch file again.

Step 4: Adding plugins and configuring your server.





This tutorial is about creating a building server. The fun part basically starts here. You can now add all the plug-ins that you desire! There really is no limit on what to add, as long as your hardware can handle it. Below, I will give some recommendations for plug-ins that offer some essential tools for builders.
  • World-Edit (FAWE): This plug-in is probably the most volatile tool for builders out there. It allows you to quickly delete, place, change, move, copy and modify huge amounts of blocks with just a few clicks or commands. A must-have for builders and terraformers. I recommend using the FastAsyncWorldEdit version, as it is significantly faster and it is almost impossible to cause server crashes when using it.
  • VoxelSniper: This plug-in is probably the market leader when it comes to terrain modification. While it lacks some functions that World-Edit has for structural building, it outperforms the World-Edit brushes for terraforming by a long shot.
  • EssentialsX: This plug-in offers some useful commands that allow you to more easily change the time of day, weather, but perhaps most importantly: your flying speed. It also allows you to set warps to easily navigate your project(s).
  • Multiverse-Core: This plug-in allows you to easily import worlds to the server, as well as giving the option to have multiple worlds on your server at once.
  • Builders-Utilities: This plug-in offers some useful utilities such as command shortcuts, access to technical blocks, and the option to disable certain physics like explosions, crop trampling, etc. This is useful if you want to build using blocks like TNT, crops, technical blocks like half plants and still water which can otherwise not exist in Minecraft.
  • Schematic Brush Reborn: This plug-in allows you to bind schematics to World-Edit brushes, which enables you to paste structures, assets or objects such as trees or rocks with mere clicks of a button. It is incredibly useful for terraforming when you want to place large amounts of trees or rocks around your map. Just create your trees and rocks, save them as schematics, and bind them to your tools. Or, alternatively, you can use my own repositories for this: Trees - Rocks.
When you have downloaded the plug-ins you want, drag them into the plug-in folder, and restart your server. Make sure you downloaded versions that are compatible with your server jar! Now, if you rejoin your server and type '/plugins', you should see the plug-ins you have downloaded appear in a list. If they are showing as green text, they are working!

To make sure that your server is suited to your needs, you can also change the configuration of your server and plug-ins. To do this, first stop your server, and go to your server folder. You can change some things in your 'server.properties' file, but most relevant changes can be found in the configuration files of your plug-ins. You can find these by navigating to the plugins folder, and clicking on the folder of the respective plug-ins. Most configurations are generated with default values that are recommended by the plug-in developer, so you could use your server without ever changing a single configuration file, but if you find some unwanted behavior in your server, such as having the wrong gamemode when joining or switching worlds, you can look through the configuration files of Essentials and Multiverse to change these settings, for example.

Everytime you made a change to a configuration, you have to restart your server to enable that change.

Conclusion



That's all! It is that easy. If you have any troubles with setting up your server, or find any errors in my tutorial, feel free to leave a comment.

You can also contact me on Discord: Springstof#0147. However, please do not ask me to set up your server for you. I will not write your config files or download server files for you. I'm happy to answer questions, but there are plenty of resources out there that can answer most questions for you.
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome