How to create your own Minecraft server using Linux
Вставка
- Опубліковано 13 чер 2024
- 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: / thelinuxexperiment
Follow me on Twitter : / 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/object...
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/object...
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 - Наука та технологія
Will you be setting up your own server ? Which solution will you take ? The easy one, or the more hands-on one ?
More hands-on one! With your help i made a server so thanks. Also wanna ask if you ever gonna make a video of how to update a minecraft server?
Already did hands on before the vod but thanks for recap!
Nice vid for those who never created a VPS! If anyone is interested I have a simple python script to help automate the download and install/config of MC Servers: Github - raibtoffoletto -minecraft-server-install
which programm did you use to connect to the server?
@@lukaslee5504 it's a simple SSH. If you are on Linux/Mac just open a terminal and done. On windows you need to use PuTTY.
I bought Minecraft 3 days ago to play with friends and i was telling them that we can do a server and you made this video. Thanks!
Nice timing !
Little late but just use aternos.org/:en/ if you playing normal Minecraft
@@battlebuddy4517 kinda late too but aternos is pretty laggy and the ping is usually very bad. It depends on your region too though.
@@namelessdude5763 a little bit late too. Agree, i hate free minecraft server hosting, because of that i learnt how to set up a minecraft server in my own VPS
finally somebody knows how to teach this stuff, its so difficult to find a good video that just explains it plainly like an adult.
Thanks :)
Funnily, I just did this about a year ago.
Went incredibly smoothly already, but I’m sure this vid will still be pretty helpful for me!
one of the best tutorials ever. now i just need to learn how to ftp the local world to the cloud server and load the same plugins etc
Nice one. I'd like to add the one with Mods allowed of course.
thank you very much!
very easy to follow and now i can run a server without using my main pc
I had issues getting the right version of java to install but once i figured that out it worked great thanks for the tutorial.
What did you have to do?
Thank you for the vid! Now I create a server for my kids and their friends to play on. 🙏
Awesome :)
u good dad
THANK YOU @The Linux Experiment
I love your channel and your voice is so calming, I'm such a tech geek and I'd love to use Linux although everytime I try I fail and I think it's due to lack of instruction from other channels because I have a windows 8.1 and I wish we could meet but I'm only 11
Thanks a lot! You should try to research your computer's model online to see if anyone has had the same issues :)
How would you update it so it can run on the newest version of minecraft?
Is this guide still applicable in 2020? Also is this the same process with modded Minecraft. For example using modded server files provided by the ftb launcher.
I have the same question. I want to create a modded Minecraft server on Linux on an old computer we have laying around
How do I make it work with a modpack? forge won't install, it says there was some error.
in professional minecraft serverhosting, we only use docker deployments. thats the easiest way of doing it imho.
@The Linux Experiment im trying to get the launcher url and the description has only the start of the url can u reply with the full url pls?
have you ever draged the Minecraft launcher around on elementary os? does something weird to the window border almost like the compositor crash but hasn't, it's just weird
Yeah I had the same issue, it's really weird !
How would you download mods for the server? Great video btw.
what is thebsudo apt install open-jdk11-ere used for? compared to just regular sudo apt install
Amazing videos man. Keep it up. Quick question, which Huawei matebook do you advise for an android developer? You've got the 13 one right?
Yeah, I've got the 13, I think it could work for an Android dev, although for the Android simulator, I'd say the Matebook X Pro might be a better choice, with it's better GeForce MX150 graphics
I think a crap computer would do good, as mobile devices hardware is crap because of how small they are.
Weird to think of the Linux experiment as a tutorial channel that people see once and then never see again...
hey man awesome video! quick question, how do I make it so that this server is running on 1.15.2?
get a different jar file
Is therw any way to do that without opening a port in the router???
Is the server constantly running, if so is there a way to stop it or delete it?
i think you just type "stop" then press enter
Can this also on a virtual machine?
How do you save to world or does it auto save?
what os are using
the LINK is not showing properly :((((((((((((
This work for other distros too?
say I did this in wsl1 or wsl2 for windows. how can i close the ubuntu terminal and still have the server running?
You cannot. You should probably get a junk computer you may have and flash it with an ubuntu disk.
Hey what keyboard layout are you using? At 6:31 it says use Z, Q, S and D to move around.
AZERTY, it's the French layout :)
@@TheLinuxEXP Oh, right thanks lol. Was just wondering because I've been researching about different keyboard layouts and wondered which one you were using.
Eveerything is set up but I cant seem to access my server from another computer. I type in my PCs IP and i even went nano server.properties and added a server IP but I can't seem to connect to the server that was setup. No errors occurred during the installation, appreciate help
This only works if pc is on the same network
I want to create my own server where my friends can join without being local. Can you please make a video on how to do it on my PC
Port forward.
aternos.org/:en/ - I recommend this more then creating your own
@@battlebuddy4517 Bro aternos is dog shit
Hey guys, I know it's not a good place to ask things and it's not relevant im sorry. I use elementary 5.1 and my window buttons are placed like default which put the close button on the left and maximize on the right which i prefer. But somehow firefox always put the maximize button on the left like ubuntu and mac which confuse me some times. I saw Nick's firefox places the buttons on the right place so what's wrong with mine?
I used a custom elementary OS theme for.firefox, head to my website to see how I did it : thelinuxexp.com
@@TheLinuxEXP thanks so much, Nick!
How do i update the Minecarft sever ?
Good video, but if you close the Terminale, the Minecraft server close or not ?
It closes.
You left out all the fun setting up the server for external access. The potential fun with router port forwarding, firewalls, ip tables, then possibly apparmor. I was surprised by how many distros want to lock down all the ports. Then the headaches from different perspective imposed by the security paradigms various distros default to impose when first installed. How about sequel videos setting up Minecraft server and then PaperMC server for external access that includes all the security headaches for each distro? I had a hell of a time trying to get Mint Debian and Mint Ubuntu to work properly. I've found it easier to use MX Linux. I probably could have used OpenSuSE and just YaST(ed) my way through challenging details. There is so much to learn and so much more that can be taught. I skipped Arch after it became painfully obvious I'd have to micro manage the server daily thanks to updates that require reboots. If we were all adventurous we'd just use Slackware and force our brains to learn.
Thanks for the video I hope you do more for Minecraft and other self hosted game servers using Linux.
how do i use a command to let it use more ram? i have this server for mc so i can give it a bit more then that, but i dont know how
Just change the first -Xmx value in your startup command to however many mb of ram you want to assign.
-Xmx2048M assigns 2048MB of ram, just change the 2048 to another value.
For example, if you wanted to run your server with 4gb of ram, you would start your server like this:
java -Xmx4096M -Xmx1024M -jar server.jar nogui
@@bungaplayz228 i have a mini server as well and it has 8gb of ram I want to assign as much ram as I can. How do I know how much ram is available? Also for storage I have no SSD lying around, only HDD, do you think it might cause any problem?
@@lorenzomainini425 You said you have 8gb ram? I'd probably use around 7gb for your server so you can still run other processes
Again just change the number infront of the first -Xmx value as this will tell your server how many mb of ram you want to use.
I think you'll be fine with an hdd particularly if its 7200rpm there's not that much of an advantage you'll see with an ssd. Though of course higher write speeds are always nice
This is very nice!
Thanks :)
@@TheLinuxEXP your'e welcome :D
Guys, i dont have the option for multiplayer on mac , can anyone help please ?
Can you add plugins? In linode
Good thing I have linode already
What if I don't want to pay for it? Can I do it?
1:05 You can set the maximum players to 1? so basically a single player world?
Yep, at least I think so !
It says an error occurred during the initialisation of VM, too small initial heap
ok.. i dont know what i did but its working now
Thank you, Nick. Not a gamer but a good video.
Thank you :)
Cool, but I made a bedrock server instead with a Ubuntu server. I’m pretty sure that I just don’t have the technical experience to find the commands to run the bedrock release on my cloud server. I’m just a 13 year old anyways
So what if you don't want to give away your IP address (even the public one), is there anyway to use a domain server like Hover to make a dedicated IP?
Sure, you can always book a domain name for that server, and use that instead of the IP :)
@@TheLinuxEXP oh awesome :) because I've been trying to set up a Minecraft server on a second PC at home and I have a Hover domain, so I've been trying to figure out if it was possible to use that for my Minecraft server as well. Never could find any good guides on it
I want to try the nanode server but I am worried it won’t handle both my brother and I. If it works it would be a more cost effective solution to realms.
A few more questions.
1. Does it handle back ups of worlds?
2. Would using a VPN affect our ability to connect?
3. How does this compare to Realms?
Thank you for your time and making this type of Linux content!
Edit: Would you consider doing a review/play through of Minetest, the open source Minecraft clone? Or maybe even other open source games.
No problems with VPNs, I think the nanode would work fine for 2 players :)
Backups need to be made manually, Linode can backup the server but it's a paid option !
If you and your brother are on the same network, you can easily download paper. And you cna both play on the same server,
You cna also use lan
What Linux are you using???
i’m using a chromebook to this, wish me luck.
it works, but is very slow due to my chromebook only having 2gb of ram
welcome to the world of PTERODACTYL
Linode: a Linux distro working with akamai technologies. That's oxymoronic.
OMG, Thank you. I was looking for a way to start my own MC server on an old desktop using Ubuntu LTS 18.04 server. I want to know how to upgrade the server when new versions of MC are released and how to add things like MC data packs. Thank you so much.
I'll see if I can make that video :)
How about installing paper for plugins
You need to find a different host, or download the .jar file and host it on your own PC papermc.io/
I installed openjdk-8-jre is that matter?
Can you maka a video about how to install mod server
I can, if this one does well enough :)
id like to see that too, also great content!
my boy thank you
What version of Linux are you using?
I think ubuntu server 18.04 lts, but I think they have a 20.04 lts release now
awesome thank you
Can you change the version?
Have you found how to change it?
You should try out MineTest. It's a cool open source game that's similar to minecraft. It's no minecraft which is much much more mature, has more mods, a professional company, etc buuuut it could be something very cool.
It looks super good as well ! I'll definitely take a look
I've found minetest on the apt repository and also in flathub.
Yep! Minetest is pretty cool, built in C++ so you don't have the overhead of Java.
@@naseef2075 that's nice
when i type java "-Xmx2048M -Xms1024M -jar server.jar nogui" it says: "Error: Unable to access jarfile server.jar" even if i am a root user, what the fuck? any help?
(My distro is Linux Mint Cinamon)
Where is the server.jar file?
The link no longer works.
Tips on port forwarding:
1. The Minecraft server needs TCP and UDP
2. Set the ip address for the server PC to static
3. If you change the port in server settings you'll need to add the port number to the end of the ip address when CONNECTING. Example: 192.168.1.2:25555 ( Public IP Address : Port number )
dude that is local
not global
@@DeveloVooshGWeb No its not local.
i'm trying this on a raspberi pi 4.
What browser were you using
He was using firefox
I have to make an account but i dont have a credit card what now?
How do you plan to rent a server without a credit card to pay for it ? ;)
I installed paper, Geyser-Spigot and floodgate-spigot so that I can play from my android device on my server.
Forgot port-forwarding, now only people connected to your network can join.
Nope. I created the server on a linode, so not on my network, and I could join it no problem.
@@TheLinuxEXP Yes, but in the part where you say that you can also do it manually, you say you can also setup your own machine at home. In that case you're going to need port forwarding to make people outside your house join it.
You are doing one big mistake. You are installing java 11 instead of java 8. Also I recommend to use paperspigot instead of the vanilla server software.
It works well with Java 11, though
@Veruuux I haven't seen any issues with Java 11 or 12
13 has issues for me but it seems to only be because of Optifine since pure vanilla Minecraft works fine on Java 13
Its not like later versions have more issues infact they have less issues., I would also recommend using paper as its compatible with spigot, has improvements, and more.
so no port forwarding?
It wasn’t needed in my case
what is the command for finding the ip
your ip? or your servers ip? you can find the server ip by using ip -a
To find your networks ip you can use a find my ip website
@@jaylinxboxdude2323 nah i got it already i needed to find server ip its /hostname -I
Am i the only one hosting a 24h minecraft server on a 2011 laptop?
That works too :)
cellphone here :D
but our rule - don't spend money on games :(
Then how TF u play minecraft
Tlauncher@@c4m207
Tlauncher💀👍@@c4m207
@@c4m207 piracy
Is it 24/7?
Yep
@@TheLinuxEXP i thought it was free but i need to pay for 24/7
Why i always need to pay :(
Because your server is always running, you don’t pay for when you play, you ou for when you have access to the server
@@TheLinuxEXP wait so its free 24/7 but i need to be in the server?
Minecraft is free, running the server isn’t. Your server runs 24/7, so you pay for the time the server is up
best tutorial I think.
Thank you :)
I'd personally install Multicraft. This will then allow you to manage the server and not need to mess around with java start variables.
You can then easily change out jar files for spigot or similar if desired, plus you'll have a webpage to manage the server.
Here's a list of the best servers for play with friends: ua-cam.com/video/LOeivuEHQdc/v-deo.html
wee wee
what you are doing is showing me how to create my own linux based minecraft server. Now show me how to connect to it FROM LINUX because minecraft-lanuncher does not have an option to change servers and the windows client is PURE UNADULTERATED GARBAGE in wine.
how do i connect to this shiny new server FROM LINUXXXXXXXX??????????????????????
bad