Build an Awesome Nextcloud Server (Updated for Ubuntu 22.04!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi my name is frank kalicek and i'm the founder and ceo of nextcloud and yeah everybody should use it and it's time for to install nexload now [Music] hello again everyone and welcome back to learn linux tv in today's video what we're going to do is set up a brand new next cloud instance on ubuntu 2204. now i know what you're thinking you're probably thinking why is jay going over next cloud setup again when he literally just did a video about this same thing and if that's what you're thinking well i agree with you you're right the thing is i don't always make the best of decisions when i did the last video ubuntu 2204 was right around the corner and there's also a new major version of nexcloud also right around the corner so yeah i probably should have waited a few months until the newer versions of ubuntu and next cloud came out before i did that video but again i don't always make the best of decisions but it is what it is in this video it's going to be the exact same thing again but this video is updated for ubuntu 2204 i'll be showing you the entire process of setting up next cloud in ubuntu in this video and by the end of this video you will have your very own installation of nexcloud running on ubuntu 2204 and it's going to be awesome anyway i'm really excited to show you guys the process of setting up next cloud so let's dive in so in order to get started we need a linux instance specifically an ubuntu 2204 instance i'm going to show you guys the process on lenode but you don't have to use lenode my process for installing nexcloud doesn't depend on any particular cloud provider or any cloud provider for that matter you could actually just run through all of these steps on a physical server and it's going to work just fine the node is a sponsor of this channel but they didn't actually sponsor this video in particular but like i've said before i use lenode quite heavily so i have the account i may as well use it on your end you just need an ubuntu 2204 instance it doesn't matter where you have that instance that should be all you need now if you want to use a physical server or maybe your own virtualization solution then you can go ahead and install ubuntu 2204 i have a video on my channel that goes over the process of installing ubuntu 2204 it's already on my channel i'll leave a card for that right about here and that'll give you a walkthrough of the process for installing ubuntu 2204 if you don't have an installation already now if you are tempted to use a different distribution then i can't guarantee that these steps will work the process has actually changed from ubuntu 2004 so if you're using a different distribution then you're probably going to run into trouble if you use the commands that i'm going to show you so if you're using a different distribution i'm going to leave it up to you to adjust the commands accordingly now if you are actually using ubuntu 2004 you should check out the previous video because that video does show the steps on ubuntu 2004 again we're going to go with ubuntu 2204 in this video so i'm going to begin the process but if you already have an ubuntu 204 installation you can skip this section and move on to the next so anyway again i'm going to choose ubuntu 2204 so i'll scroll down and here it is for the region it doesn't really matter which one you choose just choose whichever one is closer to you geographically i think new jersey is one of the closer ones to me but again just choose whichever one makes sense for you and scrolling down i'm going to click on the shared cpu tab and if you are creating this on a cloud server then you probably want at least two gigs of ram so i would say this one right here if you're using lenode is probably a comfortable minimum but i'll actually go with the 4 gig version it gives me 80 gigs of storage which i think is going to be pretty important when i start to actually copy files to this instance anyway continuing right here what we'll do is give our instance a label and what i'll do is call it nextcloud dot learn linux.cloud and if this name looks like a domain then you're right i'm actually using a real domain for this instance you don't have to have a domain but if you do happen to have a domain and it makes sense to use that domain you could create a subdomain right here and then you can simply point the a record to the ip address of your instance if that's something that you'd like to do i'll show you that process later in the video but if you're not going to use the domain then you don't have to worry about that part i'm going to skip over tags let's create a secure root password and that should do it for me if you have an ssh key you can go ahead and use that if you'd like i'm going to keep it simple this time backups are a great idea if this is something that you'd like to use in production but i'll leave that up to you it gives you the total extra monthly charge if you're using lenode so that way you'll know what the total cost is going to be i'm going to leave that unchecked in my case this is just a test instance and i'll click create lenode now at this point our instance is being created we also have the ip address for instance right here so if you do have a domain then what i recommend you do is copy this ip address right here and then set the a record for the sub domain in my case next cloud to the ip address that you are being provided by lenod for your instance or whatever ip address you happen to have so off camera what i'm going to do right now is actually associate this ip with my domain and hopefully by the time we get to the end of the video it'll already be propagated i guess we'll see but that's just how it goes anyway in my case the instance that i intend to use is all set and ready to go so what i'll do is switch over to a terminal and we'll get started and i'll use ssh to go ahead and connect to that instance i'll use the username of root that's the default username that you are provided on lenode at least if you are setting up ubuntu from scratch then you already know what your username is because that's part of the process anyway i'll paste in the ip address right here and there it is so let's connect and now i'm in so at this point we have an ubuntu 2204 instance it's ready to go and we can begin the process of setting up next cloud and that's exactly what we're going to do in the next section in this section what we're going to do is take care of a few odds and ends when it comes to our ubuntu 2204 installation just to make sure that we have it set up properly and nothing in this particular section other than maybe the hostname or domain name actually pertains to nextcloud there's just some things that you should always do when you set up a linux server and this one is no exception specifically what we're going to do in this section is we're going to create a local user for ourselves we're going to install all of the updates and then we're also going to change the hostname of our instance as well again none of those things are specific to nextcloud in any way but there are definitely things that we'll want to make sure that we do now first of all i'm logged in as root if you set up ubuntu manually like maybe on a physical server or in your own virtualization solution then you might be logged in as a normal non-root user already if that's the case then you can skip this part where i'm creating a local user for myself because well in that case you'd already have one but if you're like me and you are using a cloud provider and the cloud provider defaults to root then you should definitely continue and create your local user account so to create a new user what i'm going to do is run add user and i'm going to create my user as jay so that should be simple enough next i'll set my password and i'll confirm the password and then it's going to ask me some additional information for my user account now all of these fields right here are optional so i'll just press enter to skip each of these make it that much quicker then i'll press enter to confirm y is capital anytime you see y is capital that's the default pressing enter selects the default so you don't actually have to press y here and now we're back at the command prompt next what we'll do is make sure that our local user has access to sudo and there's different ways that you can set this up but i'm just going to use the user mod command so user mod dash lowercase a uppercase g and then you type the name of the group that you want to add your user to which in our case that group is going to be the sudo group and then you type the username for the user that you want to add to that group which is going to be the one that we've just created and then i'll press enter and that should be all there is to it so what i'm going to do is disconnect from the root session that i have here and i'm going to reconnect but i will use my actual username instead of root and now i'm in so what we're going to do next is install all available updates many updates actually include very important security updates which is especially important when we're running nexcloud we wouldn't want someone to break in and ruin it for us so i'd say that installing updates is the least we could do and to kick off that process i'll run sudo apt update i'll type in my super secret password and here we go and this process right here just refreshed the index it doesn't actually install updates it's telling us at the bottom that we have 27 packages that can be upgraded so now that we've refreshed everything let's go ahead and install those updates and to do that we'll run sudo apt and then dist hyphen upgrade i'll press enter and there we have a list of updates that will be installed so i'll press enter to confirm that i do indeed want to proceed now they're installing now we're going to be restarting our entire server in not too long anyway so i'm not really worried about this particular screen it's just asking us which services are okay to restart so i'll just press tab without choosing anything at all that'll put me over to ok and then i'll press enter and now the process of installing updates is complete the next thing that we're going to correct here is the host name currently the bash prompt is showing localhost which might be okay if you only have one server and you might only intend to ever have one server but if you're like me and you plan on setting up other servers it's a great idea to name them so that way you know which one you're connected to so what you'll do on your end is just come up with a name for your server if you have a domain and that's easy the name of your server in that case is well your domain but on your end you could just call it next cloud if you don't have a domain that's fine but to start the process the first file that we'll edit is going to be etsy hostname and that's literally the file that includes your host name right now in my case it's set to localhost so let's clear that out and what i'll do is type the entire fully qualified domain name for this instance which in my case is going to be nextcloud.learnlinux.cloud so i'm using the nano text editor and to save this file and nano what you do is you hold ctrl and press o and then enter and then you hold ctrl and press x text it out now let's go ahead and update the second of two files and that file is slash etsy slash host now more than likely you'll have a line that has the ip address a loopback address of 127.0.0.1 so what i'm going to do is just leave that line alone i'll add another blank line and then i'll type in another loopback address 127.0.1.1 and then what we'll do is type the fully qualified domain name if you have one or just next cloud if you don't so here i have my domain name another thing that i like to do is type the shortened version of that as well which is just going to be next cloud adding next cloud to the end here that means if i ping the shortened version it's also going to ping localhost as well and yes there's more reasons why this matters than just that it's not like we ping all that often but it's a good idea so anyway i'll save the file ctrl o again and then ctrl x to exit out but we went ahead and updated both of these files so our host name our domain name whichever one we have is now set so let's go ahead and reboot the instance so i'll type sudo reboot and we'll give it a moment to come back up so i think enough time has actually passed to where the instance should be available but i'm going to connect to it a little bit differently than i did last time before i just used ssh against the ip address and that's perfectly fine especially if you don't have a domain but since i do have a domain i'm going to attempt to use that domain it may or may not be fully propagated yet but let's go ahead and see if it works so i'll type it out nextcloud.learnlinux.cloud and then i'll press enter so far so good actually and here it's actually showing me that i had a different instance of that same name i've been using that same instance name with a number of tutorials that i've done from this computer so we'll ignore that for now i'll just type yes and that's what you'll do as well if you've been testing this a number of times you might actually see a message like this so i'll confirm and then i'll type my super secret password and now i'm in now there's one more thing that we should do with the domain name if you have a domain name and this is also specific to lenode so you can skip this particular section if you are not running on lenode or if you don't have a domain name this is only for those of you that are using both so what i'm going to do here inside my web browser is i will click on network and then what i'll do is edit rdns reverse dns so i'll click on that and even though i was able to connect to the instance with its domain name that domain name is something that i set literally 15 minutes ago it may not be propagated just yet but let's go ahead and see if we can set this we'll set it to the same domain name that we set it to everywhere else so nextcloud.learnlinux.cloud in my case at least i'll click save let's see if it works and it did you can see the reverse dns name right here and the reason why i was skeptical when it comes to whether or not it was going to let me use that name is because what i found is that if that name hasn't actually propagated to the correct place then lenode won't let you choose that it'll validate it show that it's incorrect and then give you an error message but when the dns name propagates fully then it's going to let you do it in my case it actually let me do it so we're good with reverse dns now before we go back to the terminal let's open up a new tab and what we want to do is find the download url for next cloud so let's go to nextcloud.com that's the official website for the project and then we'll click get next cloud and then we'll go down here to next cloud server we want to self-host this that's the one we want we'll scroll down yet again and we're looking for the archive file option and right here it is so we'll drop that down and by the way this website could change at any time but essentially what you're looking for is a download option for self-hosting next cloud if we hover over this we can see the url at the bottom left-hand corner of the screen but we're not going to click on this instead we're going to right click on it and we're going to copy the link which is going to copy the url so i shouldn't need this particular page anymore anyway back here what i'm going to do is see if we have wget we're going to need that and i do now if for some reason you don't you could run sudo apt install and then wget but i won't run that because i already have it let's go ahead and download next cloud i'll type wget i'll paste in the url now as of the time i'm recording this video this url is extremely predictable no matter what version nextcloud has it's just going to be latest.zip i hope they don't change this i like this a lot but you never know if the name or path does change in the future you can just grab that from the site anyway i'll press enter now it's downloading and actually it's already done you can see the zip file is right there so so far so good now we're not actually going to do anything with the zip file just yet so we'll just put that aside for now and we'll return to that all right so in this section what we're going to do is set up the database for next cloud the first thing that we're going to need is a database engine or server and the one that i use is mariadb so that's what i'm going to show you guys in this video we'll need to install that so what i'll do is run sudo apt install and then mariadb hyphen server press enter and there's going to be a bunch of dependencies that will be installed as well that's fine i'll just press enter and it's already done so now we have mariadb it's installed and it's ready to go well at least i think it's ready to go to verify that we can check the status and make sure that it's running by issuing this command right here sudo systemctl status and then mariadb in my case it shows active and running so we're good to go and that's exactly what you should have on your end as well you shouldn't have to actually start mariadb or enable it but if you show it as disabled instead of enabled then in that case you might have to enable it i haven't actually seen that come up on ubuntu but i'm just giving you that information just in case more specifically if the status was not running or enabled what you could do is run sudo systemctl start mariadb it'll start the process and if it's not enabled and you could use the keyword enable to facilitate that but on my end it's fine it's ready to go now the next thing that we should do is add some default security to mariadb the command that i'm about to run will ask me some questions and make my database server more secure it's not going to make it bulletproof though and it's only giving us a minimum level of security but it's some security that we definitely want nonetheless so i'll run sudo and then my sequel even though it's mariadb for this i'm typing my sql underscore secure underscore installation press enter it's asking me for the current root password now if you actually have the root account enabled the linux user account root enabled and it's not actually asking for that password it's asking for the root my sequel user specifically which is a completely different account now we've never set a password for that user before so what we'll do here is we'll just press enter to accept the default for none because well there's no password and now it's giving us an option to switch to unix socket authentication i'm going to say no for this i'd rather use standard authentication so n and then enter change the root password well i don't even have a root password so i'll just go ahead and press enter for yes which is the default here and then i'll set the password for root i'm just going to use a sample password on my end just for this tutorial but on your end you definitely want to use something that's randomly generated anyway i'll go ahead and type that in and then i'll confirm it and now that part set remove anonymous users yup we definitely want to do that so i'll press enter disallow root log in remotely yes absolutely remove the test database and access to it absolutely i'll press enter and then reload the privilege tables well what that's going to do is make sure that the changes are going to take effect so yeah we definitely want to do that and that's it for the mysql secure installation script again it's not going to make us bulletproof but it's better to have that default security than not to have it so everything that we've done in this section up to now was for installing and configuring mariadb but the goal is to set up a database for next cloud itself so let's go ahead and do that and to do that we'll need access to the mariadb prompt and the fastest way to do that is to type sudo and then mariadb just like that and as you can see we have the mariadb prompt to create the database what we'll do is type create database and it's typical to type sql commands in all caps you don't have to do that but it is standard practice next cloud is the name of the database so that does not have to be in caps and then we'll end the statement with a semicolon i'll press enter and it says query ok and that should mean that the database has been created so let's verify that we'll type show databases and we can see that the next cloud database is listed right here it's the third line down and it's okay that there's other databases here there's some default databases we'll ignore those next cloud is the database that we wanted to create and now it is created so we have the database but what we don't have is the ability for anything to access that database because we need to give permissions or create a grant that will allow access to that database so what i'll do is paste in the command right here that we can use to create that grant but don't press enter just yet so right here where i have my password we're going to back all of that out and what you'll do is type in a very good password right here now this is just a test instance so i will be deleting this after i'm done recording this so i really don't care how good of a password i have because this instance just won't exist for very much longer on your end i recommend that you create a randomly generated password especially if you plan to use this next cloud instance in production but on my end i'll create something very long but also not as hard to type in so again on your end definitely consider a randomly generated password so i have a very ridiculous password here i figure that this will be hard to guess well actually it won't be hard to guess because well you guys are seeing what my password is another thing that you never want to do in the real world but i just wanted something that you know is fairly easy to reproduce for this tutorial and i'm just going to use this password right here which contains a bunch of things that i happen to like personally so i'll press enter and that actually creates the grant that will allow access to the next cloud database to finalize everything i'll type flush privileges and that should be all there is to it when it comes to setting up a database or next cloud so i'll hold ctrl and press d to disconnect from the mariadb shell and now i'm back to my normal command prompt so we should be all set when it comes to that and in the next section what we're going to do is set up apache apache is a web server and it's the web server that's going to serve next cloud and we'll take care of that in the next section okay so in this section what we're going to do is set up apache but in order to set it up what we'll need to do is install it and this is a relatively long command here so i'm simply going to paste it in now i mentioned that i'm going to be having you guys install apache but what's interesting is that apache isn't one of these packages here these are all php packages well take my word for it this is actually the command that we'll need so you could grab this command from the blog post that accompanies this particular video again the link is in the description it's a lot easier to copy that particular command than it is to type all of this out if you're a clutch like me then you'll probably just create a typo or two anyway so go ahead and copy it paste it in right here and then we'll continue now there's going to be a bunch of dependencies here as you can see but notice that the very first dependency is going to be apache 2 and that's the correct package for apache i didn't ask for that package but i knew that i didn't need to because i knew the apache package was a dependency of one of the others i know and just make sure that apache 2 is listed here among the others if this changes in the future and apache 2 is not listed then in that case you could just run sudo apt-install apache 2 to facilitate that you shouldn't need to do that though because the packages that i'm having you install right here they actually depend on apache anyway so i'll press enter and now those packages are installed and let's check the status of apache just to make sure that everything's okay so what we'll do is run systemctl we want to check the status and what we want to do is check the status of apache 2 and it's active and running so according to this we should be good to go there's more configuration that we'll need to do with apache but for right now we actually have a real web server and if you don't believe me i'm going to switch over to my web browser at this time and we'll be able to see that apache is publicly available so what i'm going to do is just simply open up a new tab and i'm going to type the domain or my particular instance xcloud.learnlinux.cloud and you can just type in the ip address if you don't have a domain name that works too and as you can see here we have the apache 2 default page which tells us that apache is reachable from the public internet that's a good sign so back here in the terminal we can go ahead and continue we also want to make sure that we've enabled these modules right here so you can go ahead and grab this command from the blog post and paste it in so i'll press enter and it's telling me that i need to restart apache so let's do that next there's a few php mods that are recommended you don't actually need all of these but i find that next cloud will complain if any of these aren't enabled so i've pasted in the command right here one or possibly all of these mods right here will probably already be enabled but we want to make sure of that so we will run the php and mod command which enables modules for php and i have a number of those modules right here that i want to make sure are enabled so i'll press enter and it let me do it sometimes i get a response that all of these mods are already enabled and that must not have been the case because i received no output at all so we should be good to go now do you remember that zip file that we downloaded earlier the next cloud zip file i mentioned then that we were going to return to that and actually that's what we're going to do right now and there's the zip file in question what we'll need to do now is unzip that file but in order to do that we will need the unzip command and unfortunately i don't have it if i did then the command which unzip would have showed us the path to the unzip binary since it didn't do that that means that we don't have unzip on the system as you can see the command is not recognized but it gives us the install command right there so all we have to do is just run that command sudo apt install unzip and it's literally that simple i'll press enter and now it's installed so again we have that zip file right there so what i'll do is run unzip and i will run it against that zip file and once i press enter there's going to be an explosion of text all over the screen which is kind of cool actually i don't know about you let me know in the comments down below if you're like me and you just love a bunch of text flying all over the screen i really don't understand why it's not like you could read it it goes by too fast i think it just looks really cool anyway i'll press enter and it blew up all of the files from the zip file so now we have the next cloud directory that was inside the zip file and at this point we don't need the zip file anymore you could choose to keep it if you think you might need it in the future but i don't need it so i'll just go ahead and remove it and now we only have the next cloud directory and the next step is optional if you have a domain then i recommend you do this you don't have to do this i'm a big fan of consistency so what i'm going to do is actually rename the next cloud directory and i'll rename that to nextcloud.learnlinux dot cloud again this really doesn't matter you don't have to do this but i like to do this when i have a document root directory that has multiple sites i think it just looks better to have all of the site directories named after their respective domains so i've renamed it and we have it right there but actually but another thing that we need to do here is correct the permissions for next cloud right now it's owned as my user and i don't want that to be the case my user is not going to be the user that's going to be serving this content so what we'll do is change the ownership of this directory such that the user that will be serving it owns everything inside of it so let's run sudo and then ch own we would like the www hyphen data user to own that directory so we'll type that right here and then we'll add a colon and then we would also like the www hyphen data group to own it as well and we'll definitely want the changes to be recursive so we'll add dash capital r that'll ensure that the directory i'm changing the ownership will have its ownership changed as well as everything underneath it and that's important so definitely want to do that and then we'll run this against the directory that we've just renamed and if i list the storage as you can see here it's now owned by the proper user and proper group the next thing that we'll want to do is move this into the document root directory we definitely don't want to serve this from our home directory we would rather just serve this from a designated location so we'll type sudo and then mv for move and we want to move the next cloud directory and let's move it into slash var slash www and we see it right there so far so good technically next cloud is installed we have all of the files that next cloud needs to run but it won't work yet there's some additional customization that we'll need to do but next cloud is present and it's in the proper place and that's a good step forward now let's go ahead and disable the default site that comes with apache to do that we'll run sudo a2 disk site and you could type three zeros and then press tab and it auto completes that's the apache configuration file that serves the default page we want to shut that down we want next cloud to show up when we go to our server instead of the default apache start page so that's why we're doing this and here's telling us that we need to reload apache 2 and i'm not going to do that we will take care of that later we'll actually restart apache and it'll certainly take care of its need to be reloaded so we'll just go ahead and skip that and move on now for the next two steps i'm going to have you copy and paste because now we're getting into longer commands and also config files it's just not a good idea in my opinion to try to type all of that out especially if you're like me and you're prone to typos so the first command that i'll have you guys paste in is this one but we're not going to press enter just yet on your end you'll want to make sure that everything here is proper for your environment notice that i'm naming the actual config file as nextcloud.learnlinux.cloud.com and it's not that that actually has to match your domain it might be a little weird if you have on your end a config file that's named after a fully qualified domain name but you don't have a fully qualified domain name it'll work just a little weird but i'll leave that up to you you could just go ahead and adjust the name just make sure that it ends in conf anyway i'll press enter and now we have the file open on our screen the file doesn't exist so it's an empty window but what i'll do is paste in the contents right here and there we go now before you actually save this file there are several lines that you'll want to make sure that you change i'm going to highlight those lines right now so if you see a line that's highlighted you'll definitely want to pay special attention to that line and the reason why i'm highlighting lines here is because well some of this is actually specific to my setup the document root for example that actually has to exist if you type the document root that i have here but that's not the actual document root or the path to next cloud that you have on your end then well you're going to run into some trouble also server name that could be simply next cloud if you don't have a domain but if you do you want to make sure that that's actually set to the domain if that's something that you have and then you just continue through this file and change everything that's highlighted to match your environment or your name for your server the last two log file lines i like to name the log files on all of my web servers to match the domain or server name that they belong to it makes it that much easier when you are looking through your log directories to find the log file that pertains to your particular website or service that you're running and you never know you might be running more than one thing on this server maybe you might want to run another app on this same server i like to have one app per server but not everybody can afford more than one server so i get it and for that reason it's a great idea to include the name of the website in the name of the log file so pay attention to this guys and just go through it make sure it matches your environment take your time when you're ready we can save it so we should be good when it comes to the apache config file it exists but it's not actually enabled though in order for apache to serve that website we have to enable its config file otherwise it's just sitting idle so let's make that happen so what i'll do is run sudo a2 and site and then you can start typing the name of your config file that you've created and then press tab it should auto-complete and that's what it's done for me i'll press enter and that was telling me again that i need to reload apache for this to take effect but we're not going to reload it just yet there's a few more things that we'll need to do and the next commands that i'm going to have you run are going to be pertaining to php we need to set up php so let's do that and we'll do that by editing the config file for php so sudo nano slash etsy slash php and the version of php in ubuntu 2204 is 8.1 and then we could just start typing apache and autocomplete that auto completes to apache 2 so we know that the path is proper so far and then the file name is going to be php.ini and here we have the configuration file for php as it pertains to apache there's going to be a number of lines that we'll need to adjust in this file and we'll definitely want to pay special attention to these lines because if we miss one of them we could have some problems and we definitely want to make sure that we get this on the first try at least if we can and each of the lines that we need to configure will actually be in the documentation page for this video again linked below and all of the php config lines that we'll need to change are all going to be listed in the blog post for this video so again check the description and you'll find everything in there i'm just going to go through them from the top to the bottom so if you follow along with me then you should have everything that you need for php so what i'll do is search for the very first config line i have no idea which line any of these are going to be on and you know that could change so searching is a more realistic way to find them in the case of nano it's ctrl w to search and you can type a search term right here at the bottom you don't have to type the entire thing you could type part of it and then press enter and it should take you to that line and the first one is the memory limit by default is set to 128 megabytes let's go ahead and change that to 512. control w again and let's look for the upload max file size and i'll just type upload underscore max that takes me right to that option it's set to two megabytes right now and nowadays a lot of files are a lot larger than two megabytes so we'll definitely want to change this i'm going to set it to 200 and then we'll move on to the next setting and the next one is max execution time and i'll just type max underscore exec we're going to change this to 360. and let's move on to the next one and that one's going to be post max size so i'll just search for post underscore max and there it is and what i'll do is set that to be equal to the other setting and i'll set that to 200 megabytes as well next let's look up date.timezone and here it is so what we'll do is we will uncomment this which we'll do by removing the semicolon at the beginning of the line and then we will set this to the time zone code that is for your geographic area is going to be different for all of you so for me it's going to be america detroit if you are also in michigan that'll be the same for you as well if you don't know what yours is the url right above this line actually gives you a place where you can go to find out what yours is supposed to be you just find out what your time zone code is and then you type it right here for this option next op cache dot enable it's set to one and i like to be explicit so i will uncomment that control w again and part of it is interned i'll just type that and it's actually right here on the same screen i didn't need to search and that should be set to eight which it is but i will uncomment that and then next i will search for max underscore acc i'm too lazy to type out the whole thing but it took me right to the option that i wanted upcash.max underscore accelerated underscore files so let's uncomment that 10 000 is the appropriate number so we'll leave the value alone cash dot mem actually was right there that's the option that i wanted to try and find op cash dot memory underscore consumption 128 is fine for that i'm just going off the documentation for next cloud here so no surprises next we'll look for save comments save underscore comments let's uncomment that and then finally appcache dot reval and it was right there so i'll just go ahead and uncomment that one and now we can hold ctrl and press o to save the file enter and then control x to exit out and now what we'll do is restart apache it's asked us several times to reload it but restarting it will satisfy that as well so let's run sudo systemctl restart apache 2. now as long as we don't have any typos or any issues with anything that we've done and we've taken our time and didn't miss anything this should actually carry out just fine and we'll want to make sure that it actually did start properly so let's go ahead and check the status of apache 2 and it is active in running so in my case it looks so far like i've done everything correctly if yours isn't starting up or there's some kind of problem just pay special attention to any of these steps that we've done previous again just check the blog post out it has all the commands on there make sure that you've done everything up to now and actually at this point what we should be able to do is access next cloud in the browser so right here we have the ubuntu test page or the apache test page we've disabled this but i haven't refreshed the page since then so we still have it cached right here let's go ahead and refresh the page and see if it changes and check it out it has right here we have the setup for next cloud and the first thing that it wants us to do is create a username for ourselves so i'll do that i'll just type mine in as j just like that and it's telling us that the connection is not secure and i'm going to show you how to fix that here very shortly but for right now what i want you guys to do is create a very secure password and you'll type it in right here and there's no confirmation box so make sure that you're typing it in the first time because if you actually have a typo here well that's really going to be bad because it doesn't have you confirm the password anyway i'll type in my password here the password that i want my user to have and we should be good there now here it's asking us to set the data folder and we could just leave this alone it's fine if you have block storage or another hard disk or something that you'd like to use for your data you could give it the path to that right here you'll want to make sure that the www hyphen data user owns that directory has access to it if that's something that you want to do but that's not something i'm going to do though i'm just going to leave that as its default and then here we need to provide values for the database server the database user the user within the grant that we created earlier was next cloud so that's what we'll type right here and next what we'll do is paste in the database password whatever password you gave it when we set up the grant i pasted in mine right here so that should be all we need for that option there and the database itself was named nextcloud so i will type that in and that should be it that's everything right there so i will click install and don't refresh the page or click off of it definitely let this finish and on the next screen it's asking us if we would like to set up the recommended apps and i do recommend that so i will click install recommended apps and we'll just be patient and let this finish we definitely don't want to interrupt this we'll just let it go and there we go we have next cloud installed and ready to go take a look at that that's awesome you can click through this little welcome message right here gives us some information about next cloud i'll let you guys browse that but pay special attention to this because there's apps for your phone if you want to sync your contacts and calendar through your next cloud instance rather than you know a proprietary cloud provider like icloud or whatever it is depending on what you have you can forego that completely and just use this that's beyond the scope of this video though i just wanted you guys to be aware that you can do this also pay attention to the desktop app you can absolutely set up a desktop app on linux mac os whatever you have you could definitely do that and anyway we'll click start using next cloud and now we're logged in we have apps up here at the top of the screen so for example files you can upload your files right here that's pretty cool and you can also install additional applications as well beyond the ones that we've installed as part of the installation process you can click on apps and one of them that i recommend that you install is support for office that is if it's not already installed these ones in this section the your app section these ones are installed so you can scroll through here and find out what's actually installed and enabled and the next cloud office that's actually already enabled so we already have that that's pretty cool at your leisure you could just click through the individual sections here and take a look at all of the plugins that you can add to your next cloud instance there's quite a few of them here now in the next section what we're going to do is set up some optional things at this point i mean we've met our goal next cloud is installed but don't click away from this video just yet some of the things that we'll be going over are very important so right now we have next cloud installed as you can see and it's ready to go in this section we're going to be setting up some additional things for our next cloud server none of the things that i'm going to be showing you in this section are required but i highly recommend that you implement all of these because there's a reason why i'm taking the time to show you guys especially with the first one and the first one is going to correct a big problem right here as you can see from this icon we don't have a certificate this is not a secure connection so we definitely want to make sure that we fix this now you can only fix this if you have a domain so if you don't have that you'll need to skip this section where i'm going to show you how to install a certificate but if you do have a domain then i highly recommend that you continue so back here in a terminal let's go ahead and install let's encrypt which is going to facilitate giving us a certificate we can actually get a secure connection something that we definitely want to benefit from so let's do it and to start off what we're going to do is run sudo apt install and then the package name is snapd often with ubuntu this will be installed by default so more than likely for most of you when you run this command it's just going to tell you that it's already installed so i'll press enter we just want to make sure that we have it and snap packages are a universal package type that i won't get into i have a whole video that explains what that means but anyway let's go ahead and set up the prerequisite packages to facilitate the cert bot package that we need to install so what we'll do is run sudo snap install and then core semicolon sudo snap refresh core and i'm just pulling these commands right from the let's encrypt website anyway i'll press enter so it's downloading the core snap which is you know the the base basically we need to have that and it's already done snap refresh core actually checks for updates but you know obviously there weren't any updates so we should be good on that next let's go ahead and install certbot certbot is the utility that will actually give us a certificate so we definitely want to have that so sudo snap install dash dash classic and the package that we want to install is certbot so i'll press enter and now it's installed next what we're going to do per the recommended steps from let's encrypt themselves we're going to create a sim link so sudo ln s and then slash snap slash bin and then cert bot we want to create a link we want that to be available from user bin certbot as well so that way if the application or script is looking for this in the previous location it's going to find it so let's go ahead and finalize that and then next what we can do is attempt to get a certificate at this point dns must have already propagated if it hasn't this will probably fail and if it does fail just give it some time you can't try more than a few times or it'll lock you out for some time anyway let's run sudo and then certbot dash dash apache and that should do it email address we want to make sure that this is actually a real email address so what i'll do is type in an email address here but this is just a test instance on my side so i'm not going to worry about actually you know typing in a real email address here but i do recommend that you type a real one in because if there's any issues with renewal it'll send you an alert that's an alert that you'll definitely want to receive so i'll give them that email address i'll accept the terms capital y and it's asking if i would like to share my email address i'm going to say no for this because well it's not a real email address anyway so that would be kind of embarrassing so i'll say no now it's asking me which site i would like to set up the certificate on so i think that one in particular is good enough for me so i'll just choose number one it's the only option anyway and now it's going to at least attempt to obtain a certificate let's see if it works and according to this it looks like it did work so let's go back to the browser and see and right here we still have the padlock icon with a line through it which tells us that we don't actually have a secure connection but that's just because i haven't refreshed the page yet so i will do that right now and let's see if that icon changes and it did if i click on it i'll click on this right here and it tells me that this site has been verified by let's encrypt so now we have a secure connection but we're not quite done yet there's a little bit more that we should do so if we go here where we have our user profile icon and click on that we can go to settings and then overview right here it's going to find some problems and the reason why it's finding problems is because there's a few things that i've omitted i wanted you guys to check this and make it a habit to check this it's very important because if there's any issues then this overview section will let you know sometimes it's just a warning or a suggestion that doesn't really matter but my opinion is that you should take everything that this shows seriously and the first thing is that it's complaining about the http header or specifically the strict transport security so let's go ahead and fix that that's something that we'll definitely want to fix so back here in the terminal what we're going to do is edit the apache config file and the file name has changed because let's encrypt actually creates an ssl version of that file so what we'll do is we'll run sudo nano and then slash etsy apache 2 sites hyphen available and then the first part of the file name is mostly the same but the last part is different so this is the file name right here so i will press enter and what we're going to do is add another section to this file and i recommend that you copy and paste this from the blog article but what we want to do is paste it right here and i'll do that but we're adding this section right here which should actually fix the thing that next cloud was complaining about so we'll save the file let's close out let's restart apache and then let's go back to next cloud so we'll refresh the page later but for right now there's other things that we'll definitely want to fix now for this right here it's complaining about the email server and i won't be fixing that in this video because each of you are going to have either no email server or a very specific one if you'd like to have one and you don't have one yet there's definitely a lot of providers out there that'll give you an outbound service that'll send email which is what you need and that'll make sure that next cloud is able to send you email alerts if that's something that you want but let's go ahead and fix this right here no default phone region set that's pretty easy to fix so let's fix it and to do that what we'll do is we will edit the config file for next cloud itself we didn't actually touch that file as of yet so this is the first time that we're actually doing that but just like before with all the other text files that we've edited we'll use nano and the file is going to be located at slash var slash www and then whatever your next cloud directory was named is going to be what you type for this part right here and then inside the config directory there's going to be a file called config.php so let's open that up and we'll go to the very bottom of the file and we'll add a new line right here we'll keep the same format as the others so i typed in the quote marks right there and the comma at the end and what we want to do is type default underscore phone underscore region and then outside of these single quotes we'll type equal sign greater than sign two more single quotes inside there i will type us if you are somewhere else you could type whatever your location or your country happens to be i'm in the usa but it's abbreviated here as us anyway let's go ahead and save this file and exit out and let's recall that command right here but we're going to take the nano portion out of this command we're going to change it to chmod and we're going to set this to 6 6 0 and this has nothing to do with the phone region error message at all we just want to make sure that other or world isn't able to read the config file that would be very awkward we definitely don't want that so i'll press enter let's go back to the browser and it's telling us that no memory cache has been configured that's optional but recommended and it's also easy to set up as well so back here let's go ahead and do it in fact we probably could have done that all in one step because it's in the same file as the last tweak that we've made but what we're going to do is add the caching option right here so we'll go to the very bottom yet again we'll add a new line and what i'm going to do is paste it in right here and i just grab that from the blog post and that should take care of that particular warning in the overview page so i saved it let's exit out and let's check the browser and see what other errors that we have here and here is complaining about svg support that's also pretty easy to fix so let's go back to the terminal and to fix that particular warning we will run sudo apt install and i've pasted in the package name right here so let's go ahead and install it i'll press enter and that should be all there is to it it should be done shortly and it is done let's restart apache and see how many of those errors actually went away by what we've done so far there we go so back here on my browser let's just go ahead and refresh the page and now we're down to just that one error about the email server it's just a warning though nothing to get concerned about anyway what you can do on your end is set that up if you'd like now there's one more thing that i would like to have you guys do just to make sure that we have as few errors as we can because this is something that will come up later if you don't actually fix this right now and this is in regards to the cron tab for the web user let's go ahead and run sudo and then we'll type crontab dash u for user www hyphen data and then dash e or edit now if you see this right here just choose whichever editor you are most comfortable with so i'll press enter and let's go all the way down here and what we're going to do is create a cron job here so what we'll do is we will set this to run every five minutes and i have an entire video about crown if you guys want to check that out but anyway we're going to type four asterisks one two three four there's a space in between each and then slash user user is abbreviated usr bin slash php 8.1 dash f and then slash var slash www and then the app directory that you've created earlier the next cloud directory basically so in my case next cloud dot learn linux dot cloud slash cron dot php so we'll save the file and exit out and it's not actually complaining about cron right now but it will if you didn't set that crown job so that's just something that you'll need in the future just make sure that the crontab line that you type in matches your environment and you should be good to go and that's all there is to it in this video we walked through the entire process of setting up next cloud on ubuntu 2204 so i hope this video was helpful for you guys and if you did actually find this video helpful then please click that like button so that way youtube knows that you found this content helpful which means other people might see it as well anyway thank you guys so much for watching i really appreciate it and i'll see you in the next video [Music] [Music] you
Info
Channel: Learn Linux TV
Views: 149,455
Rating: undefined out of 5
Keywords: LearnLinuxTV, Learn Linux TV, Learn Linux, Linux Tutorials, nextcloud, nextcloud on ubuntu, ubuntu, ubuntu 22.04, ubuntu 22.04 lts, ubuntu server 22.04, mastering ubuntu server 4th edition, linux commands, nextcloud install ubuntu 22.04, installation nextcloud, ubuntu server, nextcloud tutorial, nextcloud installation tutorial, nextcloud server ubuntu, linux tutorial, nextcloud install ubuntu, nextcloud setup ubuntu, nextcloud ubuntu 22.04, nextcloud install, install nextcloud
Id: 5IUKE3oA7AY
Channel Id: undefined
Length: 63min 17sec (3797 seconds)
Published: Mon Aug 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.