Turning an OLD PC/Laptop into a Media Server! (Ubuntu/PLEX Guide)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody this is tech and in this video what we're going to be doing today is turning an old laptop or computer into a media server today i'm going to be doing this on this old thinkpad laptop uh it doesn't get too much use so i thought that there was nothing better to do with it than to turn it into a home media server so what this video is going to be is your guide on how to do this what we're going to be doing is first installing the ubuntu server edition on this laptop i'm going to go over some other tips and things you might want to consider once ubuntu server is running on this we're going to go ahead and ssh into it from a different computer so that way you don't actually have to go up and do everything on this computer and then that way we'll be able to copy and paste all the commands and everything that we're going to need very very easily on our main system then we're going to go over installing plex which is the media server we're going to use i will note that for this tutorial this is going to be on your local network only as far as ssh and actually connecting to the server but because we are going to be using plex you will be able to access your content via plex applications outside of your home network now the title of this video does specify that we're going to be doing this on a laptop but this will work on any old computer it doesn't even have to be an old computer you can get a special server or get a system dedicated specifically to this this will work on just about anything but there will be a little tip on how to make this just a little bit better if you are using a laptop so enough with the introduction let's go ahead and go on to our computer and burn the disk image of the ubuntu server edition now here i'm on the ubuntu website and to download this all you're going to want to do is go over to download go to the ubuntu server and then over here under the manual server installation go ahead and click on that and you're going to want to get the latest long-term support version the lts versions are generally better to go with when it comes to running a server because you won't have to worry about shutting down updating things like that you can see here that the 20.10 server only has updates maintenance updates until july of 2021 that's not going to work for us so go ahead and click on download ubuntu server and then you should see a screen that looks like this you're just going to want to click save file ok and then the file will begin to download luckily i already have it downloaded i'm running on a linux machine right now so what i'm going to do for this machine is open an application called popsicle it is the usb flashing tool created by the people who created the uh pop os operating system this has worked really good for me it's never done me wrong you could use other tools like etcher and i'm pretty sure that you could do this through gnome disks and kde partition manager as well so all you need to do is click choose image and then you can see i have the ubuntu server right here can go ahead and click on that open the file and once you have it there and you verify that that is the proper disk image go ahead and click on next and then right here you should see the usb that you just plugged in go ahead and click on that click next and it will begin flashing it's going to prompt you with a password go ahead and type that in i will note before you do this it will completely wipe everything on the usb so if you have anything of importance on there make sure you go ahead and back that up and if you are running on windows i recommend you using an application called rufus just like with this you select the iso file you select your usb generally you keep all the settings at default it'll prompt you a couple times asking if you're sure if you want to do this it's going to wipe all your data you just say okay and you burn or flash that iso so real quick before we actually go ahead and install the ubuntu disk image on this laptop i will note that if you do have something like this this is a thinkpad dock this is really really handy for plugging in additional hard drives and stuff and another thing i'll recommend is using an internet core to do this this is a server so it's much better to have a direct wired connection than using wi-fi it's just how it is what i'm going to go ahead and do is open up the computer power it on and depending on your hardware you're going to need to hit a button to get into your boot menu or bios whatever it is and you're going to want to make sure and plug in the usb that we just created so i'm going to go ahead and plug this in and for me i'm going to hit f12 to get into my boot menu and then from here i'm going to go ahead and select the first option which is the usb hard drive from here it's going to give you a couple options you're going to want to go with the first one which is to install the ubuntu server now on the initial boot with the usb it might take a little bit to boot up the first time and one thing i'm actually going to do is actually overlay a little screencast i did of the same installation process in virtualbox just so you can see what i'm doing a little bit better okay and once we are in the ubuntu server installation the first thing that we're going to do is select the language we want to use you just use the arrow keys to move around and when you hover over the language you want to use just hit enter and then from here it's going to ask you if you want to update the installer during the actual installation process we're going to go ahead and do this later so let's just continue without updating and then the next screen is going to be to select what keyboard layout you have if you do need to change this you can just go ahead and scroll up hit enter and you'll have a list of keyboard options here for me i'm just going to go english us go back down and hit done and now on this page is when we're going to select our internet adapter now one of the reasons why we plugged in the internet is it's way easier to configure than trying to connect to a wi-fi connection through here so it's as easy as going to the internet well if it's already selected and you see a good ip address there you could just go ahead and click done but if you do need to change anything around you can just go ahead and select on the adapter and you will have some options here such as editing your ip4 information i do recommend you keeping this as is as automatic we're going to go ahead and cancel out of this and we know this is the adapter that we want to use because it's the only one available at the moment i'm just going to go ahead and hit done and then from here it's going to ask us if we want to enter a proxy address this helps you access your server from the outside world uh you can go ahead and do this later for our use case we are not going to need to do this so you can leave that blank and hit on done from here we're going to select our mirror this is where we're going to download all the updates and packages from for me the default mirror is completely fine download speeds are super fast if you're somewhere else in the world you may want to change this but generally no matter where you are the default option should work for you so we're going to go ahead and hit done here we have the option to use the entire disk i do recommend you go ahead and do that so check use entire disk and i'm actually going to disable the set this disk up as a lvm group for now you could go ahead and do that if you want to but for what we're doing this is the just the easiest and most straightforward way so we're going to go ahead and go to done and then on this screen it's going to give you a little rundown of the partitions and everything that it's actually going to do to your hard drive after you give this a quick little skim through and you verify everything is correct watch if it you do have just one root directory and a boot partition and the storage size takes up the entire drive chances are you're good to go so here we're going to go ahead and hit done now right here it's going to ask you if you want to confirm this action it's asking you this because if you have anything on your disk it's going to completely wipe everything so just like with the usb you're going to want to go ahead and back this up if you do have sensitive or important data on the drive so i'm going to go ahead and go to continue and at this point in the background that's actually going through and wiping the drive and beginning the installation process but right here we're going to go ahead and create our user account uh for this i'm going to just go with brandon as my name i'm going to call this server media username i'm just going to go with my name again and then here we're going to go with a password i recommend you make it fairly strong done one thing we're going to want to do here make sure you select install open ssh server this is going to be how we're going to actually get into our server a little bit later transfer files and run commands externally so go to make sure that is selected and then with that selected you could actually go ahead and leave everything at default so now we're going to go ahead and hit done so on this screen it's giving us the option to install specific snap applications which a lot of these are actually really really good but this isn't really the purpose of the video it's just a bunch of extra utilities that you could go ahead and use like i said i will be taking a look at a lot of these in the future such as next cloud there will be a video on that coming up so make sure you are subscribed to see that but for now we're gonna go ahead and hit done all of these you could go ahead and install very very easily later so done and now it is installing the core of our system as it's been doing in the background the whole time so we're going to go ahead and wait for this to finish up and then reboot into our new ubuntu server install and then once ubuntu server is completely done installing you're going to have an option to reboot your system we're going to go ahead and hit enter and then from here it's going to ask us to please remove the installation medium and then press enter so i'm just going to pop this usb out of the drive and then go ahead and hit enter and now your system or your new server is going to begin the process of booting for the very first time now the first thing i'm going to try to do once it's completely booted up is try to log in so i'm going to type my username and then type in my password and then you can see that we are now logged into the ubuntu server now from here all we're really going to want to do is quickly update our system and then pull the ip address so the first thing we're going to do is go sudo apt update type in your password again and then it will begin updating your repositories and gathering the package lists that it needs and according to my server there are 84 packages that need updated so we're just going to go sudo apt upgrade and then it will begin upgrading after i hit y and enter and depending on how old the actual disk image is will dictate how long it will take to update your system but just go ahead sit back and relax and wait for this to complete and now once we've assured that our system is completely up to date what we're going to do is find our local ip address so to do this all you're going to do is type the command ip space a enter and then it will display the information that you need the easiest way to pick it out is to find your actual network adapter that we selected during the installation process usually if you only have one it's the second one here and you go to the section that says inet and then your ip address should be right next to that mine is 192.168.0.60. and yours probably won't be exactly that but it might be fairly similar so from this point we've really done all we need to do when it comes to actually messing with the actual physical server and now at this point you could go ahead and actually leave that laptop or computer whatever you're using because we're going to go on to our primary machine and actually ssh into that server and now like i said in the introduction this is going to be through our local network so we can't really connect to it externally from a different network from our cell phone not on our wi-fi whatever granted there are ways to do that but that it requires additional layers of security port forwarding and things like that and we're not going to really get into that today so now that you do have the local ip address of that server let's go ahead go to our machine ssh into it and do some file transfers so now we are back on the computer that i want to do most of the work on the server from so what we're going to do is connect ssh to it and do everything else we need to do to set this up now i will have a link in the description to this page that you see right here this is on techhut.tv it has everything we've gone over so far from downloading and setting up to the ubuntu server the update commands getting into ssh and now here's where we're at you can see here i have all the commands that you're going to need easy copy paste good to go and since we're going to be doing this from the computer now we are actually going to be able to copy and paste all that so i'm going to go ahead and throw this over here and then let's go ahead and open up an instance of the terminal so right here what we're going to do is actually ssh into the server so then we can run commands from this terminal as if we're running it on the actual server and to do this you're going to want to make sure you have open ssh installed on your linux machine if you are running on windows you can do this a little bit differently i'm pretty sure in the powershell you could do the same ssh command and run it that way but i will have a link in the description for more details if you are running on a windows machine if you're running on linux you just type ssh and if you see something that looks like this that means we have openssh installed and we are good to go now the ssh into the server all you're going to want to do is type ssh and then the ip address and for this your local ip address of the machine so this is mine 68.0 hit enter and then you're going to get a message that looks like this the authenticity of the host the uip address cannot be established basically you know you just made it you know it's safe so we're going to go and hit yes and after you type yes it's going to give you a little bit warning we are now added to the list of known hosts and then we have this brandon at the ip address password so you're actually going to be typing in the password of your new ubuntu server so i'm going to type that in and now we are connected to the server as if we're on the terminal on the server that i have over there which is very very handy because then we could do things like easily downloading and installing plex without having to type all this in so what we're going to do is right now i'm pretty sure we're in our home directory we are so i'm just going to click copy and then paste this in just like that this is getting the actual plex server file that we're going to be installing hit enter it's going to go ahead and download it's not going to take too long at all next we're going to go ahead and get the dpkg command here to go ahead and install the dev package that we just downloaded so paste that in type in your password for the server oh there's a little error oh there we go that one worked so there was a little error i'm going to go ahead and correct it on the actual website so when you copy and paste it there will be no issues but you can see it's now unpacking and it has completely installed that debian package so now what we're going to do is enable and update the server so the very first thing we're going to do is run an enable command to actually enable the plex media server service so we're going to go ahead and paste that in there next is we're going to be starting the service so this is actually going to be firing up the plex server paste that in there and then we are going to go ahead and check the status of this so this should say active what it does it says active and running so plex is now completely running here go ahead and hit control c to get out of that and now what we're going to do is add the plex media server into the actual repositories so then that way when our ubuntu server runs an update or we just do the sudo apt update it will also pull an updated version of plex which by now probably this version of plex is completely out of date so this is an easy way to update it so you don't have to download and reinstall it so we're just going to go ahead and paste these commands in here add these to the repositories just like that and you can see that it has done this with no errors so now if we do the same sudo sudo apt update we are going to get results that there is one package that can be upgraded which is plex so now we're going to do the same thing sudo apt and this time upgrade oh not caps upgrade just like that yes and then it is going to go ahead download and install the latest version of plex so while that finishes up we could scroll down and what we're gonna do now is actually access our server files now we could go ahead and get a usb plug it in use the terminal to move files around but it's much easier to do this with an actual gui utility on your main system and to do that most file manager applications have this feature built in if i open up this file manager this is i believe nemo the file manager that comes stock with cinnamon it works in this it works in dolphin it works basically all of them all you need to do is connect to the server via sftp and if we go over here you can see that this is my example it's going to be sftp semicolon slash the username for me it's brandon at your local ip address for the server i'm just going to copy that and if i go ahead and paste this in right here hit enter it's going to ask me for my password that's the password of the server go ahead and type that in and now we are actually connected and managing the file system of the server on this computer as if the files are here but they're not and i can show you an example of this by going into our home directory the username and you can see this plex media server right here this is what we downloaded earlier if i go ahead and type ls plex media server both of these are on that server over there now you don't really need this so you could get rid of that if you want to this step is completely optional delete and then from here we can actually move media into our actual server so then we could begin streaming two devices all throughout our house or wherever you want so an example of this is i'm going to go to my home directory and i have a movie right here this is finding dory i'm going to go ahead ctrl c and you could get back to your server right here right there you see it's the sftp and the local ip and if we just paste that in it will begin transferring the file over our network and depending on your router it should be pretty quick now i will note plex likes you to organize your media a certain way and personally i like it to be within my home folder so what i'm going to do is create a new folder i'm going to call it media and within this media folder i'm going to make another new folder call it movies and i will make another one called tv shows so now i'm going to go ahead and move this movie into my media folder move it into movies and that is essentially how you move files from your computer to your server very very easily now one thing i'm going to show you real quick before you check out the plex web portal is something specific for laptops and that is making it so you can actually close the laptop lid and not have a suspend on you by default that is what's going to happen and chances are you don't want your laptop to be open all the time and when you close it the screen will turn off but not suspend and i'm going to show you how to do that real quick uh on here if you scroll down we actually have everything you need to know right here this is the ssh terminal for our server and what we're going to do is actually that's wrong i do need to make a couple corrections in here but we're going to go ahead and copy this paste it in and change this to a d so we're gonna go sudo nano etc into the system d folder we're gonna do a configuration edit for the login settings if we go ahead and hit enter there we have our systemd login configuration here and what we're going to want to do is scroll on down to the handle suspend key the handle lid switch and the handle lid switch docked and we're going to want to uncomment all these all these little hashtag or number simpler symbols are the comments so we're just going to want to get rid of those go down to the lid switch undo that and then go to the lid switch dock undo that and we're going to want to change these suspends to ick nor just like that and then after we go ahead and save this so we're going to go ctrl o to write out the file x and then we're going to just reset or reload systemd so go ahead and type in sudo paste in this command and this is just going to restart system md reload that configuration file hit enter and then we should be good to go next time you close your laptop lid it should keep the server up and going so now with all of that done we can actually go ahead and access our plex server through the internet and i'm going to do this with a different web browser so it's a completely new process so i'm going to go ahead and open up chrome here and the actual web address we're going to want to go to is just http semicolon forward slash forward slash your local ip for the server and then the port is going to be three two four zero zero slash web hit enter and then it's going to connect to the plex server it's going to give you a little thing on how it works just click got it and now it's going to offer you plex pass this is optional it's not needed whatsoever go ahead and close that out and we're going to set up our server you can name it whatever you want i'm just going to capitalize or i'm going to change it to media server just like this right here this is important allow me to access my media outside of my home this is awesome that plex does this because it uses their own services so it doesn't require you to add port forwarding or additional security stuff within your server it's all just handled with plex so then if you're at a friend's house or you want to share your data or your content with somebody you could go ahead and do that so click next and now we're going to add a library select your library type so i'm going to go ahead and select the movies library we just created so i'm going to go films and films i'm going to change it to movies and hit next and then browse for the media folder i like mine in my home directory so we're going to go brandon media and then you're going to want to select the directory the media is in for the category so this is movies and once you have the folder selected just hit add add a library then you go next and done and now we should be connected to our new plex server this is a bunch of plex crap i wouldn't worry too much about this if you go ahead and go under more you see movies right here and media server so this is my actual server you're going to want to go ahead and sign in to claim it and that's pretty simple just like any other sign up or sign in procedure you're going to want a plex account to go ahead and do this so i'm going to go ahead and create one real fast and click create account and we should be good to go go ahead and save that and now if i go under more go to my media server claim it now that it's claimed we could go back to plex click on claim server give it a little bit to do that and then we are good just for the record this is a throwaway email don't try to email it i won't be able to uh contact you um so now once it's actually claimed under this account we go over to plex go to our media server and now you can see we actually have access to our media here it's still syncing in a little bit it'll get all the proper metadata so we'll have the movie description and all that but that's really all there is to it but other than that i hope this video has helped you out there will be a link in the description down below so you can copy and paste all the commands like i mentioned earlier just to make your life a little bit easier i do hope you enjoyed this please subscribe for more content like this like i said i will be coming out with some more stuff regarding servers next cloud things like that so subscribe stay tuned for that content please like this video if you did give it a thumbs down if you absolutely hated it leave a comment with what your use case is when it comes to running a server in your home your home your home and any anything else you want me to cover stuff like that check me out on library i have all my content uploaded there as well other social media links will be in the description uh once again have a beautiful day and goodbye
Info
Channel: TechHut
Views: 52,427
Rating: undefined out of 5
Keywords: linux, linux tutorial, desktop enviorment, server, nas, home media server, content sharing, tutorial, ubuntu 20.04.1, linux server
Id: lXcfKTNObOo
Channel Id: undefined
Length: 25min 39sec (1539 seconds)
Published: Thu Jan 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.