Building A Minecraft Server With 12 Year Old PC + Tutorial (PaperMC, Docker, DDNS, Port Forwarding)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in a previous video i set up a minecraft server as part of a simple home server project and while it did work the performance wasn't amazing even when i was the only user on the server i got some good recommendations in the comments on what i could do differently and while i could try this out on something newer i really enjoy finding good uses for old pc hardware so today i'm going to try and run a minecraft server on a 12 year old pc that i found in the trash stick around to see how it turns out [Music] before we get too far into this i want to be clear about what this video really is i mostly made this to be a fun experiment to see if a minecraft server could even run on old hardware and if so what the experience would be like i don't necessarily intend for this to be a full on tutorial but you can follow along if you're interested in building something similar i'll try my best to clearly explain the entire process as we go for the hardware side of things we're going to be using this compact cq 5720f which is a 12 year old desktop that i actually pulled from a trash pile i actually made a video about this earlier on my channel so click the card if you're interested in watching that but essentially i spent 12 dollars in that video to upgrade this machine with an athlon 2 x4640 which is the cpu we're going to be using for this project it also has 8 gigabytes of ddr3 ram and the original 640 gigabyte hard drive that came with the pc so all in all i spent 12 dollars on this pc not too bad now if you're following along with this video you obviously don't need the exact same hardware i have and i actually would not recommend going out and buying this you can try following along with pretty much any pc you might have just know that your mileage may vary for the software side of things we're going to be using linux or ubuntu server to be specific we'll also be using docker to run our server as well as some other things if you're wanting to follow along but just got really nervous when i mention linux and docker don't panic there are other ways to install something similar on windows however linux should come with a lot less bloat and overhead and considering the fact that we're trying to run this server on a 12 year old pc we might need all the help we can get so if you're new to linux and or docker but you're feeling a little bit adventurous and also have some old pc components lying around i'd encourage you to give it a shot it might be fun and you'll probably learn something i do want to point out that i am not an expert when it comes to linux or networking or servers or really anything that i'm about to talk about i mostly just do this for fun and i'm bound to make a mistake if i do and someone points it out i'll make sure to put a correction either in the description or a pinned comment to make this server work we have a few things we need to do first we need to install our operating system and then get docker up and running if you're unfamiliar with docker it's essentially just a way of running applications that have sort of been bundled up into what are called containers and while it can seem over complicated especially when you're new to it it actually makes installing complex services like our minecraft server really easy after we have docker installed it will only take a couple minutes to get our minecraft server up and running but we'll only be able to access it on our local network to solve this we're going to use a dynamic dns service called duckdns to create a custom subdomain that points to our home ip address then we'll set up port forwarding so that requests to our ip address get forwarded to our server this will be a lot easier to explain when we actually get there so let's just go ahead and get started with the install so the first thing we're going to do is just google ubuntu server and then if we head to their download we can accept all and visit and then once at their website you can look for this option 2 manual server installation and we want to download the ubuntu server 20.04.4 lts or long term support version while that's downloading we can also google rufus and then go to this website and download this as well okay now that we have these downloaded we can go into our downloads folder and open up rufus and rufus is going to be used to flash our ubuntu image here onto a flash drive so that we can use that to install ubuntu server on our machine before we can do that though i need to plug a device in so i'll just plug a flash drive into my computer and then after that it should show up here under device okay great so now i have my flash drive here and then under boot selection we want disk or iso image and then we can hit select and then if we head to our downloads folder we should be able to find our ubuntu server image here we can select that and then the rest of the settings here can just be left as default and we can hit start hit ok here hit yes because this will delete everything off this flash drive but we're okay with that and then we'll let this run for a few minutes until it's finished all right now that it's done we can eject that flash drive and we'll unplug it from our windows machine and plug it into our soon to be minecraft server with our flash drive plugged in we can go ahead and turn on our server if you don't already have an operating system installed it should go ahead and boot into the ubuntu server installer if not though you might have to spam a specific hotkey when you first boot up your system to get to the boot menu for me this was escape once in the boot menu you can scroll down until you find your flash drive and then hit enter after a few minutes of text readouts on the screen you should land on this page here so i'm going to select my language english and i have a us keyboard so i can just hit enter for done and then this page is where we're going to set up our network we're going to leave everything as dhcp like it is and you're going to want to go ahead and write down the ip address that's listed where it says dhcp v4 for me this is 192.168.1.138. so write that down somewhere so you don't forget but from here we should just be able to click done under proxy address we'll skip that we'll hit done for mirror address we'll do the same thing we'll just skip and then here's where we can configure the storage for our server and i'm just going to use the entire hard drive that we have so i can leave it on this use an entire disk setting but i am going to go down to where it says set up this disk as an lvm group and i'm going to deselect this that's because i had a few issues when trying to install this with an lvm group if it works for you great if not maybe try deselecting this option but then we can scroll down to where it says done hit enter again and this is just a summary of our install so we should be able to hit done and then we have a warning here to make sure we know we're going to delete everything on our drive and we want to do that so we're going to hit continue here we're going to set up our user account so i'm going to type in my name haven and my server's name i'm just going to call this compact mc and then username is going to be haven and then for password pick a secure password i'm just going to use a very simple one for this tutorial but pick a better password than that and then now we can hit enter for done we can hit enter again to skip this ubuntu advantage token now here we want to hit spacebar to select that we want to install openssh server that's going to make it really easy to access our server via ssh which we want to do we can skip the rest of these settings though and then hit enter for done here ubuntu server lets us install different services and the one that we actually do want to check is this docker so we can scroll down to this hit space bar because we will be using docker to install basically everything on our minecraft server but we should be able to skip the rest so we can just scroll down and hit done and we'll just let this run for a while because it will take a few minutes to install but we'll come back when it's done all right so after a few minutes it says install complete and we should be ready to go so we can scroll down to where it says reboot now and hit enter and then it will tell us to go ahead and remove our flash drive so we'll pull that out and then press enter and then this should reboot back into ubuntu server and we should be ready to get things up and running after a few minutes our server should boot back up and at this point we actually don't need a monitor on our server anymore and we can head back over to our windows machine so back over in windows we can hit the windows key and open up powershell and from here we should be able to type in ssh and then the user on our server so for me that's haven at and then that ip address i told you to remember 192.168.1.138 for me and if i hit enter it didn't work because i used commas all right if we type in ssh haven at 192.168.1.138 not using commas using periods hit enter it should work and we should get this message here and we can type in yes because we do trust this machine now we can type in our super secure password and we should be ssh into our minecraft server but i'm actually going to switch over to a software called putty that i prefer to use or this is actually solar putty that i'm logged into it right now so i'm going to be using this but you can use whatever ssh client you'd like to use all right the first thing we're going to do is run sudo apt get update type in our password and what this is going to do is this is going to check all the repositories to make sure that we have all the most up-to-date software and then if we want to be safe we can type in sudo or sudo it doesn't matter apt get upgrade hit y for yes and this will actually update any software that is out of date once that's done i'm going to type in clear just to clean up our console and we want to check a few things the first thing we want to check is that docker is actually running properly so we can type in docker version so that means docker is properly installed now if we try docker ps okay yeah so this is an issue we're going to be using docker a lot here and it's going to really suck if we have to keep typing in sudo or sudo every time we run a docker command so we need to add our haven user or whatever your user is to the docker group so that they can run docker commands without having to use the sudo or sudo command every time so we want to add our user to a docker group so that it can properly use docker so let's do sudo group add docker to create our docker group if it doesn't exist and then now we can run sudo g pass wd then dash a then our user haven and then our group docker and hit enter and now if we type docker ps oh it's still not going to work but if we exit out of our ssh client and then rejoin and try the same thing it still doesn't work okay so i actually had to restart the server for some reason which was pretty easy you can just hit the power button to restart it or you could actually type in sudo reboot and then hit enter and that would reboot the server for you so now we can type in docker ps and this will list all of our containers which we don't have any and we don't get that warning that we don't have permissions so that is good so you might be asking what is docker and why are we using it well docker lets us run containerized applications which basically means we can run our minecraft server as this little self-contained container i'm not going to go into way too much of what docker is but it's going to make this really easy to set up our minecraft server as well as other services that we might need now if you're not super familiar with linux don't worry too much i'll try to explain the commands as i go but if you follow along you should be fine without necessarily understanding everything but i'm just going to type in ls and this is going to list all the files in our home directory that we're in right now which we have this snap folder but nothing else we want to make a config folder for our minecraft server and so to do that we can type in mk dir from make directory and then we're going to call this mc docker hit enter and then now if we hit ls again we should see we have this mcdocker folder and so we'll use that here in a bit but that's where all of our configuration for our minecraft server is going to live next we're going to go ahead and open up a web browser and we're going to google paper minecraft docker and then right here mark tv slash minecraft paper mcserver we want to find this on docker hub i'll leave a link to the description to get here as well now what we want to do here is we'll copy this command and then we'll open up a text edit window or a notepad window and we're going to paste this command here now this is going to be our docker run command but we're going to make a few tweaks so first of all we're going to get rid of this remove or this rm command we'll leave name mcserver that's great under this here where it says memory size i have eight gigs of ram and i want to allocate six of it to our server because we're not really doing anything else with our machine so i'm going to do six gigs right here where it says dash v we want to select all of this up to this colon delete it and then we're going to type forward slash home then slash our username haven't and then slash mcdash docker now this is actually the location of the directory if we go back to our ssh and we type in cd so that means change directory to slash home slash haven you'll see that puts us back in our home folder we're in and if we have ls we can see our mcdocker folder and so this right here is the path to that config folder we made and that's going to bind it to a config folder within our container so when we make changes to our config in this folder our container can see that now we're going to add a few more things here so first of all we're going to add what's called a restart policy so we can type in two dashes restart equals and then we're going to write unless dash stopped what this means is that if our server accidentally crashes or when we reboot the machine it'll automatically start up unless we manually stop it i also want to add in this dash d oh i forgot to put these backslashes here that'll mess up our command so you won't have a backslash after each line but i want to do a dash d and then i also want to do a dash i t don't worry about what these mean to be honest i don't entirely understand but it will help us manage our server later on and then last down here where it says latest we're just going to replace this with 1.18 and if we go back to this docker hub page here we can go up to tags and you can see the different releases of this and we're going to use this 1.18 tag rather than latest because if we use latest and our server restarts and there's a new image up it might pull a different version of the paper minecraft server and we just want to leave it on this 118 that way it's consistent all right so this command should be good to go so we can copy this whole thing so command c head back into our ssh and we're going to right click to paste it and then hit enter and we're going to hope for the best we should get this unable to find image locally which means it's going to download it from docker hub and here in a second we should have a working minecraft server all right so after that's done we can type in docker logs and the name of our docker container which is mcserver and if we hit enter we should see all of this info coming from our log and everything looks good so now we can actually open up minecraft and now because our server is running 1.18.1 and not the most recent version which at the time of this video is 118.2 we will have to do a custom install so you can go up here to installations and then you could create a new install using the version we need which is 118.1 but i already have that set up it's set up here as server so we can go to play okay and so now we have minecraft open as well as our ssh terminal over here so we can go to multiplayer add server and i'm going to call this local minecraft and we're just going to put in 192.168. whatever it is for you for me it's 130 1.138 and i'm going to hit done and if all goes well we should have this right here so if i open up our server we are in minecraft on a minecraft server running on an athlon2 isn't that cool and if we type in the command top we'll actually see a readout of what our cpu usage is right now and so as we're running around we can see our cpu usage go up as it's loading new chunks but nothing too bad right now now the biggest problem with our server currently is that we can't actually access it from the internet we're only able to access it on our local network and that doesn't really help if you're wanting to play with friends who don't live in your house so we're going to do a couple of things first of all if we go back to our browser we need to figure out what our router is so we can set up some port forwarding and also reserve an address with dhcp so i know that my router address is 192.168.1.1 but you'll have to figure out what yours is once you do that you can navigate to it and you'll have some kind of login if you've never logged into this before there's a good chance this info is actually on your router but once again you'll have to figure that out on your own now your router is going to look quite a bit different than mine does but essentially you're going to want to navigate to some section where it says dhcp and then you're going to look for a client list and here we can see that where it says compaq mc we have my computer with our 192.168.1.138 ip address and there should be some kind of option to reserve or save this ip address that way that ip address doesn't get given to a different computer if our minecraft server is off for a while so i'm just going to hit this little save here and then now if i head to address reservation on my router down here at the bottom we see our compact minecraft server and that dhcpip address has been reserved so it won't change next we need to look for a section that says something about nat or port forwarding so for me it's under transmission nat and then for me it's listed as virtual servers but essentially you just want to find whatever section it is for your router that lets you configure port forwarding if you're not sure you can probably google the model of your router import forwarding and find someone who can explain it but i'm going to click add and then we're going to call this minecraft server or mc server interface is when external port should be 25565 internal port should be two five five six five and then our internal server ip is gonna be our 192.168.1.138 and then we can hit ok so now if anyone goes to our ip address on port 25565 that should get forwarded to our minecraft server but we have a big issue that no one really knows what our ip address is and if you're like most people where you have a dynamically assigned ip your home ip address could change every now and then so to fix this we're going to head to a website called duckdns.org and create an account now once you're signed in you should land on a page that looks something like this now what dns is is a dynamic dns service so essentially you can set up a subdomain or url with them and whenever your ip address changes this new url will always make sure it forwards to the correct ip address so first we're going to set up a subdomain so here i'm just going to type in test mc and we'll hit add domain okay domain is already taken no worries i'm going to type in haven test mc hit add domain all right so now we should have a few things we have this ip address here that i'm going to have hidden which should be your current ip address and we also have this token which is really important what we can do is we can set up another docker container that whenever our ip address changes it'll send information to the duck dns service to change our ip address so that when anyone goes to haventestmc.dns.org it'll resolve to our ip address and people can connect to our server so to do this we're going to go to a linux server.io go to the docs and scroll down until you find linux server ductdns this is another docker container that runs the ductdns client that will let dns know anytime our ip address changes so we can scroll down here to where it says docker cli and we'll copy this entire thing and paste it into our notes here and we're going to make a few changes once again so we're going to leave docker run d the same name.dns is great we're going to we can leave this exactly the same because our user should be 1000. for timezone i'm just going to set it up to my timezone which is america chicago for subdomains we want to get rid of these and just put in our haven test mc under token this is where we need to copy our token that's up here on dns and then we will just paste it here clean that up a little bit log file we'll keep that as false you could set this up to log to something on your server but we're just going to leave that as false now here it says volume or dash v and then it has path to app data we actually need to set up another config folder on our server so we can head back to ssh hit control c to get out of this top view here we'll clear things up and then we're going to navigate so cd or change directory and then we can actually put a little tilde here which is the same thing as typing slash home slash the name of our user so we can do that or we can do cd tilden all right so we're back in our home folder so if we hit ls to list we can see we have our mcdocker oh while we're here actually let's go lsmc docker and then now in what was an empty directory we have all of this stuff for our server but we'll come back to this later so if we hit clear again now we're going to make another directory so mk dir and we're going to call this duck dns docker you can call this whatever you want but i like this so now if we hit ls again we can see we have our dns docker as well as our minecraft docker back in our text editor we can change this path before the colon to slash home slash haven slash duck dns dash docker and this will be the same thing as it was with our minecraft docker container and basically just be a configuration folder that we can access and we'll leave this restart unless stopped as well and now we can just copy this entire command come in here right click to paste hit enter to run and this will install the docker container as well just like it did our minecraft server once it's done we should be able to type docker logs duck dns and everything looks good so we can type clear again and now if everything is set up properly when someone on minecraft will delete this server when someone goes to add a server on minecraft and we will call this haven server if they go to haven test mc dot duck dns dot org this should get routed to our ip address and because minecraft uses the port 25565 that request should get forwarded to our minecraft server on port 25565 and everything should work so let's hit done and see if it wow it worked it's like magic so now if we access this we're not accessing this on our local network we're actually accessing this over the internet just to test that we can actually go back to our ssh server and if we go to docker logs mc server we'll actually see that earlier where i joined the game it was from my local ip address but now that i'm joining the game it's from my home's ip address over the internet it's crazy so now we technically do have a working minecraft server that anyone with our url or haventestmc.dns.org they can join now to be honest i don't know a whole lot about minecraft servers i've never actually ran one myself so this is all very new to me but i know many people like to run things like plugins so i'm actually going to show you how you can install one of the most common plugins essentials x so to do this we're going to go back into our web browser and we're just going to search for it if we go to the website you can find this download link here and we're just going to right click that and hit copy link address then back in our server we can clear things up and we're going to navigate so cd to our minecraft docker directory and if we hit ls we can see all these folders again and there should be a folder called plugins so if we change directories to that and then now that we're in our plugins folder we can type in sudo w get and then we're going to paste in that link for the download and hit enter and then now if we type in ls we should have this essentials x dash blah blah blah dot and that's what we want so now we actually need to restart our server and an easy way to do that is to type in docker stop mcserver then after a few seconds we can type in docker start mc server and we can type in docker logs mc server again and after a few minutes we should be able to see that this essentials plugin has actually been loaded in and so if we go back to minecraft we hop back in this server i have joined the game now and let's just try some commands if i do this i can't do a fly command probably because i'm not op so i'm going to show you how to do that now so to use server commands not within the game you can type docker attach mcserver and then now if we type a question mark for example with our essentials x plugin we can see all these commands we can use i'm going to say op and then my username and so now if i go back to minecraft i should have been made a server operator and i should be able to type fly my username enable and look at that isn't that cool so to get out of the minecraft server terminal here we can hold down control and then pq and that will get us out safely without accidentally closing the server so if we hit docker ps for example we can still see that our duct dns as well as our minecraft servers are both up and running so anytime you want to use server commands you can just hit docker attach mcserver and then now you should have the ability to use any of these commands that i don't completely understand because like i said i've never run a minecraft server but you have all these here you can use or i guess if you are an op you can use them from in the game after getting everything set up i invited a friend to join and make sure that everything was working well with just the two of us things were going really smoothly are you ready for a small stress test sure yeah what does that look like oh god when quickly flying around the world it was obvious that the server was taking a while to render a lot of chunks all at once and it was even possible to fly past what had been rendered this could potentially be fixed by adjusting some of the settings for paper mc but i didn't dive way too into that it wasn't really a problem when we were on the ground like normal my friend even made a comment that the server was a bit more responsive than a realm that he and a few friends actually pay for which i found surprising after testing with just the two of us i opened up the server to the hardware haven discord server we never had a ton of people online all at once i think the max was four maybe five but no one really experienced too many issues at that one person that lives halfway across the world had some latency issues but we mostly fixed that by changing the network compression threshold to 64 from the default which i think is 256 and we change that in the minecraft server properties overall i think this could work pretty well if you're just wanting to create a simple server for you and a few friends to play on now i should point out the issue of power consumption here my setup was pulling around 55 watts while just running the server idly it spiked up more when players were online and chunks were being loaded with where i live this means i would probably be paying at least 50 to 60 a year more on my electricity bill if i ran this server 24 7. but realistically i would find a way to only run the server at certain times when i knew it was possible that i or a friend wanted to be on but even at 60 a year this is still cheaper than paying for a minecraft realm i know this video isn't perfect and i'm sure many minecraft server experts will have lots of ideas on how this could be done better if so i'd love to see your advice in the comments and if you have a server running on old hardware i'd love to hear about your setup and experience if you like this video and want to support the channel i'd love it if you could hit that like button and maybe consider subscribing if you haven't already and i don't always get lucky and find all of the hardware on this channel in the trash so maybe consider taking a look at my patreon if you'd like to support the channel that way know that all of the income from my patreon will go directly to purchases for the channel but that's all for now so thanks for watching stay curious and i'll see you in the next one [Laughter] [Music] [Music] you
Info
Channel: Hardware Haven
Views: 833,291
Rating: undefined out of 5
Keywords: Budget cpu, Computer restoration, Pc, beginner homelab, budget builds, budget pc, budget server, can i run minecraft server on old pc, cheap minecraft 1.18 server, cheap minecraft server, docker, free pc, home assistant docker, homelab, how to build, how to set up, hp, minecraft, minecraft 1.18 server, minecraft server on old computer, minecraft server on old pc, old computers, old pc, papermc, pc build, pc building, quad core, scrap pc, scrap pc build, ubuntu, ubuntu server
Id: eIHiRW4QH6I
Channel Id: undefined
Length: 31min 9sec (1869 seconds)
Published: Mon Mar 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.