Install Nextcloud on a RaspberryPi to create your own google drive at home! // 4K Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right how's it going y'all today we're going to be talking about how to install nexcloud on a raspberry pi 4. this will work with any version of raspberry pi as far as i know but we're going to be using the raspberry pi 4 because this is what i use on hand and honestly for an appliance like this having that extra ram is really going to help us out and i've already booted up raspbian off of an ssd if you want to see how to do that i'll leave a link to that in the description it's really nice because it's so much easier than using microsd cards it's more stable and you can get huge files so for this i've got a 500 gigabyte ssd hooked up to this and so i'm not going to have to worry about having external drive hooked up instead i'm just running everything off of one single drive and that just makes this so much easier all right so first off let's talk about what is next called nexcloud is basically google drive but self-hosted their goal is to make it as easy as possible to switch away from google drive and all of their services and be able to really host your own cloud it has a ton of features that are found in google drive you have calendars you have your photos synced in there and it's all synced at home that means you know where your data is and it's also really focused on multi-users that means you can have multiple people all having accounts on your next cloud server and they can all share files with each other and have their own private files it's a really nice way to keep those things separated though i do need to tell you as the owner you are going to have access to all of these files this is because they're stored just regular files within the hard drive of the raspberry pi or wherever you set up your storage file so that is just one thing to know and you should be careful about this if you're hosting a service like this you should tell your friends hey i do have access and just say i'm not going to touch it but it is a privacy thing so it's just important to know that all right and so i also could not start this video off without talking about security next cloud is an open source project and it's overall designed to be opened up on the web but you've got to make sure that everything's pretty tight it is a vulnerability if you were to set this up on port 80. it's a nice to have if you really need it but i would highly recommend instead using a vpn server and i've got a tutorial on how to set up your raspberry pi as a really fast wireguard server and if you're running a raspberry pi 4 there's no reason you should not have these two running in parallel and not have any performance issues if you do really want to open up on the web i would highly recommend setting up a very high port number and using that to login instead because it'll add extra security generally port scanners are not going to go about 5000 because it takes so long to do it and if you choose a random port the one thing your friends are going to have to know is what port number it is and so that is a really easy way to just add a little bit of security on there to keep everything better what you can even do is you can set up a redirect so you could run it at port 80 locally then have your server actually forward the port 5236 or whatever to port 80 of your raspberry pi this means when you're locally you just use port 80 and when you're external you would use that port it's a really easy way of adding security without having to worry about too many config files or anything weird about that but for this setup we're going to be setting it up locally and if there's a need i can do future tutorials onto how to open up on the internet safely that is well as safe as we can do it it is a service running on the internet nothing is secure alright so as we can see right here this is the next cloud product page and it's got a lot of cool features it's got the ability to run messages calendars files everything all hosted off of raspberry pi it's a really easy setup that allows you to do a lot of things it does have mail integration though i'll be honest with you i would not try to mess with that unless you're actually sending the emails from a different service all right so there are two reasons why i would not really mess with trying to set up email at home first off you're probably not going to get any of your emails received unless you have the ability to have a static ip address and then have a reverse dns lookup tying your host name to that ip address this is a simple check that a lot of email providers do just to make sure that it's a legitimate account anyone can send anyone an email and because of that as you very well know there are millions of spam emails out there so many so that you don't even get all of your spam emails delivered to your inbox gmail sometimes just throws them out without you ever seeing them and so it's going to be pretty likely that your emails just completely go undelivered and so it's just going to be huge pain the second reason is if you're hosting this at home and your power goes out or your internet goes out there's a good chance that all of your emails that you've been getting do not get received and whoever sending you the email is going to get a notification hey we couldn't figure out where this was and so that's just not a great setup and it's going to cause you issues down the line so i would recommend staying away from that if you really want to you can actually sync it with a service such as aws and use that but really it's just going to be easier not to touch that part however everything else is going to work out really well all right and so to set this up on a raspberry pi we're actually just going to be using a script that sets the entire thing up for us and so i found this via own your bits which is a great website that's actually helped me out a ton when trying to figure things out and if we scroll down they actually have this incredibly easy installer and so as you can see right here it basically has a install script that you run it and installs nexcloud on your raspberry pi and so as you can see right here we're actually going to be running a script from the internet and so what you need to do first before doing this ever is go ahead and copy it and just throw in a web browser and that way you can read what you're going to be installing and at least go through and understand what's happening to a degree this combined with knowing who's written the script is a great thing but it's good just to look through these and make sure that there's nothing too bad out there it's so easy for somebody to just say oh by the way set up a bitcoin miner on this raspberry pi and send all the money to me just because you ran a script that you didn't really know it was going to do and so i'm not going to go through this entire thing but overall i would trust it pretty well it's well commented and we can look through and see that overall it's got a good github image that it's using and so it really does just make you feel a little bit better but if you're really worried about security you can actually just go through and essentially follow every single one of these steps and command it yourself that way you know exactly what's being run and why all right so now that we've done that i'll leave a link to this article we're just going to go ahead and copy this code and paste it into a raspberry pi i've already gone ahead and ssh gen here and so all we're going to do is paste that code in here and run it we'll type sudo sue to become root and now paste it in there and so as you can see it's just going through and installing all of these packages for us it installed a lamp server for us it's installed all the things we need without us having to go through and really set every single one of these things up i would not recommend having this in a production environment but because the database server is going to be run locally it's really not that big of a deal because we're just not going to open up our database so it's not a terrible security vulnerability with having an easy to guess password on the database because well honestly you're running this locally you already have access to all the files in there there's not that big of a deal if someone were able to break into this database more so than they would have if they had access to your pie obviously if you're going to be hosting this for like 30 40 people who are going to be putting sensitive things in that i would not recommend doing this because it is not perfect all right so well yeah that that took quite a while to install but it is installed next cloud pi which is basically an add-on to nexcloud it gives you a ton of extra features running on a raspberry pi it makes a lot of things just so much easier and it's got a bunch of extra features which is really nice and so it even goes through and gives us these instructions right here for basically how to set this up you'll note right here this is my ip address that's assigned to it i've not set up a static ip address for this raspberry pi yet i would recommend doing that or you can just use this right here but this is actually not true for me it did not update my host file and i was still on raspberrypi.local that's why i would not recommend using those host names because they can change and really throw you off so i'd really recommend setting up a static ip address for your raspberry pi and so i've already got a video on how to do that and i'll leave that in the description you can also just assign a stack ip address from your router basically use dhcp and have a custom reservation for it that's by far the most stable way of doing it because then if your subnet changes or anything like that it'll continue to use dhcp but whenever you're local it'll just go with that i've actually moved away from using static ip addresses assigned on the machine to now using on my router because i went from the subnet 192 to 10 and so it threw everything off and i had to rebuild a lot of stuff that i could only access locally so that is just one story that i've had all right so what we're going to do is we're going to just copy this address right here and we're going to go to it in our web browser and so right here is going to say this connection is not private and that's okay because we know we're hosting it ourselves so we're going to have to show details and go to manually visit website and type in our password all right and we're just going to click activate and we'll change these passwords later on they've actually got a great config that allows you to change everything from the command line which i'm a huge fan of because it's so much faster and you can do it over ssh so i don't have the username and password because i didn't want to deal with those passwords so instead we're going to do it via gui and so we're just going to type in ncp dash config and i don't have to type sudo because i'm already as root and so it's got the option to let us update we may as well do that so we'll say yes it'll take a little while but it's good just to get all the stuff out of the way as soon as possible makes your life easier all right and so now we've got access to the next cloud pi config file and it is a great utility so much easier than having to type in all these different commands and go through everything it's got a nice thing and it's really easy for these guys to set this up i'm very glad they did all right so we're going to go down into config and we're going to change the admin so currently the next cloud pi admin will leave the user as ncp we're going to change the password to password and so i would obviously not recommend doing this for yourself but i will have it as password and i'm also now going to go down to change the next cloud pi password so that's actually two different services there's next cloud which is the next called service and then there's on top of it this basically you interface is next cloud pi and so we're going to change that password as well and and interestingly enough some special characters are not allowed here i guess that's due to what they're using it's good they tell us and i'm going to call it password again once again don't call this password or do it's your choice all right and so now we're going to go ahead and do server limitations down here and so what we can do is just say i understand and we're going to say the max file size 10 gigs that's pretty good and then if we leave it as zero that means that it is a automatic config and so i like this that way we don't have to try to figure out how much memory we want to give it it'll all do it automatically but if you do find yourself having performance issues you can try tuning it here just make sure don't over allocate your memory or anything like that and for max file size i'm gonna do 40. it's not necessarily the best idea to upload files this big because the http connection can easily time out but i like the ability to just in case i really need to and since i'm mostly going to be doing this locally that shouldn't take too too long it is still going to take a little while but i think it should be fine and in a pinch i'd rather be able to than not and so i'm just going to click tab and enter and so there are a bunch of other options here but we're just going to go ahead and click finish and this is where you can configure backups we'll go into networking and see what we need to do here and this is where you can set up either a ddns server or a dns server such as no ip this allows you to access your raspberry pi nexcloud in instance outside of your local network this is great because you don't have to remember an ip address that's going to change because it's not a static ip address i've got a video on how to do this but it's great they've set it up here they also have the ability to include samba in here which is great this means you can either use the nextcloud web interface to get your files or also use smb i love this because it gives you both options and trying to use a web interface if you want to edit document is just a pain and so i would really recommend looking at adding samba in for that but that's outside of this video so we're just going to kill keep going down ssh yada yada yada there's a lot of great things here if you are planning on opening this up to multiple people you're going to want to set up let's encrypt but if people are interested in that i can do that in another video you can also go through here and set up a static ip address if you've not done that already these are just a few of these things i know i'm going through these quickly but just pointing out some major ones there's so much stuff here and now let's go down to security so fail to ban so fail to ban is a really easy service that allows you to ban ip addresses that keep trying to access the pie who keep getting passwords wrong basically people trying to brute force their way into your pie you can set it up to ban them either forever for a couple days for a few hours anything like that and it's a good thing to set up if you're going to be running this outside of your local network because that way if people are trying to brute force their way in it'll be able to ban them and it also works for both ssh please don't open up ssh unless you really know what you're doing and it also works for the web interface so it's really good for that and you can also set up your firewall here it's overall pretty good finally we'll go into system and this is where they've got some really nice features that make it easy to do things that would bias be pretty complicated for example here they've got an auto mount feature this is great if you want to be able to plug in and use an external hard drive for all of your files you can just use this auto mount to mount the drive and so you don't have to go in and edit the fstab file which just takes a lot of things out it can monitor the hard drive tests it can test it it's really nice to be able to see all this stuff they've done a great job of adding in just tons of features that normal people are going to be wanting to use on this and now let's go into tools and they've got fixed permissions which is great if you screw anything up you just go hey fix permissions format the usb i don't know if i would use btrfs i know if you're a synology user i talk all the time about how good btrfs is on synology i've heard issues with people using btrfs outside of synology synology has done some under the hood tuning to get btrvs working just right and it has no problems that i've seen so far but i have heard of people having data loss using btrfs i think if it's not perfectly configured for your system it might not work great and so unless you really have everything tuned well and you know what you're doing i might just stick with ext4 but then again that could just be me being over cautious and so a couple of things here you've got maintenance mode it kind of lets you take down the site and work on some things previews previews are for images and things like that it creates smaller thumbnails that can be easily loaded on the server if you have like a 20 meg photo you don't want to trying to load that for 60 of them on the thing just absolutely slowing down your pi and then there's also scan this is for files that are changed externally so if i use smb to copy something over it might not end up in the web interface quickly so if that happens you can use a scan but you can also set that up as a cron job and that is it you can also do your updates and your backups but overall that's the gist of what's available in this tool i know i went through that fast leave any specific tutorials you'd like to see me make in the comments below and i can go for them then all right so now we're going to be out of this and just go ahead and click finish and so now we're out of it i'm also going to exit out of route just going to do and clear the space all right so now let's just go ahead and do a reboot that way we don't have any weird hiccups later on so to do that i'm just going to type sudo reboot alright so now i've let it reboot and i've gone ahead and gone to my iap address just like we did earlier and so now that username was ncp and it was password for me all right so finally that worked big problem i realized so if you look back in the video and i'll probably point out another thing when you go through the next call gui there's actually an underscore i thought that was my cursor now underscore is a space and so i typed in the wrong password was super confused why it was not working note to self that is a space so if you have any issues logging in because you change the password that's probably why but now we're finally in i've gone through and i just redid the next cloud install setups and now we're next cloud hub and so it's a great easy thing to set up we're just going to go through the original menu we look through it yada yada yada it's got a bunch of information it is great um i'm just gonna close this out so let's start off by we'll set our location for our weather it does a great thing so now it's got our weather it's really nice it just makes everything really easy and it's and it feels pretty polished honestly you can also sing in your calendar and use that there so now let's go over to the files and so now this is so much like google drive you've got your documents you've got your photos and you've got everything it's got thumbnails and everything you possibly want and it honestly loads pretty snappily if you want to upload files it's incredibly easy all you do is click this plus button i'll upload a file and go and select an image and just like that it's brought up and it makes a thumbnail almost instantly it's really easy to use and feels so much like google drive one thing i don't love is there's not a great batch uploader but you can easily solve that by using web dav to just copy over your files there's also a photo section and it actually just goes through and looks at all the photos on your home folder and that image i just uploaded was automatically brought in here it's really easy we've got activity you can see all these things yada yada yada as you can see i reset my password quite a few times trying to get this to work but it is all good now so now let's go to the next cloud pi dashboard and so this is actually that same issue i ran into so ncp and my password is going to be password space ah it was an underscore not a space so my password was a password underscore because they left an underscore in there i think they couldn't have non-zero characters that is one annoying thing it just shows it's not perfect but overall it's really good and this is where you've got a web interface for everything you need you've got all the information you can have all running it off your raspberry pi and just makes using it so much easier you've got rsync options you can basically go through and send out your data to back it up to another computer you've got a very easy setup here for configuring everything you've got easy access to your admin you can change where your data is stored so if you were to mount a hard drive on media usb drive you could basically copy of your files first then change it to this that way you would be storing all these media files off of a hard drive which would be much better than storing it on the sd card on your raspberry pi i've actually got this hooked up with a ssd already because i'm running off a raspberry pi 4 and so i'm actually just loading the operating system on a usb drive that is an ssd it's great to have that and means i don't have to have an x drive hooked up and it's just got all the options you really want overall they've made this really clean and it's easy to go back to next cloud alright so now let's do a couple more admin things we'll go and start off by creating a user so to do that we go up here and we're going to go to users and we're going to create a new group we'll say family so now let's go ahead and create a new user and i'll put the username as will display name as will password email you can set up here and you can choose what group to put it in i'd actually recommend not putting yourself as an admin but instead having a second admin account this way you only get the admin privileges when you need them and it's just better for everybody and just add and so that's how easy it is to add users i will give you note i actually did run into an issue where i had the next cloud config up and running and trying to do things on the database it actually caused a conflict and i had to close out of netcloud config on my raspberry pi so i would not recommend running those two together if you're also doing things like adding users that's just a problem i ran into but i don't think it should be too big of a deal we can go in and edit the user's password consider i already forgot it and now let's go ahead and change our login all we have to do is go up here log out and we'll do will and just like that we've logged in as the new user it's really easy to go through and now if we go up here we don't have all those admin settings and so that's honestly how we go we can set up alerts and you can honestly do just about anything it's a really great way of hosting everything yourself and being able to really sync up and have your own google drive without worrying about somebody else controlling your data you control all your data here there's a ton to do in next cloud so i'm definitely gonna have to do a bunch more videos in this so go ahead and leave any other tutorials you'd like to see me make in nexcloud or really anything else in the comments below that way i can try to figure out what people want to see and do those videos all right so that's going to be the end of this video i think we've covered everything that you need to get set up for i'll be covering more next cloud videos in the future well that's it have a good one bye [Music] you
Info
Channel: SpaceRex
Views: 93,804
Rating: undefined out of 5
Keywords:
Id: 5aGKWkGTmAw
Channel Id: undefined
Length: 23min 22sec (1402 seconds)
Published: Sun Dec 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.