Setting Up NextCloud on Docker w/ NGINX and CloudFlare for Remote Access!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys how's it going hope everybody's doing well out there today uh recently i've been getting quite a few comments about next cloud it was one of the first videos i did uh using uh docker and portainer and that sort of thing i also in that first video or first a couple of videos using next cloud used traffic uh as a reverse proxy for it and i've since switched to nginx proxy manager i've had several questions about setting up with nginx proxy manager just lots and lots of questions about cloudflare in general so in this video we're going to take another look at nexcloud using nginx proxy manager and cloudflare to uh to manage traffic that sort of thing but first let's pay some bills and take a look at today's video sponsor yourcdk.com is a great place to get windows 10 keys at incredibly low prices so here we are on the microsoft windows 10 pro page and right here you can see the current price is 20 and 5 cents but if you use the coupon code that's in the description down below you'll get it even cheaper so i'm going to go ahead and paste that in here and click apply and now our new total for windows 10 pro is about 15 bucks now i have the option to go ahead and view the keys right here so i'm going to go ahead and click on that then i'll click on get the key and then i'm going to come over here and right there you can change the product key so go ahead and click on that i'm going to go ahead and change the product key right here so i've entered my key and i'll click next then i'll click on activate and here we can see the windows is activated next what we want to do is go ahead and validate the key installation and right there you can see the windows 10 professional edition is permanently activated so head on over to yourcdk.com to get your next windows 10 pro key at ridiculously low prices so here we are on my desktop and this is next cloud i definitely encourage you to go check out their website uh for more information about next cloud to see if next club will fit your needs uh of course if you want to check out nexcloud and docker docker is a great way to do exactly that so here we are again i will have links to this in the description down below if you want to check out their website but uh the first thing we're gonna do is actually just jump straight over to portainer of course this video does assume that you have uh docker and portainer installed uh that you're familiar with nginx proxy manager and cloudflare i will have links to all of that in the description down below uh if you want to check out those videos to get caught up and be up to speed for this video so uh here we are in portainer uh we're gonna come over here to stacks uh and right here we're just going to add a new stack and then i'm going to come over to here in my little screen off uh off of here oops let's just copy that and we're just going to paste this in here so this is a docker composer a docker or a pertainers stack however you want to term term that that's fine they're effectively the same thing just used a little differently so uh up here we're gonna have a version two uh we're gonna have a couple of volumes one for next cloud and one for the database i'm actually gonna copy that volume just paste that in there uh so we're gonna need volumes for both of those uh both of those uh containers we have a container for next cloud the application and maria database uh to to manage everything so uh here you can see that below that our services are going to be db for database and then below that our image will be the maria database now this database if you're trying to follow along with a raspberry pi this database will not work you'll need to change that to something that is compatible with raspberry pi uh below that restart always you could probably switch that to unless stopped but always is just fine um the command below that uh typically it kind of just stops uh right there however when i was doing some testing on this to see what the differences were uh from you know a couple of years ago when i first uploaded next cloud videos uh to now there were some changes in the way the the setup process went and i ran into an issue so i uh found a solution for that issue and added it which is actually just this part right here i'll have links to the solution in there and in the description as well so you can kind of see why i went the route i did uh below that we've got volumes i'm just going to delete that that space there so volume for the database uh was actually declared right here you're going to need that if you you could mount that to a specific path though i i don't recommend it there's no need for it you don't need to get in there and modify the database for for any reason i can think of below that we're going to have some environmental variables to access the database so we're going to set up the root password the mysql password the database name and the database user all of those are declared right here in these environmental variables and we're going to use some of those to actually make the connection in our next container below that of course our app will be uh next cloud uh also we're gonna restart that as always the ports uh you can change this 8888 to whatever you'd like it to be um but just make sure that if you do change it um you only change the 8888 portion of things uh leave this 80 on the end right here that's the internal port that the container needs so don't change that part but you can definitely change this part to whatever you need it to be oops wow that's wow holy cow like so um and below that we're going to link to the database that's just going to make them connect to each other uh our volume for this also we've declared this next cloud volume uh up here uh in the volumes up at the top um you again you could mount this to a different path or a specific path if you wanted needed to um but there's no real benefit to that there's no need for you to get in there and mess with the actual files that make up next cloud um so just leaving it as a volume uh as i'm showing here is is probably preferred to be completely honest um below that and then don't change don't change anything uh after that colon there those need those are internal uh to the container don't change those uh below that of course you've got our mysql password that was actually declared up here so make sure if you change this you should change this whatever you change this to change it down here as well so that those match uh below that we've got the database uh we'll be next cloud again declared up here user declared up here and the mysql host was actually declared up here as the service name there so that's all we're doing there and that that's really it that's all we need to do in order to deploy next cloud via portain or now i will say that if we come over here i do have this downloaded already and we can see that the maria database is a little over 400 megs and the next cloud image is about 940 megs so just just so that you know you're going to be downloading about a gig or gig and a half of data in order to get an xcloud up and running on your docker server so just wanted to be aware of that so we'll go ahead and close that window uh really that's all we need to do here uh we're gonna go ahead and scroll down to the bottom where it says deploy the stack we're just gonna click that hang out for a minute and let it do its thing whether it's gotta download or just deploy whatever the case is we'll give this a minute to pop up and get ready okay so here we are we're back next cloud looks like it's up and running so we're going to go ahead and open this up and see it looks like this is working just fine i don't see any errors in there other than this we haven't set the server name so it's going to have an error message it doesn't matter uh and then down here we'll take a look at database um looks like this all looks good so what we want to do next is click over here like so now if you click that those ports and you don't get anything what you'll want to do is actually come over here to environments uh no i lied where is it nope nope nope i can never remember where the heck this thing is it might be it is oh it wasn't environments i was right i just was looking down uh so right up here uh this public ip change this to whatever your server ip address is which you can see i write up here um if that's not there it'll be like 0.0.0.0 it won't load it'll be a mess so make sure you update uh your your local environment details there uh in order to get uh that to work when you click on the ports so now here's the thing if you just want to run this locally you don't want it to have you don't want it to be accessible from the internet uh all you've got to do at this point is create a username and password for your admin account uh you can decide whether or not you want to install recommended apps completely up to you and then you can click finish setup however that will complicate things if you want to access it from the internet later you you can there there's some files you can edit to make that work but if you're just going to do a local install you can just you can create your admin account and be done with it uh right now i i'm only on this address to make sure everything works the way we want it to what we really want to do next is come over to cloudflare again this is i run all of my internet traffic coming to my house uh through self-hosting everything gets run through cloudflare for their for their faster dns for their ddos protection for their firewall rules all of that stuff comes with their free accounts so uh so i've been using cloudflare literally for more than a decade now um and and i recommend that you do the same so you can see i've already got my my dnv.wtf domain name it's pointed to my home ip address which i've got blurred there and i've already created an ssl in nginx proxy manager you can actually see that right here this dot wtf you can see that i've only got it expiring a year from now roughly rather than the 15 years on some of these others so uh what we're going to do is add a record and we're going to change this to a cname record and i'm just going to do nc uh so it'll be nc.dnb.wtf very very short domain name there and we're just gonna do at right there and because i've already got a domain name or sorry because i already got a an ssl setup from cloudflare installed into nginx proxy manager i did a video on that i'll have that link in the description as well i can leave this as proxied uh if you don't have a custom ssl installed in nginx proxy manager you'll want to set this to dns only and then click save we'll come back and switch this to proxy later um if you're if you're not doing or if you don't have an ssl installed but but this is what we're going to do so i'm going to click save so now i've got nc.dmp.wtf set up and ready to go there so our next step will be to come over here to nginx proxy manager go to hosts go to proxy hosts add a new proxy host the scheme because we're only using we're not using a self-signed certificate in the container we want to leave this scheme as http if you were using a container that had a built-in as a self-signed certificate you would change that support or to https and point to that port but we're not so we won't um so the uh forward uh so so the ip address that this is actually hosted on locally is 192.168.1.183 and the forward port that we put that on will be 88.88 like so we're gonna block common exploits uh we're going to allow for websocket support uh then we're gonna come over to ssl oops oh i lied i need to put that in right there uh i've got this on dark mode and i didn't actually see that so make sure you put your domain name in right there uh your your scheme your ip address your port uh block common exploits websocket support go over here to ssl uh we're gonna drop that down to our dmp wtf ssl or whatever your ssl is i'm gonna go ahead and enable those and click save so now if i click this hopefully there we go so i'm going to create a username this will be the admin account here i'm going to be original and do the same thing i do for all of my demo videos here i'm going to uncheck that um you can leave that checked if you want to install recommended apps like calendar calendar or calendar contacts talk mail and collaborative editing if you need those things leave that box checked if you don't uncheck it it'll save some time getting into your app we're gonna click finish setup here and because it didn't immediately throw an error that's actually a really really good sign we're just going to hang out with it for this to finish uh it's setup process and then we'll come back and take a look a few moments later okay so here we are just a couple of minutes later it's gone ahead and set everything up and here is the introduction screen that you can take a look at if you want kind of go through and get familiar with next cloud on your own self-hosted server here i've already done that so i'm not going to worry about it i'm going to go ahead and close this and here we can see that we're up and running so the next thing i want to do is actually jump over here and go to settings and we're going to take a look at some stuff now originally when we when we did this a year and a half two years ago whatever there were there were some differences here uh what we want to take a look at specifically is down here i think under settings right here the memory limit uh they've increased that to 512 i believe max execution time is about 6 minutes or 36 an hour sorry an hour 3 600 seconds um and the upload max size used to be two megabytes they've changed that thank you to netcloud for changing that 512 megs really do appreciate that however if you need to change that for some reason uh if you're if you're going to be uploading very very large files gigs of data here there are some changes you'll want to make and let's take a look at that just real quick so what we're going to do is actually come back over here to pertainer we're going to go to our containers here we're going to go to the next cloud app uh whatever it happens to be named for you we're gonna come right over here to this exact console uh we're gonna click connect and right here we can see that uh we're in the var slash www.html this is kind of the root of the application so what i want to do is an ls dash a like so and here you can see all of the dot files like dot htaccess.user.ini and those are files you wouldn't have seen otherwise so that's why that dash a is important what we want to do is actually edit the htaccess file in order to do that i like to use nano unfortunately though if i do nano dot ht access command not found so we're going to do uh apt update so it's exactly right here where my camera stopped recording and i didn't notice so i'm going to make the best of this situation as much as i can and we'll just move forward from here without my dumb face on the camera for a bit and then i found a package that can be updated that's fine you can update that if you want uh in fact we'll just go ahead and do what i suppose upgrade um and then we'll say yes we'll give this a minute this this is gonna freeze here for a minute and you're gonna think hey it froze it's stuck it's not give it a minute uh it just takes a while i get stuck at this 20 for a few minutes in some cases and then it proceeds like nothing nothing bad happens so uh when this is finished we'll come back one eternity later and there we go so now that's all updated so what we want to do now is do apt uh in oops and install nano oops wow i am just on one this morning apt not update app install there we go there we go so now we can come up here to nano ht access and uh there's a bunch of stuff in here that you could if you needed to modify um like so but there's a ton of stuff in here now we're going to add some lines of this you can add them to the top or the bottom doesn't really matter i'm just for the sake of simplicity going to add them to the top and i'm just going to right click and paste that in there so let's take a look at this we've updated the uh the value for the memory limit from 512 mags to two gigs now if you don't have two gigs of data or sorry two gigs of ram available to your container don't set it that high set it to something that's appropriate for your setup uh below that we've got a max upload size of 16 gigs uh sorry a max file size of 16 gigs plus a post max size of 16 gigs that's kind of like the combined total upload and then a max input time and a max execution time of 3 600 seconds uh once we've got all of that we can press ctrl o and enter and control x to save and exit and then what we want to do is come back to containers and just restart this app container right here this should restart very very quickly uh there we go uh so now if we come back over here and refresh now our memory limit is two gigs and our max file or max size right here is 16 gigs so that's how we managed to do that with the htaccess file uh now there is a chance that if there's an update to the application in the future there will be uh there's a chance that uh this htaccess over or could be overwritten so in that case you may want to manually map an htaccess file in your volumes for the application that's completely up to you i just want to show one way of manipulating the htaccess file to get uh more memory and bigger uploads so that's what we've got going on there um do i'm trying to think if there's anything else specific um oh in fact so so when we come here i'm actually glad i clicked on overview there right here um okay so it's recommended to enable hsts uh you can actually do that in cloudflare through uh through the settings in here sit in here ssl tls i actually want to switch that to full uh switch there we go edge certificates enable hsts let's go ahead and do that i understand next and then we can just come in here and enable um these things like so and click save and then we've got hsts enabled that's good so then what we can do is actually come back to nginx proxy manager uh go down to this and click on edit and ssl and enable and enable and click save and then in theory what we'll want to do is actually we'll close that and come back over here and refresh this sorry restart this like so we'll give this a minute to do its thing and if i refresh this oops there it goes we'll give this a second to uh to check that again well i don't know why it's not recommending that uh you can you can change this uh in probably the htaccess file if you need to um but everything else here should be good to go we're all up to date um you can change who you want to notify about updates that sort of thing in here support i think different ways to get support if you need one or if you need it basic settings uh if you wanted to uh of course i encourage you to set up an email server uh i use gmail for for my uh server stuff so that's what i would put in here um there may be an issue at some point with uh the the site starting to slow down a little bit uh because by default this is set to ajax now if you've got a an active if you've got several people in here all of the time doing stuff this shouldn't be an issue however if you're just kind of using this as a phone backup and you just get in here every once in a while it could start slowing down and you may want to switch to either a webcron or a chron system in order to uh have it run background tasks automatically um i've i've made that video in the past i'll try to link to that in this in the description down below as well sharing let's see uh lots of different settings in here you can go through uh to fit your needs uh security enables uh two-factor authentication enable server for site encryption um you can do that if you'd like theming um i i i definitely encourage this i hate that there's no dark theme by default in here you can change that if you want to though um so there's definitely some stuff in there uh personal info of course this will be like my account this is under the personal section uh so all of your personal information can go in here um you may let's see let's go back to the homepage here just real quick set weather we're going to do like so and then i bet it's going to do celsius by default nope let's do a colorado springs colorado let's try that all right so it is nine and a half c and that doesn't work for me uh i'm i i'm american and i don't do celsius very well so what you can do is actually come over here switch this to english or whatever refresh the page and then switch this back to um united states probably down here somewhere right there like so and then if we come back over and refresh uh it should there we go uh now it's showing in fahrenheit fahrenheit and that's how you can switch that up that was something that i struggled with for a while to figure out how to do of course you can customize this to do i mean basically whatever you want to do uh you know whatever you want to do for backgrounds and and widgets and things like that you can get more widgets if you want to do that all kinds of great stuff in here whereas you can set up notifications for uh for or set up what notifications you want to get mobile and desktop of course there are apps for both of those things if you want to do that i highly encourage that very easy to set up accessibility um so you can enable like oh there's dark theme let's do that there we go so much better um so so i'm glad there's that i actually dig that they've got a dyslexic font or a font for dyslexics i guess people with dyslexia uh for being inclusive here um and so you can enable that if you want to uh sharing of course is always in here but so there is the basics on how to get next cloud installed on your docker server using portainer as well as a little uh a little tweak to the command to make sure that we don't get a database error when we're trying to get things set up hopefully this video has been helpful if it has been do me a favor give the video a thumbs up really would mean a lot to me and lets me know that you're interested in this kind of content uh but i think that kind of wraps up what i wanted to talk about as far as getting next cloud setup and docker using portainer and nginx proxy manager and cloudflare uh for the additional security uh and and internet access to your application there so um again everything will be linked in the description down below lots of links in the description in this one unfortunately or fortunately depending on how you look at it uh of course while you're down there there will be a few different ways you can support the channel whether it's through channel memberships patreon paypal whatever totally up to you not at all expect it of course um but i think uh with all that being said i'm gonna go ahead and wrap this up as always thanks for your time i always appreciate your support and i'll talk to you in the next video [Music] you
Info
Channel: DB Tech
Views: 7,657
Rating: undefined out of 5
Keywords: How to Install a NextCloud on Docker, Install a NextCloud on Docker, NextCloud on Docker, dbtech, DB Tech, install nextcloud on docker, nextcloud remote access, nextcloud remote access with NGINX Proxy Manager, nextcloud nginx proxy manager, setup nextcloud with nginx proxy manager
Id: Wj0SsbRbCNo
Channel Id: undefined
Length: 22min 27sec (1347 seconds)
Published: Tue Nov 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.