In this free CodaKid tutorial, we will be providing step by step instructions on how to make a Minecraft Server in 2022- including how to host your server for free.
In addition to guidance on how to set up free Minecraft server hosting, we provide step by step instructions on how you can set up multiplayer games that you can play with your friends and family.
We at CodaKid live and breathe Minecraft, and we teach tens of thousands of students each year Minecraft Modding using the Java programming language. We hope that you enjoy this guide!
Step 1: Get Minecraft Java Edition
These instructions require that you own the Minecraft Java Edition. If you own the pocket, console, or Windows 10 edition of Minecraft, you will not be able to host your own custom server. Minecraft Java Edition can be purchased and downloaded here.
If you already own Minecraft Java Edition, then you can proceed to Step 2.
Step 2: Get the Latest Version of Java
The first step in setting up a Minecraft server is making sure you have the latest version of Java installed. Minecraft requires Java to run the game and having the latest version will help us run our server without issues.
You can install the latest version of Java here. Once there, click the red Java Download button as you can see below:
Then, read and accept the terms by clicking the red “Agree and Start Free Download” button.
The Java setup run file should now be in the download folder of your computer. If you need help with finding the download folder, type in “downloads” into your computer search bar and open the Downloads folder.
Once in the downloads folder find the JavaSetup executable file and run this application. A popup window may appear asking if the application can make changes to your computer. Click to allow access, you may be asked to provide a password for these permissions.
Once the application loads click to install Java.
You may be asked to uninstall a previous Java version, do so as keeping an older version does not help with our server setup.
Once any previous versions are removed continue through the window prompts until Java is downloaded and up to date.
The first step in setting up a Minecraft server should now be complete. The following step we must take is downloading and setting up the actual Minecraft server folder.
Step 3: Download the Minecraft Server
The first step in downloading a Minecraft server is to download the Server.jar file from the Minecraft website.
Optional: If you want an older version, you can find a list of Minecraft versions below. Be sure to click the Server jar on the version you want to make sure you have the Server.jar required for the next step.
The following link has the latest version to download from the official Minecraft website.
Once on the page, click the Download Minecraft server jar link as shown.
Note: You may have a different version number than shown in the picture. This is okay as the latest version of Minecraft is constantly being updated.
Your computer may notify you that the file could be harmful to your computer. This is because any .jar file is treated as harmful when downloading in most browsers and computers. Just click Keep as this is an official Minecraft server .jar file we can trust.
Before we run this .jar file we want to create a folder for it that will hold all of the files. A common practice is to create the server folder on your desktop. To do this, go to your desktop and right click on an open space. Go to New > Folder and click to create a new empty folder.
Once it is clicked it will let you change the name of the folder, so name it something so you know it is your Minecraft Server.
Now return to your Downloads folder the same way we did earlier and right click on the Server.jar to copy it as we will paste it into the new folder we made in the next step.
Once you have the Server.jar copied, return to your desktop and open the server folder we made earlier. Then right click in the empty folder and paste in the copied .jar file.
With this server file in the folder, right click on it and press open to run the application. This will create some configuration files you will need for your server and they will be neatly placed in the new folder we made.
With these files, we need to accept the EULA agreement in order for our server to run without shutting down immediately. Open the eula.text file.
With this open you should see the line eula=false. Change this to read eula=true as shown below.
Once the change is made go to File > Save to save the text document so the agreement is complete. You can then exit out of the eula text document.
The next step is to run the server.jar file again to download more folders needed. Open the server.jar file to launch the server.
You should see a lot of new text documents as well as a server window that opens up as shown below.
Your new server is officially launched and ready to go! Players should be able to find your server game in the multiplayer tab if they are on the same internet connection your server is setup on. If you want to run the server so your friends can join your game from a different internet connection, we have a section lower that covers this.
Before we cover playing globally with your friends, let’s cover some commands we can use with our server as well as some server customization.
Step 4: Commands to Run the Server
The next step we are going to do is create a batch file we can use to launch our server and help it run smoother to prevent as much lag as possible. The first step will be to create a new text document that we will save as a .bat file. Go into your server folder and right click to create a new text document.
Once this document is made name it something easily recognizable as the file that will start our server.
Once it is renamed, double click to open the document and add in the text as shown below. These are commands to help our server run smoothly.
Let’s break down exactly what these commands are and what they do for our server. The -Xms1024M and -Xmx1024M are two lines that help the server run with more RAM memory. This allocates a gigabyte of ram memory for the server to run on.
The -jar and server.jar run the server jar file we have in the same folder. Important note: if your jar file is named something different than server.jar, you need to have the exact name of the file written out.
Finally, the pause at the end lets the window running the batch file stay open. This is helpful to spot any issues that may be crashing your server on launch or during gameplay.
Next, we need to save this file. Go to File > Save As to save this file as we will be changing it to a batch file instead of a text document.
Once in the save as menu, go down to where says save as a text document and change this to all files. This lets us change the type of file it will be saved as.
With all files selected, add “.bat” onto the end of the filename and then save. This will create a new version of your start server file that is now a batch file.
The next step is to delete the old text document so we are not confused as to which is the file we need. The text file should say the type of file is a Text Document this is the one we want to delete.
Now you should test out the server and make sure it launches with the batch file. Open up our new file and make sure the server starts. If it does not launch our server window, make sure you have the correct jar file name the command need to launch.
Once your server launches correctly go ahead an exit out of the server window as well as the command window that launched the server. We will now be customizing our server even further.
Step 5: Setting up Server Properties
Now let’s look at some server properties we can change to customize what kind of Minecraft game you want to play in your server. Open the server properties file.
Once here, you will see a lot of text sections. Let’s cover the most important ones and look at the properties you will most likely want to change.
The properties highlighted in the above image are some of the most important ones you should be familiar with. The first “gamemode=survival” property determines the gamemode you and your players will play in the server by default. This is set to survival meaning you will have hunger and health you will have to manage in game. Setting this to “gamemode=creative” lets the players build, break, and fly as they are untouchable and unkillable in this gamemode.
The next “spawn-monsters=true” is a property that tells the server monsters and dangerous enemies will appear. Changing this to “spawn-monsters=false” will stop monsters from spawning even in survival mode.
One of the more important properties in our experience with minecraft servers is the next highlighted “pvp=true” line. PvP stands for player vs play so this controls whether or not players can damage each other. By default this is set to true meaning players can hurt and damage one another in game. Setting this to “pvp=false” will disable and ability for players to damage each other.
The command line “enable-command-block=false” is a line that disables the use of the programming command block in the server. Setting this to “enable-command-block=true” will let the command block be used. The command block is a helpful tool to start teaching the basics of coding to Minecraft players. CodaKid has helpful courses that review the use of command blocks and the basics of programming with Minecraft.
Right below the command block line is the line that sets the maximum amount of players that can join the server. The default shown here is “max-players=20” so if you want a smaller server change this number to a lower amount or if you want to host many people, you can increase it.
The last two highlighted properties are the server-ip and level-name. The server-ip will be used in the next step of port forwarding to play across the globe with your friends. The level-name is what world you play in your server. It is set to “world” by default as a random Minecraft world is generated when creating the server files. You are free to replace it with any custom map or level you download on the internet, but you need to make sure to drop the whole map file in your server folder and then change the “level-name=world” to “level-name=” the name of your new map.
We now have a basic understanding of our server properties and how to customize our server. Now let’s do a little more work to make our server playable with friends.
Step 6: Port Forward to Play Globally (Optional)
Port forwarding is what is required to let your friends connect to your server if they are not on the same local connection. If you want to play on a server locally on the same connection this step is not required. It is important to note that port forwarding might cause security risks so make sure you follow the port forwarding steps carefully.
Every router is different when it comes to setting up port forwarding. A router is what is used to create a wireless internet connection. You need to follow the steps to reach your router’s admin page as we will be port forwarding a specific port address that Minecraft will use. Go to the following link below and click on the list of all routers and find your router. Skip all ads and do not download any software on this website. Additional software is not needed for this.
When you are on your specific router page follow the steps on setting up a port forward entry. This will differ from router to router but the general steps in common with most routers will be the following.
Create a static IP address
Login to your router and navigate the port forwarding section
Create a port forward entry
This website explains each step for your specific router in depth. When you get to the step of creating a port forward entry make sure you name it something that is recognizable such as Minecraft and the port number should be 25565. The port forward website also has a very helpful explanation about port forwarding for Minecraft here.
Once you have this all setup, it is time to finally test your Minecraft server and seeing if everything is connected properly. The tricky part to test your work on port forwarding is someone on a different connection than you has to test and see if they can connect to your Minecraft server. Port forward has steps for this in the link above but we will provide instructions for this below as well.
Step 7: Connecting to your Minecraft Server
Now let’s connect to the server. The very first step is to run our batch file to launch the server.
With the server launched, open your Minecraft launch page and make sure you load the version of Minecraft that matches the jar you downloaded. As of the writing of this article, Minecraft version 1.15 was the latest version and the server that was downloaded. However, if this becomes outdated I can make a new server or simply load up the 1.15 version of Minecraft. It will be a good idea to make a launch version of Minecraft that we can always connect to our server with. To do this you can go to the Installations tab and click the +New button.
Once here, you should name the installation with the server and version number of Minecraft and select the version as the release number your server download is. This is shown below for version 1.15 so make sure you change this to your Minecraft server version. Make sure to click create to finish this installation.
Next find it in your list and click Play to launch Minecraft.
Once Minecraft is launched go to the Multiplayer tab.
Once in the multiplayer tab, click Add Server.
On the new page after add server was clicked, make sure to add a server name and in the server address, this needs to be your public IP address so other players can connect to you. The address shown in the picture is just an example. Make sure to enter your unique public IP address. This can be found at the following link below. You may need to also enter a colon and the port 25565 after the address. So an example is 123.456.789.0:25565.
Once this is done you should see your server made and trying to connect. If you have a failed connection, check the ip address you entered as well as the port forwarding settings. If you see a green connection bar with open spots to connect to your server, you can launch in and enjoy playing in your very own custom server!
Playing with a Modded Server
While hosting your server and playing with friends you may want to play with some mods. There is a helpful guide below that covers adding mods to the server we just setup! In order for your friends to play the modded server with you, they need to have the same mods as you do as well as a forge modded version of Minecraft.
Creating your own Minecraft Mods
If you enjoy Minecraft Mods and want to create your own custom mods for use in your own servers, CodaKid has a series of courses that can teach you how to make your own custom creatures, biomes, dimensions, insane explosions and special effects, and more!
Minecraft coding is fun and creative, and teaches you real Java programming with the Eclipse IDE.
Our courses even include messaging and screenshare support from live engineers if you ever get stuck, and our courses even come with a two week free trial!
We hope you enjoyed How to make your own Minecraft Server, the Ultimate 2021 Guide. If you enjoyed our Minecraft server tutorial, we’d love it if you could share it with friends.
Also – for fans of modding, check out this free tutorial called How to install Minecraft Forge. Hope you find it helpful!
If you have any questions or comments, please leave them below! If your server configuration is not working, please make sure to follow this tutorial again and double check your work. You can also write us and ask questions – however please keep in mind that we are extremely busy serving customers and we may take a few days to respond.