DEV Community

Justus Walter-Helk
Justus Walter-Helk

Posted on

Creating a Local Minecraft Server

Creating a Local Minecraft Server

Welcome to my first-ever article! In this article, I will explain how to start your own local Minecraft Server with Paper.
Prerequisites
Java 17 (e.g. this)


Let´s open our File Explorer to get started! First, let´s create a new directory and cd into it using the Command Line. Here´s a quick tip: If you type "cmd" into the address bar of the file explorer you open a command line where you´re already in the directory!

mkdir myserver
cd myserver
Enter fullscreen mode Exit fullscreen mode

Next, we need to get the actual software to run our server on. I recommend using Paper, a fork of Spigot. To avoid needing to manually download the jar and place it into the folder we can use the curl command (which is included as a default command since Windows 10) to fetch the file for us.

# Keep in mind that we´re still in our server directory
curl --output paper-1.20.1.jar --url https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/69/downloads/paper-1.20.1-69.jar
Enter fullscreen mode Exit fullscreen mode

Now that we have our server software, let´s create the server. For starting the server we could just enter the command below into our cmd.

java -Xmx1G -jar paper-1.20.1.jar --nogui
Enter fullscreen mode Exit fullscreen mode

Or we could use the better version of putting the command into a start.bat file so we can start the server with a single click and don´t have to worry about opening and remembering the command. To do this just create a file named "start.bat" (Make sure you have file extensions enabled) and paste the following into it:

java -Xmx1G -jar paper-1.20.1.jar --nogui
PAUSE
Enter fullscreen mode Exit fullscreen mode

Note that -Xmx1G specifies the RAM available to the Java Virtual Machine and that we use PAUSE to prevent the console from instantly closing if an error occurs.

Starting the server

Now that we got this out of the way, execute the start.bat by double-clicking on it. If you tried to start the server before, you probably got an error saying that you have to accept the eula like now. To accept it simply open the eula.txt and set eula=true. If you try to launch the server now you should not get any errors.

Joining the server

To join your newly created server launch Minecraft 1.20.1 or the version you used for your server. Go into the Multiplayer tab and add a new server where you enter "localhost" as the host address. Congratulations! You should now be able to play on your own server! If you want to give yourself admin rights you can swap over to the command line and enter "op ".
Keep in mind: You cannot play with other players, not in your network! For that, you need port forwarding!
Thank you so much for reading! You can also find me on GitHub!

Top comments (1)

Collapse
 
endymion1818 profile image
Ben Read

Awesome article, my kids are gonna love this! Welcome to the community 👍