Setting up your very own Cloud With Nextcloud on Linode

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] Exploud is one of my favorite open-source projects it's an awesome utility that you can host on the cloud that'll basically give you your own cloud you'll be able to edit documents store files synchronize files install all kinds of apps like basically a calendar contacts you name it it's just a really awesome piece of software that I highly recommend that you check out and in this video I'm going to show you the process of setting up your very own next cloud server on Linode now you don't have to use Linode because you could use whatever your current provider happens to be but I'll use Linode as an example and then I'll show you the process of going through the installation and we're basically going to install a database server installed next cloud itself configure the web server we're basically going to do all of it now there are simpler and quicker methods to installing next cloud that I'm going to avoid mainly because you know you could use the snap package which is actually pretty cool because it does all of that for you but the problem is when I checked it out it's actually very out of date so in this video I'm going to show you guys how to install the latest version as of the time I'm recording this video so let's go ahead and dive right in so here I am on the Linode dashboard and I created this instance right here cleverly named next cloud I created something with a little bit more horsepower this one has four gigabytes of RAM which you know I wanted something that's going to be a little bit more comfortable you could probably get away with next cloud on a smaller instance but I wanted to have a decent amount of RAM and storage which is kind of important with next cloud so on whatever platform you're going to create your instance whether it be Linode or VMware virtual box or whatever your provider happens to be you just want to make sure that you create it accordingly with the resources that you're going to need and I'm using Ubuntu 1804 LTS in this video so that's basically what you'll need to use to follow along with me but if you use something else then you might need to adjust the commands accordingly now if you are using Linode I've already gone through and created a video that shows you the process of setting up your very own Linode so if you haven't walked through the process of creating your own Linode instance yet you can go ahead and check out that video because I'm going to assume that you already have an instance available if I click on this instance right here for example we can see that I have my IP address right here I'm going to just click on this icon to copy it to the clipboard and if you don't already have an instance again I have a video that outlines that process but basically just go to create create a Linode then we're gonna show older instances and we're gonna use Ubuntu 1804 select a region closest to you so I guess I'll just use Toronto for example and then here is where you choose basically the type or size of Linode that you would like to create make sure you pay special attention to the prices there is a cost to run these servers if you use the URL that's on the screen right now then you'll be able to get a twenty dollar credit towards your very own instance so for example you could just go here to this instance $20 a month you can just go ahead and use that URL to have that taken care of for you but basically if you keep the instance past 30 days just know that you will be billed for it and if you create an instance that's above the twenty dollar credit you'll also be billed for that I personally think next cloud is worth paying for with that out of the way I'm here on my terminal I've already connected to that instance but basically what I did was I just use SSH route apt and then the IP address of the instance to create a user you simply do add user jeido for example put in a password for that user and I just press enter through all the screens and then you're going to do user mod a it's a lowercase a capital G the group is sudou and then your username that's the username you want to add to the suited group that gives your user access to make administrative changes but I've already done that on my end you can see here I'm logged in to my Linode instance and I'm good to go now the first thing you want to do before you install any application especially an application you're going to host that's going to be internet facing you're going to want to install all your security patches so you can do sudo apt update to make sure you have the mirrors updated here and then you do sudo apt dist upgrade just like that to install the latest updates and you can see that I have quite a few here again if you create a server on a public cloud platform like Linode it's internet-facing so you definitely want to have the latest packages so I'll press enter if you see a screen like this you can just left arrow to yes and press Enter and as you can see here we have the packages all updated and installed clear the screen and to do a little bit of cleanup I'll do sudo apt photo remove to remove any orphan packages and I'll press enter and now that's all set so in order to take advantage of the updated packages we do need to reboot the server but before we do that we just want to basically update the hostname now this step is absolutely not required you will have no issues whatsoever if you don't do this but I recommend that you do it because you know it just says localhost right here and if we are managing multiple servers we won't know which is which if they're all named that so there's two files that we want to edit so we're going to do sudo nano slash Etsy post name just like that and press Enter and here we can see the name of the server itself so I'm going to change it and we could type the name of our server here now I recommend that you get an actual domain name that also is optional but it's recommended I already have a domain name obviously learn Linux TV and I'm going to name my server the same thing or basically I'm going to use that domain name but I'm gonna use a sub domain so I'm gonna call mine Ben C dot learn Linux TV so basically just an abbreviation for next club just keeping it simple but it's NCN Linux TV you can name your server whatever you like you don't actually need a domain name like I mentioned you could call your server potato and I definitely won't judge you but whatever you want to call it just got a name is something you could just simply name it next cloud if you don't have a domain that's fine and even if you do have a domain it doesn't even have to match I just like to make everything match so again I'll change it back to NC dot learn Linux TV and save the file so with Nano it's ctrl o and then enter to save the file then ctrl X to exit out and then there's one more file we want to edit / Etsy / host press ENTER and we have localhost here we want to leave that we don't want to change it if we want to press ENTER underneath it and we'll do 127.0.0.1 tree here makes sure that the local host is basically resolvable to local host itself or the NCR Linux TV either one will work fine control oh and enter and then control X so now that we've updated the packages and we've also updated the host name we can reboot the server I'll just do sudo reboot now press ENTER so after some time the server should reboot should only take a few minutes you basically distress the up arrow you can SSH back into the server again if it doesn't let you in give it another minute and try again sometimes it takes a minute for it to come online let's go ahead and see if it's ready now looks like it and we are back at the actual instance right here we see NC in the name it does abbreviate the main domain if I do a hostname just like that we can see the actual host name the actual host name has been set so the next thing we want to do is actually download next cloud how do we get it so basically we're going to open a browser and we're going to navigate to next cloud comm slash install which should bring you to a page that looks similar or exactly to this we're gonna click download for server we're not going to click on it but we're gonna highlight over this download next cloud button and we're going to right-click and copy link address or whatever your equivalent is depending on what browser you're using so now that we have the URL we can use the double you get utility to download it and we simply paste the URL into our terminal and you can see here it's downloading next cloud 16 point 0.4 which will most likely be different by the time you see this video by the time it gets uploaded but the process should not change so I'll press ENTER and it's downloading next cloud to the server and you can see here here is next cloud so that's basically the zip file that contains everything we need to run the application itself but we need to setup a few services next cloud requires in order to run so let's go ahead and do that right now now first of all we're going to need to install Maria DB that's the database server so I'll do sudo apt install Maria DB server enter password and it's going to download the database server as long as as well as this prerequisites here so enter again so now the database server is installed we can check the status systemctl status maria DB you can see that it is active and running so next we need to basically set up the security for maria DB so we're gonna do sudo my sequel secure installation and yeah I know it's Maria DB and that my sequel but a lot of the commands are interchangeable so I'll press enter here and it says enter the current root password well we don't actually have one because we haven't yet set one so you'll just press enter for none because we don't have one set root password so the Y is capital so if we could press Y or just enter if we just press ENTER it accepts the default which is whichever one is capital so enter and we're going to set a bruit password here re-enter it remove anonymous users enter for the default of yes disallow root log in remotely absolutely there's never a reason to have a public-facing database server so definitely enter for yes remove test database and access to it yes enter again and reload privilege tables yes enter and that's basically it we set the root password for the database server here you do want to make a note of that so that way you know you don't forget it because you know it's really hard to break back into a database server if you forget the password hopefully you set it to something really secure so I'll clear the screen so here at the terminal we want to connect to the Maria DB shell so we're going to do sudo Maria DB that'll just get us right into the database servers root press enter and you can see that our command prompt has changed to Maria DB so we're able now to set up our database so to create our database we're going to use this command create database next cloud and we're going to end it with a semicolon now create databases in caps it doesn't need to be it's just considered proper syntax to put sequel instructions in all caps but that's not required but that's what we're going to do here and then the database name is simply going to be next cloud I'll press ENTER and then we could do show databases to ensure that the database itself has been created and we can see that it has clear the screen so next what we're going to do is create a new user account and this user account is actually specific to the database this is the user account that next cloud will use to authorize into the database to allow it to make changes now I'm going to go ahead and paste the command in because I'm too lazy to type it all out but I'll walk you through this basically we're going to grant all privileges on next cloud dot asterisk which means basically the next cloud database and pretty much everything underneath it we're gonna grant those permissions to a user by the name of next cloud that's going to be located at localhost identified by and then the password my password for this you want to definitely use something more secure than what I'm using since this is a test instance I don't really care because I'm going to be deleting this instance as soon as I'm done recording but for you I do recommend that you use a randomly generated password and you put that in the quotes here pay special attention to if your password that you're generating has quotes in it which is going to confuse it just keep that in mind and make sure you keep track of that password though because we're actually going to need it here in a minute so press ENTER and it basically says query okay so that means that the next cloud user was created and given permission to the entire database next what we're going to do is flush privileges which is just basically going to synchronize all the user access which is a good idea since we just created a user enter and after that we can hold ctrl and press D to disconnect from the Morea DB shell so now we have a database server we also need a web server because next cloud is completely useless without a web server to serve it so what I'm going to do right now is show you which packages you'll need to install in order to satisfy that requirement so next we're going to install some required packages for PHP I'll go ahead and paste them in here right now and then you can go ahead and pause the screen if you need to I'll also have these instructions on the wiki page as well so if you want to copy and paste the command from there you may and they're going to notice that these are all PHP packages and we're not actually installing the web server yet but I'm going to go ahead and press ENTER so you'll see that Apache is actually listed as one of the packages that will be installed it's being installed as a prerequisite you want to make sure that it shows up in the list here if it does not you'll want to also install that as well along with all the other packages so I'll press ENTER to go ahead and install these stall so to make sure everything is good we're going to do systemctl status apache2 we see that it is running shows that right here we also show that it's enabled that means that Apache will start when the server reboots that's important so we want to make sure that that's the case if it's not you could do sudo systemctl enable Apache to to make sure that it comes on when the server reboots and you can also do start Apache - to make sure that it starts we want to do the same thing with Maria DB it's active running and it's also enabled we can also use the same system CTL command so sudo systemctl start maria DB or enable you can change start to enable same thing there just basically want to make sure both of those are running and that they are enabled now what I recommend you do at this point is sudo systemctl restart apache - you probably don't need to do that but we did install apache - along with a lot of these PHP packages it's always possible that you know Apache might not have been started with support for PHP I highly doubt that but just to be on the safe side you can go ahead and press ENTER and that'll restart that service now we have next cloud downloaded right here 16-point 0.4 dip your version number might be different we need to unzip this first we will use unzip next cloud or whatever the package name is this is going to fail in my case because unzip is not installed that can be installed by default depending on your image but if the if you see this error like I see right here you just do sudo apt install unzip and it's going to install that for us you could do which unzip and we could see that unzip is now an option so now if I recall the unzip command it should work this time it's gonna basically explode it into a bunch of files we see we have an X cloud directory here and what we're gonna do is rename it now this is a little bit different than many other articles and how to's will have you do it this is just a personal preference but I think this makes sense especially if you plan on hosting other sites on this instance we're gonna move that file and change the name of it and I always change the directory to be named after the domain so I'll do NC dot learn Linux TV you can see we have that directory right here so now what we're going to do is change the ownership of that directory so we're going to do su do CH own and the user we want to now own it is going to be W W data : w W data so that's a user and group of the same name we also want to add the - R option here so it's recursive we're gonna change the ownership to that directory right there and if we check the listing of storage here we can see that it's owned by w WD to user and group which is required for the web server to have the appropriate access to that directory now we still have the next cloud zip file so you could actually just remove it if you want I don't really think it hurts to keep it around if you need to reinstall it for whatever reason but that's up to you I'm not going to remove it but what I am gonna do is do sudo MV for move and I'm going to move this directory to slash var slash W W now if I list the storage of that directory we can see that we have that directory right there I'll clear the screen now one thing we can do is make sure that Apache itself is working first and to do that we can open a browser and then we can paste the IP address of our server right here and you can see we're getting an Apache to default page so Apache is working which is basically required for the next up to work we're going to change this but this is just basically the sample page back to the terminal let's take a look at slash let's see Apache two sites enabled and we see this default configuration file right here that's the default site we're not going to be using that anymore so we'll use sudo a two-disc site which stands for apache to disable site and we're going to disable the zero zero zero default conf and it's telling us we need to reload Apache so let's do that okay so what we're gonna do now we do LS dash L / SC Apache two sites enabled we see that there are no sites enabled right now what we're gonna want to do though is create a new configuration file for Apache this will be the configuration file for next cloud itself so we're gonna do sudo nano slash Etsy Apache two sites available NC learn Linux dot TV conf or whatever you called your domain you'll just name yours accordingly but I'll press ENTER and this is a blank file we're creating a brand new configuration file for Apache so what I'm gonna do is paste the content in here and you're going to want to adapt this file for your domain you'll notice that I have this domain in here several times in fact you'll see that the NCN Linux TV is listed in this file five times so you need to change five occurrences of that domain to match whatever yours happens to be you'll also need to make sure that these paths line up to whatever path you saved your content and if you did something different than me you'll see that I basically created this NCN Linux TV I created it under slash var slash www which you know a lot of people will go under the HTML directory I don't do that I just like to have dedicated folders for each site especially I'm going to host multiple sites on one server but basically take a minute to take a look at this and again it's going to be in the wiki article which will be linked in the show notes below if you want to copy this example into your text editor to change it before you paste it so I'll save it and then exit out now we're gonna need to restart Apache to take advantage of this new configuration and we're also going to need to enable this configuration as well but I'm not going to do that yet there's one more thing we should do so here I'm on my account on hover which is my DNS provider so I recommend that you go to the console of whatever your DNS provider happens to be you don't absolutely need this but it's just it just makes it that much easier and what you want to do is add a record specifically an a record pointing to the IP address of your instance so I'll click over here to add an a record the host name is going to be NC because it's NC learn Linux TV in my case so that's basically the sub domain you put there and then here you'll put the IP address of your Leno to instance or whatever your provider might happen to be they gave you an IP address you'll paste that in there and then you'll add the record it can take some time for that DNS record to propagate everywhere so it may or may not be resolvable right away but what you could do to check is just open a new terminal I'll blow up the text size here and I'm gonna do nslookup UNC learn Linux TV and press enter you can see in my case that it is already resolvable so hover is pretty quick they are my favorite DNS provider they are not a sponsor I just actually happened to like them but you know if anyone from hover wants to become a sponsor let me know I'm kidding but or a my hover is great seriously so if you don't have a DNS provider the a good one you could get their domain your domain from them and then you can go ahead and set up your sub domain as well all in one place they don't offer hosting but that doesn't matter because you can use Linode or another VPS provider to provide the hosting so you don't actually need them for that but they are a really good provider for DNS so you can see here that I was able to get that IP address associated with my sub domain NCN Linux TV so you just basically want to make that happen for your domain back here at the terminal we're going to want to enable the site so we'll do sudo a 2n site it will do NC we can usually tab complete so there's the configuration file a press Enter we could run this command right here to reload Apache to basically make sure that this change takes effect I'm not going to do that yet I'm going to clear the screen first now we'll need to configure PHP to ensure that it's set up properly so we're gonna do this right here sudo nano / Etsy PHP and so on basically it's a PHP dot ini file we need to edit that file to ensure that PHP is configured properly so I'll press ENTER now I have a list of all the edits that need to be made in the wiki article but to save some time we could use to control W which allows us to search the first one we want to search for is memory on the score limit let's enter we're gonna change this to 512 megabytes should have more than enough RAM on our instance for this next we need to configure the upload max file size well do search for upload should be able to just search for upload underscore max should take us right to it there it is so this is just the biggest possible file that you could upload to your instance we could just change it to say 200 is fine but if you plan on uploading files larger than that of course you need to adjust that accordingly next search for max execution time but we could just simply search for that to find it and there it is we're going to change that to 360 next control W again we'll search for post max change that to 200 is to say date time zone we're gonna uncomment this if you don't know what your time zone values could be you can go to this URL but I'll show you mine for example it's America / Detroit again you can get yours from there we're gonna do ctrl o and then enter and then we're gonna exit so now we need to enable several Apache plugins actually six in total so again you can get these commands from the wiki article but I'm just going to go ahead and go through them feel free to pause the video as necessary if I go too fast so first we're going to do sudo a to n mod that's the command you can use to enable a Apache extension also known as a module we're going to enable rewrite and press Enter we're going to ignore the verbage for restarting Apache for now and we're going to go ahead and enable the next mod and the next one is called headers and an v for environment which in my case is already enabled so that's fine enabled ur also already enabled mime again already enabled but we just want to make sure and we also want to enable SSL as well clear the screen and then we will this time restart Apache there we go so now we're gonna see if next cloud actually works we're not going to configure it just yet there's one more thing we have to do but we do want to see if we are successful so far so I'll switch to a browser and here we are from the previous page this is the default page but what we want to do is back out the IP address here and type in our domain name so let's see if that works and press ENTER and it looks good to me but there's one problem it's not secure so we're not going to go through and set this up just yet we want to take care of this right here and make sure that we have everything's secure we don't want to see something that says not secure we want to secure our site and we're going to use let's encrypt to accomplish that so first of all we want to install the required packages for cert bot which is what let's encrypt users now cert bot is available in the aboon two repositories last I checked but we don't want to install that version we want to actually install the PPA so I'll paste in the command to do that which you see right here I'll press ENTER and it just basically wants me to confirm press ENTER to continue so I'll do that all right so the repository is installed to confirm that we'll do LS let's see apt sources list D we could see that the cert bot list file is there and if you're curious I'll show you the contents of that file which is basically just the URL to that repository now cert bought the package is available in a boon to proper and the reason why we want this repository to override Ubuntu's version is because this version will be more up-to-date that's extremely important we don't want to fall back on a boon to version we want it straight from this PPA repository so next we can install the actual cert bot package itself which is going to be this command right here go ahead and pause the screen if you need to I'll press Enter gonna be a handful of dependencies here so we'll go ahead and let all of those install and there we go so now we can actually get an ssl certificate for our site I'll paste in the command to do that which is this one right here you'll need to adjust for your domain accordingly and this domain absolutely must resolve if it doesn't and your DNS hasn't fully propagated then this will fail you basically want to make sure all steps up to now have completed successfully I know mine has so I'll press enter it wants me to enter an email address which I will go ahead and enter in right now and this is just a test instant instance that I'm going to be blowing away so I'm not actually going to put in a real email but you really should though because if you have any problems with this renewing they will send you a notice and that's extremely important to keep on top of otherwise your site might break so you definitely do want to put in a real email address here and I will do a for agree and I'll say no I'm not willing to share my email address then you know that's just a test email so don't want to confuse them so I'll press ENTER for no so it looks like that was successful and we need to choose whether or not to redirect non SSL to SSL I recommend that you do actually do that it's option number two for redirect I'll put in number two right here and press Enter we should be good to go let's see so here we have the next cloud site in my browser it's not secure so if i refresh the page it actually should be secure so let's see what happens and we have the padlock icon right here and it tells me that my connection is secure and that's awesome so here I'm going to create an admin account so I'll just use my first name here and I don't care that the password is weak since I'm going to be deleting this shortly but in your case if you plan on keeping this around you really should make sure that you have a very strong password here because believe me people will definitely be trying to crack it now we have an option for data folder that defaults to go ahead and arrow over here so underneath the main parent directory is defaulting over to data now if you have a secondary volume like block storage or a mounted hard drive or something like that you'll want to change this to that folder I'm gonna leave this as default but you basically want to make sure that ww - data the user we changed ownership before has access to that directory I'm going to leave that one alone scrolling down here database user we used next cloud for a password I used my password hopefully you used something a lot more secure than that and the database name was simply next cloud and then just double-check all of these settings and ensure that everything is perfect and then click finish setup and the suspense is building and would you look at that we have a successful next cloud installation how awesome is that so we get this little handy notice right here looks like some kind of information it's been a while since I've seen it I actually haven't seen this version yet but it's given us some information and now we have our actual next cloud installation so we can configure that and we can install apps as well so I'll go over here to apps let's check out some of the applications that are available to us so we have a PDF viewer for example draw IO integration which is awesome I actually do use that site for diagram so that's pretty cool we can enable end-to-end encryption but that's untested there's an e-book reader so if you have a lot of ebooks that could be something that would benefit you as well and then we have extract plugins we have let's see office and text we have office integration that we can add all kinds of cool stuff so definitely check this out there's all kinds of things that you can enable and if you want to create users just go up here to users you want to create a new person here just click on new user jeido and I'll just go ahead and put in the user password and go ahead and select that and we successfully created a new user so we could add friends family coworkers whatever it is you're using this for you could add your users accordingly so there you go guys that was my walkthrough for installing next cloud on Linode or whatever your hosting provider happens to be next cloud is an amazing piece of software I absolutely love it I highly recommend that you check it out you could even sync your phone calendar and contacts to it to basically have your open source cloud for a lot of the same purposes that you would use proprietary solutions for so there you go I hope that was helpful for you guys go ahead and leave some comments down below on what you plan on use your next cloud server for and then I'll go ahead and get started on creating more tutorials for you guys so stay tuned and I will have those uploaded very soon thanks for checking out my video I really appreciate it if you found it useful click that like button and if you haven't already done so make sure you subscribe so you'll see the latest content as soon as it becomes available if you want to help me out there's links down below for my patreon page as well as links for purchasing my Linux ebooks and also my affiliate store which has a listing of linux compatible hardware that i've actually tested personally thanks again for watching and i'll see you in the next video
Info
Channel: Learn Linux TV
Views: 27,775
Rating: undefined out of 5
Keywords: LearnLinux, Linux, Tutorial, Howto, Guide, Distro, Learn Linux, open-source, gnu/linux, linux tutorial, how to, private cloud, nextcloud server, install nextcloud, gnu linux, cloud storage tutorial, nextcloud server setup, nextcloud server build, nextcloud server install, install nextcloud on ubuntu 18.04, install nextcloud on ubuntu server, ubuntu, linode, gnu linux tutorial, nextcloud, vps, linode tutorial, linode server setup, linode vps, nextcloud setup, nextcloud tutorial, vps free
Id: EbD1hFzJtls
Channel Id: undefined
Length: 38min 28sec (2308 seconds)
Published: Mon Sep 30 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.