How to create your own personal cloud with Nextcloud on a Raspberry Pi 2021

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up guys wiredzero here and in today's video we're going to go ahead and install nexcloud on a raspberry pi so what we'll cover installing the latest version of the pi os installing next cloud adding external storage to nexcloud and securing nexcloud so let's go ahead and install the raspberry pi os all right let's head over in your browser to raspberrypi.org we're going to click on the software link up at the top now we're going to scroll down to where we see all download options and click on that all right now we're going to scroll down to where it says raspberry pi os light and we're going to go ahead and download that for this video i'll be using the may 7 2021 release which is release 10 code name buster all right when it's finished downloading let's go ahead and unzip the os image now we're going to need a program to make this ready for the raspberry pi on the sd card so there's two programs basically we're going to be dealing with here on the mac you can use bolina etcher and on windows you could use the win32 disk imager i'll be using the win32 disk imager because i'll be using windows to install the raspberry pi os all right so let's go ahead and open the win32 disk imager and make sure that you have the drive letter set that you have your sd card in okay that's very important here so you want to double check that and then once you have that set let's click on the blue folder to the left of it and we're going to go ahead and locate that download that we unzipped the raspberry pi os all right now when we have that populated in the window we're going to go ahead and click on write and when it's complete you'll get a message that says write successful all right let's go ahead and move on all right there are a couple things i want to do to this sd card before we stick it in the raspberry pi so let's go ahead and head over to your desktop right click and we're going to create a new folder and for the sake of this video we're just going to call it pi okay now in this folder we're going to create an empty text file so just right click in this folder go down a new text document and we're going to call it you remove everything in there and just name it ssh and yes we want to change it now optionally if you want to log into this raspberry pi or have it log into your wi-fi let's create another file and we're going to call it wpa underscore supplicant.conf okay and yes we want to change it and this is what we're going to put in this file so we're going to go ahead and type in country equals us take it you're in the united states if not then your country update underscore config equals one and then ctrl underscore interface equals forward slash var forward slash run forward slash wpa underscore s-u-p-p-l s-u-p-p-l-i-c-a-n-t hit enter twice network equals curly bracket hit enter scan underscore ssid equals one hit enter ssid equals double quote and this is going to be your wi-fi name that's great i live next to a car shop okay and now we're going to put in psk equals double quote and this is going to be your wi-fi password and then hit enter and then we're going to close this with a closing curly bracket and we're going to go ahead and save this okay now let's go ahead and open up this pc and we're going to open up the sd card it's going to say boot so just open that and now we're going to drag these two files right into the root replace i had these in there already you can close these and now we can take the sd card out of our computer stick it in the pi and plug it in all right let's go ahead and ssh into our raspberry pi now if you need to find your local ip address of your raspberry pi simply log into your modem or router and look for the attached devices you should be able to find it there if you need help with that send me the make and model of your modem router and i'll see if i can find out where you need to go to find it all right with that being said let's log into the default credentials for the raspberry pi now by default the user is pi so we're going to ssh into pi at your local ip address in my case it's 172.16.0.9 hit enter and it's going to ask us to authenticate the fingerprint so we're going to go ahead and type in yes and now we're going to need to put put the default password in which is raspberry okay we're in i'm going to go ahead and type in clear to clear out this menu and the first thing i want to do is change the default password for pi so we're going to type in sudo p-a-s-s-w-d space pi and we're going to go ahead and create a new password for pi and we're gonna have to confirm it okay now what i like to do is i like to create my own user so i'm gonna go ahead and sudo add user space e guy okay now i'm gonna create a password for egon full name you could enter through all these they're not necessary yes to confirm and we are good now what we want to do now is give sudo access to egon so we're going to type in sudo okay user mod space a i'm sorry dash a capital g space sudo egon okay now we have pseudo rights for egon when we want to do root level access to things all right so now let's go ahead and do sudo apt get update to update our raspberry pi all right now let's go ahead and type in sudo apt get upgrade and we're going to go ahead and confirm all this all right let's go ahead and reboot our raspberry pi so let's type in sudo reboot all right now that we're rebooted let's go ahead and log in with that second user we created in my case it's going to be egon so let's ssh into your username which in my case is egon at your local ip address go ahead and put your password in all right now what we're going to do is we're going to type in sudo space raspy dash config and go ahead and put your password in for the pseudo access and now we're gonna go to option five so scroll down use your arrow keys to arrow down option five and then tab to hit select and then we're going to choose l2 time zone okay in my case i'm going to choose us tab to ok eastern standard time which is my time zone hit ok and now we're good to go we've just set our timezone so we can tab down a finish to exit out of the raspy config now there are a couple things we need to install to make next cloud work so the first thing is going to be sudo apt space install apache 2 space mariadb dash server space lib apache 2 dash mod php space dash y so we can get our web server running with our database server that we're going to be using so let's go ahead and put our password in [Music] all right the next line we're going to put in is going to be sudo apt space install php dash gd space php desk json space php dash my s mysql space php dash curl php dash mb string space p h p i n c l space p h p i m a g i c k space p h p x m l space p h p dash z space dash y so we don't have to confirm it now don't worry i'll have a link for that entire line in the description below as well as the previous one so with that being said let's go ahead and hit enter and install that all right now let's go ahead and download and install nexcloud so what you're going to do is head over in your browser to nextcloud.com forward slash install forward slash pound instructions dash server now what we're going to do is we're going to right click on download next cloud and we're going to select copy link address all right let's head back to our terminal and go to our www directory so to do that let's type in cd forward slash var forward slash www forward slash html all right now we're going to go ahead and download next cloud using the link we copy from the website so let's go ahead and type in sudo wget space and now let's just right click to paste in that address and hit enter all right i'm going to go ahead and clear out the terminal window and now what we're going to do is we're going to give access to the web access to the next cloud folder so the first thing we're going to type in is sudo space chmod space 750 space next cloud space dash capital r and we're going to do this both for the user and the group so now we're going to type in sudo space c-h-o-w-n or change ownership space dub dub dub dash data colon dub dub dub dash data space next cloud space dash capital r and hit enter all right time for us to set up our database for next cloud so time for a little mysql all right now we're going to create a database for next cloud to use and we're going to create a user for next cloud to use for the database so we're going to create a database called nextcloud and we're going to create a user called nextcloud and give that user password as password so let's go ahead and type in sudo space mysql and hit enter all right now what we're going to type in is create user single quote next cloud single quote identified by single quote password single quote okay now we're going to create a database called next cloud so let's go ahead and type in create database next cloud okay and create databases capital and next cloud is going to be lowercase let's go ahead and hit enter okay now we're going to grant all permission for that database to our next cloud user which is next class so let's go ahead and type in grant all privileges on nexcloud to next cloud at localhost identified by password it's probably easier to just copy and paste the line i have in the description and just populate it with whatever you're going to populate for the user in the database and the password okay now we're going to type in is flush privileges and we can go ahead and quit out of this all right now let's change it so when we go to the ip address of our next cloud on our local server here we can actually pull it up just the ip address and not have to worry about the html directory so let's go ahead and change directories over to cd space forward slash etc forward slash apache 2 forward slash sites dash available now what we're gonna do is we're gonna use nano as our editor and edit this file so type in sudo space nano space zero zero zero dash default dot conf okay now let's go down to where it says document root right here okay see where it says html let's put a forward slash next cloud okay control o and we'll save that and then control x to exit now let's go ahead and reboot our raspberry pi so let's type in sudo space reboot and hit enter and put our password in all right let's go ahead and open up a browser now and head over to the ip address of the raspberry pi you'll end up with a screen that looks like this so the first thing we're going to do is going to create a admin account for the next cloud account here so we're going to type in i'm going to type in admin you can use what you want and i'm just going to use password we can leave the default data folder set okay because we already have that preset within our www forward slash html for slash next cloud directory okay and now we're going to enter in the database user so the database user is going to be next cloud what we created and the password which we created was password and the database name which was next cloud okay and we're going to install the recommended apps and then we're going to go ahead and click on finish setup all right now we can log in with the admin account we created for nexcloud so in my case it was admin with password so now i'm going to go ahead and click on login and that's how you set up next cloud all right let's go ahead and add some external storage to next cloud all right in the terminal the first thing we're going to need to do is we're going to create a directory to mount our flash drive or external storage so let's go ahead and we're going to cd into media okay now what we're going to do is we're going to create a new directory in here i'm going to go ahead and go sudo okay mkdir all right and i'm going to call it p storage okay and we can see we have our p storage directory in here now now we're going to need three things basically we're going to need to find out the uid the gid and the uuid which is the identifier of the drive so in order to find our our uid what we're going to type in is cut space dash d colon space dash f1 comma 3 space forward slash etc slash password okay and now we're gonna look for dub dubbed up which is right here so that id is 33 okay and now we're gonna need the gid so in order to get that what we're gonna do is we're gonna type in get ent space group okay we're going to do the same thing we're going to look for dub dub dub right here and that id is 33 okay and now we need to find the u u id of the flash drive that we have or your drive so what we're going to type in is sudo blk id okay and the name or the label of this drive is p storage is what i named it so we're looking for the uuid which is right here so this is what we're going to need to document so those are the three things we need to have in order to um make this mount point and when we reboot everything comes up with the correct www permissions that we have going on so let's go ahead and type in sudo nano four space forward slash etc forward slash fs tab okay and now what we're going to do is we're going to type in this line and we're going to replace it with the items we collected from those various points so in my case we have the uuid as 980 d-cd d4 and then media forward slash p-storage because that's the mount point we want to use auto defaults and the uuid which we got which in my case was 33 and my gid which was 33 okay so let's go ahead and just paste that in and then we're gonna hit ctrl o and save it and then control x to exit now to test this we could type in sudo mount dash a and if it comes back with an empty line we know we are good to go and we can reboot and this mount point will be permanently placed and we'll be be able to access this within next cloud so let's go ahead and just sudo reboot all right let's go ahead and open a browser and head over to the ip address of a raspberry pi in my case it was 172.16.0.9 and let's go ahead and log in with our administrative username in my case it was admin and my password was password so let's go ahead and log in all right now we're going to click on the icon up in the top right in my case it was admin so it's going to be a so we're going to click on that and we're going to go down to apps and we're going to click on the little magnifying glass up here in the top right and we're going to type in external storage it'll be the first option up here external storage support and let's go ahead and click on enable all right now what we're going to do is we're going to click on the icon in my case it was a for admin and we're going to click on settings and now over here on the left we're going to have external storage let's click on that we're going to give it a name for a folder name that's going to show up in next cloud so i'm going to call this data all right add storage i'm going to select local okay now in configuration we're going to type in forward slash media forward slash p storage and over here on the right we're going to click on the check mark and click on that and now that we have the green check mark here we know it's working so let's go ahead and click on files up top here and we should see a folder called data there you go there's ex there's our external storage in my case it was the flash drive i threw in the raspberry pi but that's ready to go the right permissions are there so let's go ahead and move on all right let's go ahead and secure next cloud with a self-assigned ssl certificate all right now in the terminal we're going to create a directory for the ssl and apache so let's go ahead and type in sudo space mkdir or make directory space dash p space forward slash etc forward slash apache 2 forward slash ssl and go ahead and hit enter and go ahead and put your password in all right now we're going to go ahead and generate our certificate so paste this following line that i'll have in the description below and hit enter all right country name i'm going to go ahead and use u.s state i'm in florida so i'm going to put florida in city i'll leave that blank company let's go with wired zero enter through [Music] and we are good we just generated our certificate all right now let's go ahead and enable our ssl module for apache so let's type in sudo space a2 en mod space ssl all right now we need to restart apache so let's go ahead and type in sudo space syst emctl space restart apache 2 and hit enter all right let's go ahead and log back into our raspberry pi via ssh now what we're going to do is we're going to edit our apache 2 config file for the ssl so once you're logged in via ssh let's go ahead and type in cd or change directory space forward slash etc forward slash apache 2 forward slash sites dash available okay and now what we're going to do is we're going to edit the config file with nano in my case so let's go ahead and type in sudo space nano space default ssl dot conf and put our password in okay the first thing we're going to do in here is we're going to change the document root so we're going to put a forward slash after the html and we're going to put in next cloud that way when we type in the ip address of our raspberry pi we don't have to put in next cloud we can just go right there to the root of next cloud all right and we're going to go ahead and scroll down to the ssl certificate file and the ssl certificate key file and we're going to change these two so let's go down to the first one control k we'll take it out and control k we'll take the other one out okay and now we're gonna put these two lines in all right now let's hold down control and hit o and save and control x to exit all right now let's go ahead and enable the default ssl so let's go ahead and type in sudo space a2 e n s i t e space default dash ssl ssl.conf and we're going to go ahead and put our password in again and now we're going to go ahead and reboot or restart apache 2. all right now let's go ahead and force next cloud to use the ssl so let's go ahead and type in sudo space nano as our editor space forward slash etc forward slash apache two forward slash sites dash available forward slash zero zero zero dash default.conf okay right before this line here that says error log okay i'm gonna go down and we're gonna paste in the following all right and now we're gonna hold down control and hit o hit enter and then control x to exit now let's go ahead and enable the rewrite that we just did so let's go ahead and type in sudo space a2 e n m o d space free right and hit enter all right and let's go ahead and restart apache now we should be good to go let's go ahead and test out next cloud in a browser all right the first screen you're going to be presented with is a your connection is not private it actually is we're using a self-assigned certificate so you can go ahead and click on advanced and proceed and as you can see here next cloud is using an ssl wire zero out you
Info
Channel: wiredzero
Views: 21,190
Rating: undefined out of 5
Keywords:
Id: yJBM9of4KBQ
Channel Id: undefined
Length: 23min 28sec (1408 seconds)
Published: Sun Sep 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.