Nextcloud + ZFS for Storage + Cloudflare Tunnel Access | Proxmox Home Server | Home Lab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and thanks for watching this is me Mr P and this is another episode in a proximals Home Server Series this video is going to be quite lengthy because I'm gonna show you from scratch how to set up next Cloud how to link ZFS pool to that next Cloud instant and how to link cloudflare tunnel to the next Cloud instant in other words you will be able to access nextcloud from anywhere in the world using your own domain and plus subdomain so let's begin what you see in front of you is my fresh proxbox install I have nothing inside it no ISO files no container templates one thing I actually have just set up just before recording I attach two hard drives 36 gigabytes inside them for some reason showing 34.3 but anyway these two will be used for ZFS Mirror Mirror Mirror ZFS pool mirror ZFS pool where the data can be stored from a nexcloud so let's start by getting ourselves a template so under CT templates I'm gonna click on this and I will search for next cloud here we go TurnKey next Cloud at that time of recording at the time of recording this video is 17.2-1 I'm going to click download and while this is done loading I can close that and go in templates and go for Debian you can choose Ubuntu or you can choose Debian I'm going to choose Debian 11 bullseye click download Debian 11 will be used for cloudflare and obviously next Cloud will be used for next Cloud I can run cloudflare within the next Cloud container but I like to have all these Services kind of split up on my main proximate task where I join my main proxbox yes you can have a one container running all the services inside but me I like to mess around with stuff so if if one of the servers I want to delete or I need to restart for some reason a bunch of other services will still be active because I have all of them all the services split into separate containers so while the next level is getting downloaded I will go and start creating ZFS a CFS post so I'm going to click on CFS and click ZFS create ZFS if you can see drives here I suggest to go back into your draw into your proxbox node and click on a disks and then select the drive make sure you select the right drive and just press wipe the disk I'm gonna press wipe and this is just gonna go and delete everything on that drive just to make sure that it's definitely clean so when that is done I can go back into ZFS and by that now you should be able to see both drives I'm going to select both drives I'm going to call this tank I will untick the ad storage because I don't want this CFS pull to be used for ISO files for disk images for proxbox this is going to be my next Cloud stuff and next I need to change raid level to mirror compression lz4 and um everything is here so let's click create so GFS pool is getting created so let's wait for that to be finished so here we are I have my ZFS book created everything is online everything is Happy great now let's check if my container is downloaded okay now inside the proxbox node I click on a shell inside here if you type ZFS list it will give you a list of all the amount points or if you put the Z pull list here we go this is my one ZFS pool and right now let's create the data sets it's your first list again so as you can see it's slash tank so right now we need to write a ZFS create tank slash next Cloud I'm going to call it next Cloud you can call it whatever you want mine is going to be next cloud and now if I'm going to do ZFS list you can see there is a tank and tax tank slash next Cloud when you run ZFS list the slash tank or slash whatever always going to be your master pool name and slash whatever slash whatever it starts with your data sets so right now I have a data set by the name of next cloud and let's say for this instant I will have admin it's going to be in the admin and it's going to be using user Mr P for example so I can have I have two options right now how I can allow these users to store the data I can go inside this location which is Mount Point location which is that so I can go into slash tank slash nextcloud like that and I can create a directory here for Mr P and I can click create directory for admin for example but I in this video I'm just gonna go and create the another data set within a data set basically it's a child data set I'm going to write ZFS create slash tank oh no tank slash next Cloud slash Mr B and then bring the same command and then just going to change Mr P to admin so right now we're going to do CFS list I have my pool I have my data set and I have two child data sets one is for admin one is for Mr B so right now let's say you have your next cloud and you have 10 20 users using your next log it's much easier to for you gonna be just to write a ZFS list and see how much of this is being used by each of the users so my CFS is sorted I have a data set next thing let's go and start creating the next Cloud instead I'm going to click click on a create CT and now I'm Gonna Leave actually change that to 101 a 100 will be left for cloudflare let's say I'm going to change that to 101 I'm going to call this next Cloud Dash YT I need to run this privilege and the reason why I'm going to use a mount Point pass through to the container and it's much easier to do Mount Point path through a pass through when the container is privileged yes you can do within privileged container but there is a bunch of commands you need to run and make sure that permissions are sorted it's it's it's doable but it's headache for me so I'm just gonna go easy way just gonna say contain this privilege and it's gonna be much easier for me to sort everything out so um location node 101 next load by T I'm gonna untick Pro and privilege so that means container will be privileged password set under templates I'm going to select next cloud and the disks eight gigabytes will not be enough all at the start it will be but basically the files will be stored inside your CFS pool but the cache files will be stored still will be stored within the uh the the container so if eight gigs is not enough I would jump straight away to 32 just to see how it goes if it's not enough you can increase that even you can go through 12 and then you you can increase when when the time comes when a container gonna start complaining that you don't have enough memory I'm going to actually leave that at 12. under CPU two cores will be probably the best one core is fine memory 512 is again how many five how many users going to use it is going to be only you let's say your friend your brother or let's say I don't know a couple of your friends I would say increase that to two gigs maybe one gig let's use this one gig if obviously your your proxbox allows and obviously do swap the same amount and the network I'm going to choose DHCP because I want the DHCP to assign IP address DNS I can leave everything as it is and the confirm I'm not gonna take this because we need to do a couple of more things to this container before we start and now I'm going to click finish so let's wait for proxmox to get this container created and let's wait here we go container is getting created let's check the log files here at the bottom so CT containers 101 is getting created actually while this is creating less creative cloudflare right now let's click on this and we're going to say hold on because the other one is getting created this one is still thinking okay so proxmox 101 I'm gonna call this cloudflare Dash YT now I'm gonna just put the password this container can be unprivileged under templates let's click on this let's wait for the because the the container is getting created this one is getting a bit uh slow down so right now I'm going to choose Debian 11 standard and the disks eight gigs are plenty for this to run you can even probably run this on four gigabytes I'm just gonna leave eight because I have enough space one core for this is definitely more than enough memory 512 more than enough a network obviously I need to do DHCP and for DNS I will change that to be a cloudflare DNS just to speed up just a tiny bit the over performance so cloudflare tunnel container will use cloud for DNS so it's just just a bit like just over the edge for for the speed of performance and Confirmation I'm going to click finish so right now this content is getting created so let's wait for actually for this container to get created and one of both containers are great actually there you go this is already done so there's no no need for cut here let's jump straight away into setting up a next cloud so with the next Cloud actually now let's start with the cloudflare first because we need to have our domain to set up the cloudflare we're going to start this container so I'll choose the cloudflare YT container and here we go it's running so root and a password is the password I entered during a container setup process so there's a couple of things I need to do straight away here is apt update to update all the repos apt upgrade to update upgrade all the packages apt or sorry double Ampersand and apt install curl and pseudo basically what this what I'm doing here is I'm Daisy changing the commands using double Ampersand that double Ampersand means that this command needs to run only if this command is successfully finished so you're going from the right to left this command will only run if this command finished but this command only run that this command is finished so it's just gonna go one when it's all done it's all happy goes to two and once this is happy and goes to free so I'm just gonna press oh yeah and dash why excuse me Dash y to install I can see install has been misspelled here so I'm just gonna do like this so apt update at apt upgrade and apt install curl and sudo and press enter so right now daisy chain command is going to go and get all this set up in one go so I'll be back when this is done and here we are we have the cloudflare container updated upgraded and curl and suit installed so just double check for example curl if I write curl I'm gonna get the message if I'm gonna write sudo I'll get the sudo helplines help command so that means the pseudo and curl has been installed so now let's start setting up the cloudflare to set up a cloud file I need to log into cloudflare dashboard and I'm going to use one of my domains which is going to be mrpcloud.uk I have that one free parked for for this kind of these kind of demos and so I'm just gonna right now once you I'm logged in and you are inside the home page click on the zero trust by the way I have the video created about cloudflare setup I'm gonna sort of speed run through this now but if you want to look watch the video about a bit more in depth I will leave a link to that video in description below that I'm going over through all the settings of the cloudflare and how to like probably set everything up this time I'm just going to do sort of like a bit of a speed run like I said so once I'm inside the zero trust overview page I'm going to click on the access and click on the tunnels in your case if you're setting up this as a fresh instant you will see no tunnels at all in my case I have two because I have two Services running that needs to have a separate domains so right now let's say you have nothing here so you're gonna click on a crate tunnel and give it tunnel a name I'm gonna call it sandbox in this video I'm gonna say save tunnel so channel is getting saved and now it's asking me which environment I want to choose or I will I will choose to install cloudflare tunnel a Windows Mac Debian Red Hat etc etc so I'm going to say it's going to be Debian and it's going to be 64-bit and here we go this is automatically it shows up and you it really for me don't even need to set everything up because I'm using a Linux laptop and it sort of detects what kind of thing I want to use but you just pick the Debian if you're following this video and 64 and copy all this line so it's gonna curl this one that's why we needed to do a curl and then it's going to run sudo dpkg command and I had to install sudo and say Debian if you're using Ubuntu and container you don't need to do Sudo is already pre-installed but in Debian I had to install it so I'm just going to make sure that this command is copied I'll go back inside the cloudflare container left click and paste press to the right just to make sure the text is getting deselected and I'm going to press enter so right now all this happening and while this is happening I can go back inside the zero trust page and then the connectors right now the cloudflare continue basically on the cycle tries to find the installed contain and here we go it just happened connector ID I have a status I have the data centers not sure where this is located my public IP address and a version so it's 2023-5 and I'm gonna click next subdomain right now I need to enter something here to make this work so a suggestion I would be just to select the domain that you want to use so my case is like I said it's going to be Mr pcloud.uk I'm going to say HTTP and I'm just going to enter the local API address just something needs to be entered here otherwise you won't be able to fully save this container also the cloud for tunnel so just enter local AP address or localhost and press yep so that's it it's it's been saved and right now it's going to appear in the list of all my containers and here we go it shows up here so I have a Sandbox and it says healthy and this is the domain I'm using and it means created literally like it shows today let's go back to approxboxes and inside here I can see the everything has been installed successful everything is Happy next let's go back to next cloud and this is being created so before I run the next Cloud I need to click on a options features and make sure nesting is enabled if I will not enable nesting during the initial next Cloud setup process I will start getting errors about SQL mySQL database installation process nesting basically allows the container imagine the container inside the proximox is like a service so this is a service inside the proxbox but the next login database will be a service inside this container so it's like service inside the service so nesting is required to be enabled otherwise the service within this service will not work I hope that makes sense so make sure the nesting is enabled and click ok so I have nested enabled and privileged contain is known that means it's privileged now I can go here on a console and press start and right now container will start and start doing all automatic setup process created by TurnKey team once all this done I will be presented to login prompt default username will be root and your default password or password will be the same that one that you created or entered using um create CT process now it's asking you to enter the adminer password for MySQL I'm just going to enter something that meets all the criteria which is eight characters or a lot number more and this will need to be one uppercase or lowercase Etc one of the following on this so I'm just gonna say okay this is my password and that's it now it's asking you for next load admin account as you can see it says 8 characters or more but actually it needs to be 10 characters or more it's just this number is is incorrect it needs to be 10. for example if I enter the same password that I did for my MySQL which is eight characters or more I will get the error saying it needs to be at least 10 characters so right now I'm just gonna enter the 10 characters password and now it's asking me enter your domain for next Cloud well the domain let's go back to Tunnel I'll select my sandbox tunnel when I click on three doors and click configure public host and click add public host name and I'm going to call this next cloud domain will be Mr P cloud dot UK type https next Cloud I wants you to run over https so make sure that's happening and now I need to enter AP address but I don't know IP address because it's not been given yet so what I'm going to do here instead I'm just going to leave this as a www.example.com and press apply skip and install the the security packet patches so let's wait for this to install because we need to get a p address so let's give a second for this to finish the patch installation process will not take that quite long just I would say 10-15 seconds so I'll leave this running I'll be back when this is done once Security package is installed you will be presented with the con config screen and this is the IP address is one ending with 81 this is the one I need to use obviously it's asking you it allows you to use a ordinary HTTP but suggest to go by https because next Cloud will try to default to https anyway so I'm going to left click and copy this URL and paste in and try to access that I'm going to say yes and right now next Cloud will complain that I'm using untrusted domain because the trusted domain is www.domain.com this is the one I had to enter but by the time the well I I wasn't aware what kind of IP address this instant received at the time I was doing this but now I know it's 81 so I can go back to cloudflare and enter the AP address which is 192.168 178 821 and because I chose https I need to expand this option and TLS and make sure this is enabled which it says no TLS TLS verification otherwise you won't be able to access next Cloud because it's gonna try to verify the security security TLS and it's just gonna go and start moaning at you so I'm going to leave this not saved yet because I need to go back to my instant and I'm going to click on here advanced then select quit and make sure select is Select is selected and then you really want to quit yes so now I'm inside the next Cloud Dash YT container template I need to edit the file which is located inside bar so Nano space slash VAR slash www.nextcloud config slash config.php and press enter and you can see it's a trusted domains we have two which is one localhost and the second one is example.com I'm just gonna delete all that says example.com and we'll enter next Cloud Dot mrpcloud.uk Ctrl o to save enter to write Ctrl X to close and now I can go into a cloudflare and now I can go and press save host name so this is getting saved now I can click on this next cloud sdp cloud and click on the link and here we go I can log in as admin now admin enter the password the 10 characters or more password that you had to enter during initial Next Level setup process I'm just gonna quickly this and that's it I am Insider run this basically first the dashboard like a first login dashboard I'm just gonna quickly do what I like to do here I'm just select this like this just leave weather here now click on the files and it will be presented with the files that automatically gets generated on the first next load run I'm just going to quickly zoom in just a bit easier for you to see so this is just a bunch of templates and stuff that nextcloud creates for every single new user so I am at the admin I need to create the user Mr P because I want to have like I will show you how to have two separate users on here so I'm going to click on the admin and click on the users new user username will be Mr P display name MRP the password is the same criteria 10 characters or more uppercase etc etc so I'm just going to use the same password MRP at domain.com is asking for any email address I can just put like this add a user to group it's going to be users yep and then it says default quote quota I'm going to say Unlimited and as it I'm going to click add the user user has been added so I have admin and I use a MRP showing up here so right now if I'll go back inside my files this is all the files I have here I need to delete them before I link my ZFS data set in here otherwise the next node will start complaining that inside the cache it still has these files but it's not located in CFS blah blah blah so it just suggests to just delete them there just the standard files anyway so the tick at the top selects all of them I'm just going to click action and change delete and as deleted and if I go inside right now the cloud flare not the next Cloud sorry next Cloud container if I go to location which is VAR www slash nextflow Dash data and if I list the content as you can see there is a folder admin and the folder Mr P if I navigate to Mr P folder and list the content on that it says 0 because that means that this user has haven't logged in yet so next load there is no pre-configured files yet set up so I'm just gonna add log out from admin and login as Mr P so look Mr P is logging in for very first time into this next Cloud instant let's wait for that to happen now on the first login is that takes a bit more time because it's generating all these files so let's wait for this to happen actually while this is happening oh no that's it okay welcome screen recommended files I'm just going to click on the files and here we go this has been created if I right now list the content as you can see right now it's got it had zero now it has eight and this is the files being created I'm just gonna make sure this is all deleted here we go that's it nothing nothing left here for Mr P to use so right now I'm gonna log out from this one and that's it leave this under the login screen it's no need but I just like to do it this way so right now there is two things we need to make sure that we take a note before we go through that because we don't want to mess up first thing is admin and Mr P each of these containers or you should store each of these folders that represents the user admin and user Mr P inside each of them there is a file folder called files so this is the location if I go to files and write PWD which is prints the working directory this is a location where the files for Mr P are stored and if I'll go like this and say admin and none files and print so this is the Mr P location with the file this files lives and this is admin user user admin location a user admin stores the files in I hope that makes sense so I need to link this to CFS list to this and the admin needs to be linked to here and this is where we're going to start setting up the mount point and this is basically why we need to have next Cloud maintained as a privileged otherwise it's just going to fall over so once again just make sure you take a note of this and obviously admin can be replaced with the um with Mr P or whatever username and now once I know exactly where I need to be pointed the container next Cloud container needs to be shut down because you can't change well you can change while the container is running but proxbox will auto update the config file as soon as it detects that it's actually not right and the container is still running so next slot container is off that's fine let's wait for icon to change and now I'll go back inside my proxbox node and the shell I need to navigate and navigate to a folder which contains all the contain all the container config files and amend the the right one and that is inside Etc PVE lxc and then ID number of the container you want to amend so 101 represents my next cloud and right now just below the memory I'm just going to make a space here just to write the stuff in don't worry about the bin Gap blog smokes will sort the spaces and that will condent all the data after you save it so next let's start with the admin folder so let's begin MP zero colon slash the name of the pool name of the data set next cloud and name of the folder if you created a folder or just carry on with another data set and that's it so it's a tank next slot admin comma this basically means which location needs to be Mount pointed to so this is the source and destination will be MP equals slash VAR www next Cloud Dash data admin files so this is the all the command I need to enter all the line one line that means that whatever is in here needs to be moved there okay next one M B1 you need to start from 0 because 0 is the starting point inside like programming and Linux and Etc and one is representative space and you again tank next Cloud Mr P comma you you can't do like this and leave a space just to make sure that all is going to look nicer make sure you just write all this without the spaces and then the proximos will add the space actually I will add the space here but just write all this without spaces and let leave the proximals to figure out what's what anyway if you enter something wrong proximus will complain at you at the first second or so as soon as you try to run the container because programs will scan this file in the blink of an eye and just gonna say something is wrong So Right Now www next cloud data Mr P files and I'm just going to delete all this empty space and let's hit Ctrl o to right enter to confirm Ctrl X to close and now the container is ready to start just right click and say start I can open the log page I can don't even need to open the log page if something wrong with my config file I won't be able to see this I will get error straight away within like half a second as soon as you press run so let's login root and the password and right now if I write DF space Dash h is showing me that this location is Mount pointed with 32 gigabytes of storage to this location and this location 1.032 gigabytes to this location if you're not a web ZFS shares the same storage with everyone so admin and MRP not magically just receive 32 gigabytes each they basically have a bucket that is 32 gigabytes and Mr P can use third of it and I will use all of it or we're going to use half and half it's not like magically each of them received 32 gigs it's just a pot a bucket a big box which is 52 gigabytes in size and they're sharing the sharing the um the storage so now if I'm gonna go and log in I can refresh this powerful should be able to pick it up this video live so admin let's login and uh okay I'm entered the password incorrectly and I'll show you the error if you just gonna say because I know there's gonna be an error so I'm inside this uh I'm going to say create the folder let's say subscribe and error I cannot create the Subscribe folder because once you mount point the ZFS into the Container it's um it still uses the original permissions which is the root and root to double check you can navigate inside the bar www next Cloud Dash data and now if I'm gonna list all the content as you can see all these belongs to a user by the name of www.data and the group www.data to double check if you write or not do not to double check but to check the ID number of the user if you put ID and then space username this all is 33 33 33 and then it's 112 it's just for Regis Regis so 33 is the user ID and 33 is the group ID if I'll navigate inside the username folder admin and check the owner of the files it's actually root and root is not 533 and that's why I cannot write the files to change the the permission so let's do this again so files as you can see it belongs to root I need to write CH own so c h o w n space I like to write Dash r to do recursive I know the file the folder is empty but just this is a habit just Dash R it means the folder and everything inside that folder it's any files or any subfolders millions of folders down all of them will be recursively changed of ownership now you can enter like this and then do it like this or if you know ID number just do like this 53 colon 33 and name of the folder in my case it's going to be files press enter and Now list the content as you can see this one right now belongs to www.data back in the next slide I'm gonna just refresh and we'll try again subscribe please and file the file folder being created if I'm going back inside my proxmox and I'll navigate inside my ZFS which in this is this this is the one I need to go inside this data set so CD tank next Cloud admin I have the folder created subscribe please and the owner belongs to www.data so it's it's right now fine if I'll create a file here for example any file using a root touch test for example I get the root and root and once the next Cloud automatically rescans the folder I this user that I'm right now logged in here I won't be able to delete this file because it belongs root and root so just to make sure it's not messy here I'm just gonna remove this file not to get confused so subscribe please it belongs to next cloud and that's it so next thing what we need to do obviously do the same thing with the Mr P because his files folder it belongs to root and root so CH own Dash r 33 feet 53 and then do files and that's it and right now if I do LS space Dash L it belongs to the first uh to Mr P so Mr P can obviously go and start creating files with no problems at all I will delete subscribe please and next thing what I want to show you if I click on a uh a basically is admin and Mr P will have M here I'm going to click on Administration settings scroll down all the way to the left hand side and click on the systems or system as you can see nextflow detected that we're actually using ZFS and not somewhere where the wonderful folders somewhere located inside the proximos so in this case as you can see admin the mount point this is the way it is file system CFS size 30 gigabytes Plus 30.5 30.5 getting speak U is one percent use one percent so right now it's basically ish detected that is using the right thing and is all singing and dancing and your next cloud is running perfectly and we link to next Cloud to cloudflare Tunnel that means I can use nextcloud.mrpcloud.uk to access my next load Instant but if you want to restrict all that things let's say restrict only to a specific IP address or only to a specific country or only with a specific email address to stepplification can access your next Cloud all the shenanigans I demonstrated inside the video about cloudflare and the proxbox I'll leave a link to that video in description below but that's it I I hope you enjoyed this lengthy video is almost 40 minutes of me recording this probably I'm gonna cut a couple of bits out of this video at the end it's gonna be much shorter than 40 minutes anyway thank you very much for watching I hope you enjoyed this video how to set up the next Cloud how to link ZFS data sets into the next cloud and how to link next log to cloudflare to access your own personal cloud storage from anywhere in the world thank you much for watching and I hope you enjoyed this video and we'll see you in the next oh by the way don't forget to subscribe
Info
Channel: MRP
Views: 34,228
Rating: undefined out of 5
Keywords: how to use samsung dex mode, how to use samsung dex, how to use dex, how to use dex mode, samsung dex tips and tricks
Id: N5S3w-Z9Xvw
Channel Id: undefined
Length: 34min 0sec (2040 seconds)
Published: Thu May 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.