NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

How To Create A Minecraft Server On Ubuntu 20.04

The Tech Education Fund was chosen by the author as a recipient of a donation in the Write for DOnations program.



Introduction



Minecraft is a very popular sandbox videogame. It was released in 2009 and allows players the freedom to create, explore, craft, or survive in a 3D-generated block world. It was the second most-sold video game in late 2019. This tutorial will show how to create a Minecraft server that you and your friend can use. You will install the required software packages to run Minecraft and configure the server to run. Finally, you will deploy the game.



Alternately, you can explore DigitalOcean's One-Click Minecraft: Java Edition Server as another installation path.



This tutorial uses Java Minecraft. If you purchased your version of Minecraft through the Microsoft App Store, you will be unable to connect to this server. Most Minecraft versions that are purchased on gaming consoles (e.g., the PlayStation 4, Xbox One, Nintendo Switch) also come with the Microsoft version. These consoles are not able to connect to this tutorial's server. You can obtain the Java version of Minecraft here.



Prerequisites



You will need the following items to follow this guide:



- A server running Ubuntu 20.04 with sudo privileges and SSH enabled. You can follow this guide to initialize your server and complete these steps. Minecraft can be resource intensive, so consider this when deciding on the size of your server. If you are using DigitalOcean and need more resources, you can always resize your Droplet to add more CPUs and RAM.



- A copy of Minecraft Java Edition installed on a local Mac, Windows, or Linux machine.



Step 1 - Installing the Necessary Software Packages and Configure the Firewall



After your server is initialized, the next step is to install Java. It's necessary to run Minecraft.



Update the package index to the APT Package Manager:



sudo apt update Next, install the OpenJDK version 16 of Java, specifically the headless JRE. This is a minimal Java version that does not support GUI applications. This makes it ideal for running Java applications on a server:



sudo apt install openjdk-16-jre-headless You also need to use a software called screen to create detachable server sessions. screen allows you create a terminal session, then detach it from it. The process will continue as normal. This is important because if you were to start your server and then close your terminal, this would kill the session and stop your server. Install screen now



sudo apt installation screen


Now that you have the packages installed we need to enable the firewall to allow traffic to come in to our Minecraft server. In the initial server setup that you performed you only allowed traffic from SSH. Now you must allow traffic to come in via port 25565, which is the default port Minecraft uses to allow connections. Run the following command to add the firewall rule:



sudo ufw allow 25565


Now that you have Java installed and your firewall properly configured, you will download the Minecraft server from the Minecraft website.



Step 2 - Downloading the Latest Version of Minecraft



Now you need to download the current version of the Minecraft server. You can do this by navigating to Minecraft's Website and copying the link that says Download minecraft_server.X.X.X.jar, where the X's are the latest version of the server.



You can now use the copied link and wget to download the server.



wget https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar


If you intend to upgrade your Minecraft server, or if you want to run different versions of Minecraft, rename the downloaded server.jar to minecraft_server_1.15.2.jar, matching the highlighted version numbers to whatever version you just downloaded:



mv server.jar minecraft_server_1.15.2.jar


You can find older versions archived at mcversions.net if you wish to download Minecraft. This tutorial will only cover the latest version. Now that you have your download let's start configuring your Minecraft server.



Step 3 - Configuring and Running the Minecraft Server



Now that you have the Minecraft jar downloaded, you are ready to run it.



Start a screen session first by running the screen command



screen


Once you have read the banner that has appeared, press the SPACE bar. screen will present you with a terminal session like normal. This session is now detached, which means you can start a new command here and let it run.
Fake Root


You can now perform your initial configuration. Do not panic if this command throws an error. Minecraft's installation is designed so that users have to agree to the company licensing agreement. Next, you will need to do this:



1. java -Xms1024M -Xmx1024M -jar minecraft_server_1.15.2.jar nogui


Before we look at the command's output, let us take a closer look to all of these command-line parameters that are tuning your server.



- Xms1024M -- This allows the server's RAM to be set up to either 1024MB, or 1GB. You can increase this limit if your server needs more RAM. Both M for megabytes and G for gigabytes are supported options. For example: Xms2G will start the server with 2 gigabytes of RAM.



- Xmx1024M - This configures the server to use, at most, 1024M of RAM. This limit can be raised if you wish to allow more players or if the server is slow.



- jar This flag specifies which server file to run.



- Nogui - This tells server not to launch a GUI as this is a client.



This command, which normally starts your web server, will return the following error when it is run for the first time:



These errors were generated by the server failing to find the two required files for execution: the EULA, End User License Agreement, found in eula.txt. and the configuration.properties. Fortunately, since the server was unable to find these files, it created them in your current working directory.



Open eula.txt first in nano or any other text editor.



nano eula.txt


Inside this file, you will see a link to the Minecraft EULA. Copy the URL.



Open the URL in your browser and read the agreement. Next, return to your text editor. Find the last line of eula.txt. You will need to change eula=false from eula=true. Save and close this file.



Now that you have accepted and confirmed the EULA, it's time to configure your server to your specifications.



In your current working directory, you will also find the newly created server.properties file. This file contains all of the configuration options for your Minecraft server. You can find a complete list on the Official Minecraft Wiki of all server property information. Before you can start your server, you will need to modify this file. This tutorial will explain the basic properties.



nano server.properties


The following image will be displayed on your file:



Let's take an in-depth look at the most important properties on this list.



- difficulty (default easy) - This sets the difficulty of the game, such as how much damage is dealt and how the elements affect your player. There are four options available: peaceful, easy, normal, or hard.



- gamemode (default safety) - This is the default mode. The options are survival, creative,adventure, and spectator.



- level-name (default universe) - This is the name of the server that will be displayed in the client. Characters such as the apostrophe may need to be escaped with a backslash.



- motd (default A Minecraft Server) - The message that is displayed in the server list of the Minecraft client.



- pvp (default true) - Enables Player versus Player combat. If this setting is true, players can engage each other in combat and damage.



After you have selected the options you wish, save the file and close it.



Now that you have set the EULA to true as well as your settings, you are ready to start your server.



Like last time, let's start your server with 1024M of RAM. Let's now give Minecraft the ability to use 4G RAM if it so desires. This number can be adjusted to fit the server's requirements or server limitations.



1. java -Xms1024M -Xmx4G -jar minecraft_server_1.15.2.jar nogui


Give the initialization a few moments. Soon your new Minecraft server will start producing an output similar to this:



After the server is up, you will see this output:



Your server is now running, and you have been dropped into the server administrator control panel. Now type help.



Help


An output like this will appear:



From this terminal you can execute administrator commands and control your Minecraft server. Now let's see screen to continue your server running even after you log out. Next, you can connect to Minecraft and start a new Minecraft server.



Step 4 - Keep the server running



Now that you have your server up, you want it to remain running even after you disconnect from your SSH session. You can detach from this session using screen as a shortcut. Press Ctrl +A + D to return to your original shell.


This command will display all screen sessions.



screen –list You'll receive an output with the session ID, which you will need to resume that session.



To resume your session, pass -r to the screen command. Next, enter your session ID.



screen –r 26653 Be sure to detach the session from your server with Ctrl+A + D before you log out.



Step 5 - Connecting to the Minecraft Server from the Minecraft Client



Now that your server is up and running, let's connect to it through the Minecraft client. Now you can play!



Launch your copy of Minecraft Java Edition and select Multiplayer in the menu.



Next, you will need to add a server to connect to, so click on the Add Server button.



The Edit Server Info screen opens. Give your server name and enter your server's IP address. This is the same IP address you used to connect via SSH.



Once you have entered the server name and IP address you will be taken to the Multiplayer screen, where your server will now appear.



This list will continue to show your server's name. Select it and click Join Server.



You are now in control of your server and are ready to play.



You now have a Minecraft server running on Ubuntu 20.04 for you and all of your friends to play on! Enjoy exploring, crafting, and surviving within a primitive 3D world. Remember to be careful of griefers.


Website: https://fakeroot.net/
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.