Installing Docker Portainer and PiHole

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys perculator in this video we're going to be continuing setting up our home lab the goal is to set up Docker painer and py hole we are going to set up Docker and painer because they're quite useful in a home lab and allows us to set up many services simply and cleanly the first service we are going to be deploying will be py hole this will be a whole network ad block of sorts and it also gives us an easy way to set up local DNS I prefer this to other Solutions due to it being simple and having quite a bit of experience with it in the last video we set up a VM and I showed you how to create not shots or backups of that VM the first thing that we'd like to go ahead and do is go ahead and make sure we have a good snapshot of that VM so we would like to go to the docker container as we named it and go down to backup in here you should go ahead and hit backup now and go ahead and create a snapshot if you have not already done so this will be a good place to come back if you really mess something up and not W to reprovision the entire VM now that we have a backup we can go ahead and start working on installing Docker onto this VM what we need to do first is make sure the VM is running in order to do this we click the VM and go over to console in here you should see something such as this where it'll say perculator at Thundercracker in our case now what we' like to do is go ahead and SSH into this machine so that we can go ahead and start installing Docker in order to ssh in this machine you can use something like putty if you're on Windows but in my case since we're on Linux I'm just go ahead and use my command line and we're going to go ahead and run SSH perculator at 192.168.0.0 because this is the IP address of that machine when profit go ahead and enter the password of the user in which we're logging in as and you'll get the welcome message that we've gotten in the past now I'm going to go ahead and make sure that we are up to date and we're going to go ahead and run pseudo at update and and pseudo at DIS upgrade after this it will be prompted with a password enter the password and we're going to go ahead and make sure we're nice and up to date before we get started now that we know that everything is up to date we can go ahead and work on installing Docker in order to do this we're going to head over over to the doer website on the doer website we're going to be using the section that says install using the AP repository so what we're going to do is we're going to go ahead and copy and paste this into our terminal and go ahead and run this command now copying and pasting things off the internet is not generally a good idea but since this is from the docker official documentation it should be fine what this script does is it goes ahead and adds the official gpg keys from Docker and then after that it adds the repo to the AP sources so all we're going to do is paste that in and press enter after this is done we should are have the repos ready to go now that it's done installing we can head back over to the website and we can scroll down to where it says install Docker packages here we can install the latest Docker version by copy and pasting this command this will go ahead and install the lace doer version as well as Docker compose if you get a pop up go ahead and press enter now that took a few seconds after we've done that we're going to go ahead and run back over to the website and we're going to grab this last command this command verifies that Docker engine has been installed successfully by running the hello world image so in order to do that we'll head back over to our terminal and we'll go ahead and paste this in and press enter as you can see it will pull the command and to generate this missions it took the following steps and hello from Docker if you see the hello from Docker we know what we got we were successful in this installation now that we have Docker installed successfully we're going to go ahead and install painer in order to do this we're going to head over to the portano website which I'll have Linked In the video description in here there's a introduction as well as how to deploy it you may want to read over all of this and I would highly recommend doing so the thing which we need to do first is go ahead and create a Docker volume in order to do this we're going to go to Docker volume create painer data this is where painer will be storing all the data for Rainer and all its containers that it needs now I've already R this command and as you see we get an issue that says Docker volume create and then after that we get a permission deny the reason being is we need to add the user to the docker group the user being percolator if not we need to run this as pseudo if you run this as pseudo it will work or we can add us to ourselves to the docker User Group the docker user group was already created for us however if it was not you can type in the pseudo group add and then the name of the group that you like to add in our case would be Docker and as you can see it already exists for us so since it already exists all we need to do is add our user so to do this we do pseudo user mod d a capital G Docker and the username or you can use user now we should be added in order to make this apply we need to go ahead and exit and we need to go ahead and log back in this will refresh our connection and now we should be part of the docker group check this we can do ID and as you can see down bottom at 99 we are part of the docker group now that we're part of the docker group we can go ahead and run that command we did earlier Docker volume create painer data now it creates the painer data unlike earlier now that we have the painer data created we can go down here to download and set up the portainer uh Docker instance and there's two versions there's business and Community we're going to be using Community today because I don't want to get into setting up the business version um and all you're going to do is go ahead and paste in that command and press enter once you press enter it'll go ahead and pull all what it needs in order to set up that Docker container now that we have painer running all we need to do is head over to our web browser open a new tab and go to our IP address followed by the port the port in this case would be colon 9443 and in this command we set it as uh 9443 right here so you can go to that port in order to access your portainer instance so once we do that we press enter and we'll get the security warning just like we did in proxmox and all the other things since we don't have certificates yet press Advanced go to accept the risk and continue and you'll be brought to portainer from here we can go ahead and set up portainer the username password and password I'm going to go ahead and create these off camera so that I'll have them in a bit Warden for easy use now that I have the password and the username set up in my bit Warden I can autofill and we're going go ahead and create user once the user is created you'll be met with this menu and you'll see nothing here in order to get something you need to go ahead and hit get started once hit get started you'll see your local instance we can go ahead and click on our local instance and this will show you all the information that we have about our local instance this is all the information that we have on the docker stack in which we're running on the local machine from here we can go ahead and click the containers button over here and we can see that we have two containers running locally now this container right here practical whatever should be the hello world container image and as we can tell it is if we want to go ahead and get rid of that we can check the box and go ahead and hit remove we can go ahead and also hit the little box says automatically remove non-persistent volumes and hit remove now we don't have that painer that t container taking up space on our system now we have painer and Docker up and running here you can install whatever Docker images you would like and you can use portainer to manage and deploy them easily we're going to go ahead and move on to installing py hole from here the first step to install P hole is to head over to the P hole website p.net from here go ahead and click Docker install and then we're going to go ahead and scroll up to where we see quick start go ahead and copy this and go over here portainer and press stack go ahead and press add stack and then we're going to give it P hole as its name and paste this in now later we're going to come back and edit this file but first there's a problem that's going to happen if we go ahead and try to deploy the stack whenever hit deploy stack we're going to get a huge error over here this eror is going to say at the very end listening tcp4 0000 colon 53 bind addresses already in use in order to fix this we're going to head back over to the P hole GitHub where we got the thing from and we're going to scroll down to where we find uh Fedora and auntu now that we found installing auntu and Fedora we're going to ahead and copy this first command I would rly recommend reading over this so you understand exactly what's happening here but it's uh has something to do with system D resolve which is normally used to Cache DNS uh sub resolver but we're going to be moving over to here and pasting this command in it will probably prompt you uh to enter your pseudo password here after that we're going to go down to copy the next command which is here and then paste it in after that we're going to go ahead and restart the service so we're going to go ahead and do that now uh It'll ask for password if you do not do it as pseudo so I'm going to go ahead and do it as a pseudo user um after that we're going to go ahead and go edit the uh net plan now in order to edit our net plan we're going to head over to our terminal and we're going to go pseudo nano-c dnet plan 00- install DC configure gam once in here we're going to head down to address and we're going to get rid of both of these addresses and what we have in our case these are both the Google DNS and we're going to set this to our local address so how we do that is press space and we're going to do square bracket 127.0.0.1 .1 and then square bracket from here we go ahead and press CR o press enter and press CR X now all we have to do is apply so in order to do this we do pseudo at plan apply that should apply all of our net plan settings and we should be okay to continue our installation of P hole now that we're ready to install P hole after fixing that error we can go over to the quick start guide copy this and go back over to Stacks like we had before and paste in as well as giving it a name once we have that pasted in we can go ahead and start editing this so that it's better for what we're going to be using it for in my case I'm not going to be using the ACP so I'm going to go ahead and remove this line and I want to go ahead and change the port that I access the py hole own to 8080 instead of 80 I don't necessarily want anything to be on Port 80 I would like everything to be on other ports so we're just going to use port 8080 for the time zone I'm going to go ahead and change this to New York after setting the time zone we have one last field we need to go ahead and change and that is the web password you can go ahead and remove this and you can go ahead and set this as it says to a secure password or it will be random i prer setting my own password because I use bit Wen but you may like to let it set it and then just grab the password from it but in my case I'm going to set to my biten password for now we're just going to set it to password after we have our password set we can go down to uh deploy the stack go ahead and press to play the stack and we shouldn't have that error we should now have a success whereas before we had that error now in order to access our P hole instance we can open a new tab and go to the IP address of the server 1 192.168.0.0 in my case and we can go to Port 80 this will give us a forbidden thing so how you normally fix this in py hole is you do slash admin this will bring you to the correct page now um I had a little bit of an issue with this just going to the right p and doing the SL admin thing is normally how you get to it from here I'm going to enter my password and click the button says remember me for 7even days now I'm going to be showing you how to add a block list I'm only going to be showing you how to add one block list but if you want to add 100 it'll be the same process or if you want to add three it'll be the same process I don't recommend blocking everything because if you do it's pretty hard to get to websites that are blocked so in order to do this I'm going to be using fire block. net this is a list of block list and it's a big list of block list that are all pretty all right generally the ones in green won't get you in trouble the blue are a little bit more it might break some things on the internet and the ones that are scored through you probably shouldn't use also at the bottom there's some Whit list suggestions I would definitely go ahead and Whit list all of these and I'll show you how to Whit list uh the short URL shorteners as well as there is a uh commonly wh listed domain under commonly Whit listed domains there are a bunch of commonly wh listed domains I'd recommend adding these if you need them it's kind of up to you if you need them or not if things on your internet start to break and you can't get to certain websites you may want to go through here and check to see if any of these could fix it so in order to add a block list we're going to go ahead and head over to fireless blog and or fire blog. net and we're just go ahead and add this top one we're ahead and copy it and we're going to go to py Hole once in py hole we're going to go to add list and add list the address we're going to go ahead and paste in the link if you want to add these in bulk you can separate them by space and in the comment I normally just add where I got it from so in this case I'm going to do fire block once you've done that you can go ahead and press add and it'll be added to your block list however does this not mean that it's actually working in order to update this in order to make it work you need to update your gravity in order to update gravity you go over here to tools and you go to update gravity once you're in update gravity you hit the big update button and if you have a lot it'll take a while if you're only updating one like in this case you'll have success after just a few seconds once you've done that you can head over to dashboard and you can see that the number of domains on our ad list have went up and that means we're going to be blocking more stuff block lists are good and all but in order to use them we actually have to set it as our default DNS address in order to do this we're going to head over to our router in my case I'm using open sense if you're not using open sense then this part of the tutorial will not be very useful for you what I'd recommend doing is looking up the model of the router that you're using and find out how to set up your DNS now after you find out how to do that you need to go ahead and change it in my case we would go to Services ACP version 4 land and then under DNS we set this to the IP address of our new DNS server in our case it would be 1 192.168.0 do30 but for you it may be something different after this we go down to press save and after it's saved this should propag out out through dacp based off of however long your lease is back inside of P hole we can check that we're actually using our DNS by going over here to total quaries and clicking active clients under active clients I see a few IP addresses and I just happen to know that this IP address is the IP address of my local Machine by head over to my local machines terminal and I do IP addr I can see that my IP address is listed right here and is91 and as we can see that matches this IP address meaning that DNS is now set to fle another important step that we need to do is go through our prox boox and tras installs and make sure that they have the correct DNS set up because they're static IP addresses I need to make sure that they're actually set to the right DNS since dccp can't propagate out through things that aren't using DCP so in this case we're going to head over to Megatron we're going to go to DNS and we're going to go to edit now when I set up this server initially I could have set this to 1 192.168.0.1 and as soon as it updated in my router it would have updated here but I had it set to 8.8.8.8 and you can also set it to 192.168.0.0 however if this IP address was to ever change you would have to update it again so it is better to go ahead and set this to the one address and just set it to our router in my case some routers won't like the setting and they would much prefer you to set it directly to the DNS if you're using py hole you just kind of have to play with it sometimes this can be an issue I did have a router once before that setting it to the router's IP address would never actually get me to the uh the py hole instance so in this case it should be fine however so we're going to go ahead and press okay once we've done that we're going to go over here and go to updates and press refresh press okay and as long as you're getting gets or hits you should be fine after that you can go ahead and check by updating and in this case we may update later now to update the DNS in trass all you need to do is go to trass network Global configuration and click settings and then under the DNS servers you can set the DNS server here in my case it's already set to 192.168.0.1 but if you were had to set it to 8.8.8.8 then you could update it now and go ahead and move it over to point towards your router now one issue I like to go ahead and mention is if you're using your router own all of your static IP addresses as we are doing in proxmox and an tras by setting it to 192.168.0.1 then all of those will only show up as one IP address and that will be the IP address of the Gateway so in this case it will be 192.168.0.1 and that's fine however it does make it a little bit hard to track down which machine is actually quartering what own DNS the last thing that we're going be looking at inside of py hole is setting up local DNS in order to do this we're going to go to the left hand side go down to local DNS and click DNS records in here we have two fields to fill out one being the IPS the other being the domain the domain that we're going to be using is going to be thunder cracker.com and we're going to go over to IP address and we're going to go enter the IP address of both the painer and the P hole since they're both running on the same machine under different containers we can access both of them by entering the same address so 192.168 0.30 once that's done we can go and press add we can copy the domain hit open new tab and it won't work why is that well that's because it's not on the right ports because your web browser default looks at 4 80 and Port 443 and we've changed those so we need to go ahead and give it the port so in order to get to the painer instance we go ahead and give it a colon 9 443 once we've done that we can press enter and we get the security risk ahead go ahead and accept that and we end up in our portainer instance It'll ask us to log in since this is also the same thing that we are own for uh our py hole instance we can go ahead and enter the P hole and then go admin and go to oh it's not https we need to get rid of that excuse me and it'll take a spy hole that's kind of the use of local DNS is that you can set your own local DNS record so you don't have to remember IP addresses you can just remember the names of what you're using Docker painer and py hole are all Staples in home labing projects I use quite often now that we have them set up feel free to play with them and Tinker I would recommend creating a snapshot of your VM in case you would like to roll back from an accident that you may or may not have in the next video we will be setting up engine reverse proxy with wild card Sears if you enjoy this video please like comment and subscribe it helps motivate me to make more content also let me know how I can improve my content going forward
Info
Channel: Perkelator
Views: 11,459
Rating: undefined out of 5
Keywords:
Id: yCNggtbC_NY
Channel Id: undefined
Length: 19min 53sec (1193 seconds)
Published: Wed Oct 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.