How to create your own Minecraft server using Linux

  • Minecraft is still as popular as ever, even with Microsoft buying it, and considering it’s been played and active for a long, long time.

    I’ve played my fair share of it, solo, or with friends, and even with mods, including the first battle royale mods, before Fortnite was even a thought in Epic’s minds.

    Minecraft is great, and you can run your own server super easily, to invite friends, keep your world going even when you’re not playing.

    Let’s see how to do it!

    Set up your own Linux server with LINODE : www.linode.com/linuxexperiment
    (USE OFFER CODE LINUXEXP19)

    Support the channel on Patreon: www.patreon.com/thelinuxexperiment
    Follow me on Twitter : twitter.com/thelinuxEXP

    Commands for your Minecraft server:
    adduser “YOUR USERNAME”
    usermod -aG sudo “YOUR USERNAME”
    logout
    sudo apt update
    sudo apt install openjdk-11-jre
    mkdir minecraft
    cd minecraft
    wget launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar
    java -Xmx2048M -Xms1024M -jar server.jar nogui
    nano eula.txt

    Linode One Click App
    The easiest way is probably to use Linode’s One Click apps.

    Linode allows you to create a machine tailored to your needs, and start it with one click, and I use it for all kinds of projects.

    If you want to try running your own Minecraft server using Linode, don’t forget to click on the link in the description below, and use the offer code LINUXEXP19, for a 20$ credit, which can get you up to 4 months of free 24/7 Minecraft servers !
    Linode offers a one click install for a Minecraft server, with a lot of different settings you can tweak.

    Once you have created your account and used your promo code, you can just go to the “One Click apps” menu, and select “Minecraft”.

    You’ll get all the options you need to configure your server, from the type of world, the seed, the difficulty, the various spawns, etc… Select whatever you want here to change your server’s settings.

    This One click install uses Debian 9 as a base, for maximum stability.
    Pick the region where your machine will run, in my case the UK, since it’s the closest to where I live, and finally, the type of machine you need.

    Since my server is going to be a small one, I’ll pick the standard Linode with 2gb of RAM, at 10$ a month.

    If you plan to play with a few friends only, you could even go for the nanode, with only 1Gb of RAM, at 5$ a month.
    Type a name for your server, then a root password in case you need to connect to the server directly to change some stuff, and create it!
    The server will run automatically when you boot up your machine, and all you need to do to connect to it, is get its IP adress from the Linode manager, and enter it in your Minecraft client in the Multiplayer, “Add server” page.
    Create a user
    By default, your server will only have a root user, which is not fantastic.

    We’re going to create a user with less direct access to the system, just to be a little bit more secure.

    Let’s type: adduser “YOUR USERNAME”
    This one will add a new user to your server.

    You’ll have to answer a few questions, and fill in a password for said user.

    Next, we’ll give it administrative permissions, to make sure this user can install stuff and actually manage the server: usermod -aG sudo “YOUR USERNAME”
    Finally, we’ll log out of the root user, by typing logout
    ANd we’ll log in as our new user, by typing it’s username in the command prompt, and then the password we just gave to that user.
    Minecraft needs Java to run, so we’ll need to grab that first.

    It’s a simple install command.

    First we update all the packages:
    sudo apt update
    then we install the Java JRE
    sudo apt install openjdk-11-jre
    Now, we’ll need to download the actual server binaries to be able to run it.
    We’ll create a folder first, to store everything related to the server.
    Let’s type
    mkdir minecraft
    then
    cd minecraft
    THis created a “minecraft” folder inside our user’s home directory, and then we opened and went inside that minecraft folder.
    Next, we’ll type WGET, followed by the URL of the server file, which I got directly from the Minecraft launcher.
    wget launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar
    Start your server
    The minecraft server is a Java program, packaged as a Java archive.

    TO run it, we need to use the Java JRE we just installed.
    We are going to type:
    java -Xmx2048M -Xms1024M -jar server.jar nogui
    Press “enter”, and your server should start.

    It should however, on first start, give you an error, because you didn’t accept the end user license agreement.
    To tell it you accept this license agreement, just type:
    nano eula.txt
    Change eula=false to eula=true to indicate you have read and agree to the EULA.
    Then press, Ctrl+O to save; Ctrl+X to exit

    Category : Minecraft Servers

    #how#create#minecraft#server#linux

    0 Comments and 0 replies
arrow_drop_up