About backsoap1

    Description

    How To Create A Minecraft Server On Ubuntu 20.04

    The Tech Education Fund was the recipient of a donation from Write for DOnations.


    Introduction


    Minecraft is a well-known sandbox videogame. It was originally released in 2009 and allows players to explore, build, craft, survive, and create a block 3D world. It was the second-best-selling videogame of all time as of 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 there is DigitalOcean’s One Click Minecraft: Java Edition Server.


    This tutorial uses Java Minecraft. You won't be able to connect if you bought Minecraft through the Microsoft App Store. Most versions of Minecraft purchased on gaming consoles such as the PlayStation 4, Xbox One, or Nintendo Switch are also the Microsoft version of Minecraft. These consoles will not connect to the server that was built in this tutorial. You can obtain the Java version of Minecraft here.


    Prerequisites


    You will need the following items to follow this guide:


    - A server with a fresh installation of Ubuntu 20.04, a non-root user with sudo privileges, and SSH enabled. This guide will help you to set up your server. Minecraft can be resource-intensive. Keep this in mind when you select your server size. If you are using DigitalOcean and need more resources, you can always resize your Droplet to add more CPUs and RAM.


    - Minecraft Java Edition installed on a local Mac or Windows machine.


    Step 1 – Installing the necessary software packages, and configuring the firewall


    Once your server is up and running, you can install Java. This is essential for Minecraft to run.


    Update the package index to the APT Package Manager:


    sudo apt upgrade Next, install OpenJDK 16 of Java, specifically, the headless JRE. This is a minimal Java version that does not support GUI applications. This makes it ideal to run 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 the creation of a terminal session and its detachment, while still allowing the process to run. This is important, as if the session were to close and you tried to restart your server, it would kill it and cause your server to stop. 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. You allowed traffic only from SSH in the initial server setup. Now you need to allow for traffic to come in via port 25565, which is the default port that Minecraft uses to allow connections. Add the necessary firewall rule by running the following command:


    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: Download the Latest Minecraft Version


    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.


    To download the server, you will need to use wget with the copied link


    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 concentrate on the current 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.


    First, open a screen session using the screen command.


    Screen


    After reading the banner, press and hold the SPACE key. This will open a terminal session, just as usual. This session is now removable, which means you can launch a command from here and then quit it.


    You can now perform your initial configuration. Do not be alarmed when this next command throws an error. Minecraft has designed its installation this way so that users must first consent to the company's licensing agreement. This is what you will do next:


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


    Before examining this command's output, let's take a closer look at all these command-line arguments, which are tuning your server:


    - Xms1024M - This configures the server to start running with 1024MB or 1GB of RAM running. You can increase this limit if your server needs more RAM. Both M for megabytes as well as G for gigabytes can be used. For example: Xms2G will start the server with 2 gigabytes of RAM.


    - Xmx1024M This allows the server to use a maximum of 1024M RAM. You can raise this limit if you want your server to run at a larger size, allow for more players, or if you feel that your server is running slowly.


    - jar This flag specifies which server file to run.


    - nogui - This tells the server not to launch a GUI since this is a server, and you don't have a graphical user interface.


    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 because the server could not find two necessary files required for execution: the EULA (End User License Agreement), found in eula.txt, and the configuration file server.properties. The server couldn't find these files so it created them in the current working directory.


    First, open the eula.txt file in nano or another text editor.


    nano eula.txt


    You will find a link within this file to the Minecraft EULA. Minecraft survival servers Copy the URL:


    Open the URL in your browser and read the agreement. Then return to your text editor and find the last line in eula.txt. Change eula=false here to eula=true. Save the file and close it.


    Now that the EULA has been accepted, it is time configure the server to your requirements.


    The new server.properties file will be located in your current working folder. 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. You will modify this file with your preferred settings before starting your server. This tutorial will explain the basic properties.


    nano server.properties


    Your file will appear like this:


    Let's have a closer look at some the most important properties included in this list.


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


    - gamemode (default survival) - This sets the gameplay mode. There are three options: survival; creative; adventure; and spectator.


    - level_name (default world), - This determines the name of your server, which will be displayed in client. Characters such a apostrophe will need to be escaped using 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 set to true, players will be able to engage in combat and damage each other.


    After you have chosen the options you desire, save and close your file.


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


    Let's continue the same way as last time and start our server with 1024M of RAM. We can also give Minecraft access to up to 4G RAM, if Minecraft needs it. Remember, you are welcome to adjust this number to fit your server limitations or user needs:


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


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


    Once the server has been up and running, the following output will be displayed:


    Now your server is running and you have been redirected to the server administrator control panel. Now type help:


    help


    You will see this output:


    From this terminal you can execute administrator commands and control your Minecraft server. Let's now use screen to continue the operation of your server even after you log off. Next, you can connect to Minecraft and start a new Minecraft server.


    Step 4: Keeping the Server Running


    Now that your server is up, you want it continue to run even after you disconnect from SSH. You can disconnect from the session using screen by pressing Ctrl+ A + D.

    Run this command to view all screen sessions


    screen -list A screen output will be generated with the session ID. This is what you need to resume your session.


    To resume your session, pass the -r flag to the screen command and then 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 start playing!


    Launch Minecraft Java Edition. In the menu, select Multiplayer.


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


    The Edit Server Info screen will open. Give your server a name and enter the IP address of the server. This is the same IP address you used to connect via SSH.


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


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


    You are in your server and ready to play!


    You now have a Minecraft server running on Ubuntu 20.04 for you and all of your friends to play on! Have fun exploring, crafting, and surviving in a crude 3D world. Be aware of griefers.

    Listing

    Sorry, no listings were found.