Setting up DOCKER (Ubuntu) VM inside PROXMOX | PROXMOX Home Server | Home Lab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and thank you much for watching this is me Mr P and this is another episode in the proxmox Home Server series in this video I'll show you how you can virtualize Ubuntu server and we're going to use that Ubuntu server to host all our Docker containers so this in this video I'll show you how you how to set up a Ubuntu Server virtual machine inside the proxmox how to install how to install the docker Docker compose and how to link a Nas or SMB search SMB share to the docker to or to that Docker Ubuntu VM to have a persistent storage for some of the docker containers not all the token containers will have a persistent storage but most of them will do and like for example Plex you want to store the media somewhere else not inside the docker not inside the VM that will run the docker because it's just the storage will blow up so that makes sense to have media folder all your Linux ISO somewhere else like on a on a Nas or basic SMB share so my setup is quite simple from all the previous videos I gave you I demonstrated all the different setups and Etc I reduced all down to two so one is the cloud play cloudflare tunnel to be exact and this runs Cloud fraternal and links to my cloud for cloudflare account and I have the domain assigned to this so it's mrpcloud.uk and as you can see here it says PBE Dash YT so if I hit the subdomain I will get to the my portina to my proxbox and next one is the nas this is a file server LFC container runs here I've done a video for both of them how to get those set up in previous videos I'll leave a links to those videos in description below for you to go and get Sims setup as you can see here right now and this is pretty much the file server lxc container running webmin and I have server setup with ZFS and ZFS is two drives that are attached to this proxmox so if I click here as you can see there is a ZFS or Z pool by the name of tank and that is two Drive 256 gigabyte drives and as assigned to the this proxbox and the two drives if I go in Shell inside and write ZFS CFS list one of them is tank proxmox or data set proxmox and number one is data set data so proxbox is re-linked back to proxmox and this acts like my backups ISO file a location CT template location and rest of the stuff and the data is being um map point or Mount pointed to the file server Alexi container into MNT slash ZFS and if I click here and I'll show you quickly if I go to mount in CFS and this is the folder so pretty much all this what I'm just demonstrating you already did the videos about it so this is the setup that I'm gonna use from now on basically just a cloud flip get my sub domains going and some sort of the nas you can use two NAS if you want I've done a video about trueness as well but this is just gonna be my starting point two containers two lxc container simple easy containers nothing fancy 512 megabytes on this and 512 megabytes on that and both of them has one core and that's it so let's start setting up ourselves the Ubuntu server to get Ubuntu server ISO files I'll leave a link in description below which will take you to this page you just click on the downloads and get Ubuntu Server click on this big blue a big blue big green button and wait for a second for pop-up to show up because it's just gonna try to go automatically download to your local machine after five seconds I'm just gonna cancel that and then right click on a done mode copy link address go back to a proxbox select the storage where I keep my aiso files the load from URL or if you download your local machine you just click upload and then select the file from here I'm just gonna do the director mode if I click query the URL this is the file will be saved you can rename this to say just Ubuntu server Dash 22-04 and delete the rest of the stuff if you want and leave like this I already downloaded this file as you can see it's here and that's the one we're going to use we're gonna use to get the Ubuntu setup so to set up the VM I'm just going to click on the big blue button here says create VM incremented number to 102 and 100 used 101 is used the 102 is just fine and now give it a name I will give I will name it Docker YT that will represent the docker containers and everything that runs inside OS select the storage where you keep is it local or whatever else you have mine one is called ZFS and this is the drive we're going to use and the systems everything stays by default and the disks 32 gigabytes is okay to have about let's say up to 10 15 containers with um persistent storage to being somewhere else I suggest you have at least if you if your system allows 64 gigabytes because some of the stuff will will start accumulating if you're going to run 30 to 40 containers that stuff will adds up and obviously please don't forget that each container will have to have an image or Docker image and so that means like if you have 30 containers and each image is gigabyte in size so that's 30 gigabytes Already Gone without even adding any of your own data I know that this VM will run inside SSD so I'm gonna click SSD and this card I will write this because it is SSD so I want to make sure that it's going to be most optimal read and write performance everything else by default and the CPU I suggest to start with 4 minimum four two is okay two is okay as well 4 is the minimum action I'm going to leave a 2 just to show you how everything performs memory if you click Advanced options here at the bottom make sure that you for you to see both of them if you have make sure you put 40s 96 and 2040 here so that means it's going to be a Boolean device is going to fluctuate the RAM usage between these two and minimum memory you're just forcing the system never use less than two gigabytes of RAM Network everything stays by default and config everything is fine I'm just gonna click finish and wait right now for proxmox to get everything set up done you can see the docker VM has been created so I'm just gonna click on that and press start now so let's wait for Docker for Ubuntu Server VM to start here we go so it tells me that this automatic will select this in 25 seconds or so I'm just going to use arrow keys to make sure that is selected and press enter and right now the Ubuntu Server VM will do the initial setup process that will take 10 seconds or so so let's wait for that to finish and here we are I've been presented with a setup a screen I will select English brackets UK press enter check if the keyboard layout is correct and then make sure that done is selected in green color press enter and now it's telling me which one which which base uh which kind of style of Ubuntu so I want to install do you want to install everything do you want to install the minimal or and then search install the the third party drivers I'm going to use Ubuntu Server you can install a Ubuntu Server minimized that means it's just going to install a base minimum stuff for Ubuntu server to function but then in the future you're going to have to install a lot of things yourself manually so we're just going to install everything uh as what by default Ubuntu Server provides make sure that done is selected and press enter will be given is 157 that's fine press enter proxy address there is no proxy address so I'm going to press enter Now searching the the default mirror address and checking if everything is fine with this let's wait for this to finish that's it this mirror application passed the test press enter and now very important thing make sure you deselect the setup this disk as a lvm group you select this as you can see it's a blinking underscore and icon here press space and deselect that one when I was installing this for very first time and I left this by default I wasn't getting all the 64 gigabytes I was getting about half of that probably a bit less than half so make sure you select that and make sure and that will give all the storage to Ubuntu server without breaking the disk into different partitions and now I'll use arrow keys to go down to done and press enter and that's it gives you a quick brief information exactly what's going to happen so it's going to delete the install format and Etc and then we're going to use all or almost all 64 gigabytes because it's going to use some of them for the buyers and other things so 63.9 select the done press enter and it tells you you really want to do this I'm going to say yes continue and press enter your name give it the name for your for the um like for what's what give it the nickname or name of the of them this system then what's the survey name will be Docker Dash YT username will be Mr P and password I just ran into something simple something something simple simple what the word simple can speak anyway it's done is selected everything is filled press enter and now it shows you do you want to basically um go with enable Ubuntu Pro I'm just going to skip for now and press enter make sure you select install SSH because you want to SSH into the system once it's all set up and running it's going to be much easier to go by SSH client than going by this web GUI because you can't paste copy and paste stuff from your let's say website's GitHub GitHub and others into this um screen because proxbox will not allow so install open SSH server select done and press enter is give you a couple of programs as a suggestion to install during this installation process you can see there is a Docker here I will install Docker myself manually I'm not going to select this I'm just going to go all the way down to the done and press enter and now installation started this will take about two minutes or so wait for installation to finish and one installation is finished you will notice below the view full log is going to be reboot now option your installation process is going to say cancel update and reboot don't select that wait for actual IQ this one cancel update and reboot wait for actual brackets and reboot now option showing up so I'll be back when this option shows up here the option showed up so it says reboot now I'm gonna go all the way down here press enter and now Ubuntu Server will complain that ISO file is still mounted you just press enter on that and Ubuntu Server will restart so while this is restarting we can get ourselves the terminal running and now you can see there is a bunch of stuff happening with SSH Keys Etc and it feels like it's actually stopped and maybe crashed but it's it's waiting for you to a press and enter if I press enter I get the docker Dash way T login screen and I can log in from here so Mr P and the password I gave it and IP address was 157 so I can jump into my SSH and just write Mr P in an AP address local AP address of this DM is it was in 157 yes it was press enter accept the fingerprint and that's it I am logged in into this VM so right now quick uh thing you need to do on the first login onto this visual machine is after date and after the grade you need to write sudo because this is a user not a super user so and double one percent sudo after grade Dash Y and run that provide your password and that's it and right now it's going to get all the stuff done so let's wait for this to finish with Ubuntu Server when you're installing updating packages it's going to ask you do you want to restart certain Services I'm just going to leave this selected by default and press OK or select okay press enter and that's it the update and upgrade has been done next step let's install Docker and Docker compose so again sudo apt install Docker Space Docker Dash compose space Dash y to Auto accept the prompts and let's wait for this to get all installed again I get that message saying do you want to restart this I'm going to just select okay and that's it Docker is installed to double check if I type Docker Dash V I'll get the version so Docker is installed and I think Docker Dash V on compose should give me a Docker compost version as well so version information showing up that means the docker and Docker compose is installed first thing or next thing what we need to do is get our self-portainer running portena is a web GUI interface to manage your Docker containers inside the app inside the server obviously you can go and start doing all these things with your Docker compose commands inside CLI I found that some of the things I still do inside the terminal others I prefer to use portina because everything is much easier to read and understand what's what's this what is linked to what so we're going to use portena for managing to manage our Docker containers first we need to get ourselves the docker compose.yml file created as we're going to use Docker compose to initialize the pertainer container I I'm logged in as a user so home slash in the username in my case is Mr Beam I will create a folder which is going to be called Docker and I will change directory to Docker so all the stuff that I will use in the future for Docker containers and Etc will be located in this folder in here I need to create a folder called portana and in the future if I want to run another container or something it's just I'm gonna just start creating a folders inside this folder representing each of the containers change director to portena and inside here we need to do a couple of things first of all make directory for Dana Dash data this is where portena container will store the data Rhymes a bit and next one is we need to do touch and then write docker compose.nl so we have a Docker compose yml file and we have the contain a folder to where pertainable store this data now let's amend or I'll edit the docker compose dot yml file using Nano and I will copy and paste the docker compose instructions and I'll leave those in the description below for you to go copy and paste as well so pretty much this is the docker compose instructions instructions and written inside the yaml format the spaces and indentations that are important for yaml file so we're going to use the docker compose version three we're going to run service or it says services but we're going to run service it says Services because you can add add more below if you want to so let's say it's going to be something here like pie hole and then carry on setting everything up so we're going to run service called portena we're going to use this image so we're going to use a portana the Community Edition the latest version container name will be 14 now you can rename it you can change to whatever you want restart will be unless stopped so of course Docker will attempt to restart the container if this crashes but if you as an admin will physically stock this container it will basically stay stopped Security Options no privileges so that means container will not get any privileges to uh host volumes these two um is going to retrieve the information from the docker so it's obviously going to take the real time and then get all the information from the docker and this is dot slash patina data that's why we created this folder to store pertain the data and Dot means this current folder and this is a subfolder and port number nine thousand eight thousand I suggest that to leave as it is this is by default widely known port for portena so 9000 on the host side and 9000 inside the docker so leave this as a nine thousand eight thousand so that's it I press Ctrl X to close y to right enter to confirm and if like cat or cat this Pro File out I'll get all this output showing up here that means that file has been saved and make sure that portana data data not date needs to be written so that's a that's a good double check so it's going to be pertainer data so I misspelled the date of this word so make sure that it says 14 and data and that's it so right now we are ready to run this to run the the container using um Docker compose file you need to run like this I'm going to do a sudo Docker compose up Dash D that means I'm going to use a super user permissions and I'm initializing Docker compose command once this command is initialized it's going to go and look inside this folder between all these files and folders if and try to find exactly this name you're gonna try to find the docker Dash compose dot for ML file as soon as it's fine this file is going to start it or initialize that's what it up is is here for and space Dash this means it's going to run in a background without taking giving over data in the front screen press enter and if I done everything correctly it should start pulling the information pulling the docker image image in chunks and it says at the end it says Docker container creating portina done to double check that's definitely running I can write sudo Docker PS and this gives me a Docker and then gives me all the containers that's running so it says container created 10 seconds ago status status is 10 seconds running and Etc if I run this command again as you can see it's it's incremental increases in time so everything is fine is running if something is happens with the installation instead of up 23 seconds you might see it says restarting and then in Brackets it's going to be one two five or whatever the number in Brackets this means ask how many times the docker try to restart the container so this is running I can go back in the browser into the AP address of the of this VM followed by the 9000 not 900. 9000 AP address and here we go this is the portena initial setup screen is asking me to create a password 12 characters or more so let's quickly create a password you can change the name I'll I'm just going to keep this as admin I always keep a default users and admin for proteinas so you can change it to something more secure something that you like instead of being an admin and then create the user and now I need to select get started because I'm not connecting this to any environment or anything this is a standalone protein I'm going to click get started and that's it this is the portino dashboard we can close the latest news here and that's it this is all running next thing what I need to do is just do a bit of housekeeping it says local I want to change that to something else I click on vitamins click on the local and this is the name I'm going to name it Docker Dash YT and it says public AP address right now which gives nothing I suggest to enter the public AP address or IP address of the VM and that will help you out in the future when you want to access the containers so for example I entered that one here if I click update I go to Stacks portana as you can see there's a port 9000 and if miles over here under the bottom left hand corner you should see the showing up the AP address and then colon 9000 if I left nothing in here if this wasn't in here every time that I try to click on the port this AP address here on the bottom here left hand corner will show 0.0.0.0 Cola 9000. so by clicking that it will not work so that's it this 14 is running next thing what we're gonna do in this video is link the SMB to this VM to make sure the docker will utilize the persistent storage if I go to my sample share if I click on a service and Sample sharing I have a ZFS folder being shared via Samba I already show there is a already done a video file service how to share these folders how to everything needs to set up if you're using true Nas you need to get the go through two network two NAS sample configuration to share a folder so I'm using a ZFS for this so right now I'm gonna go back inside the terminal and first thing what I need to do is need to make sure that the tools called sip utils are installed to do that I'm just going to type sudo apt install Sif statutils and sips you tools are responsible to connect in Samba share to this VM and it says which where which one do you want to go and then just defaults that's okay is it sit view tools are installed if I type CD space tilde that will take me to my home directory from anywhere if as soon as you type this it's going to take you back to home directory and now I will create a folder here called Nas so I have the folder called The Nest created here if I'm navigating to Nas the location of this folder pwds means Print Work directory so it prints the output exactly your location so home Mr Penis that's where we're going to mount this in next thing I need to make sure that I know the nas uh IP address I'll go back to my Alexa container that runs file server if I type IP space a I can see this is 51. go back to terminal and sudo Nano ATC ATC FS tab so sudo using super user I'm using command Nano or text editor Nano and I'm amending FS tab FS tab is a file system file that represents that responsible for auto mounting stuff to your system so we're gonna add this one here we're going to make a space let's say Nas so double slash 192 168 178 51 the IP address of the nas slash ZFS I need to put exactly the same um capital letters Etc actually no share name is lowercase are further than this in the uppercase so we're going to use a lowercase now space and then location where you want to mount it in my case it's home Mr P Nas space what kind of file system I'm going to use we're going to use cifs space user and that means that I'm going to use user login credentials and now you can you can link to a hidden file for your credentials I'm just gonna put them in a plain text so I need to put user equals and what the username and then user and then password what the password is so in my case is going to be Mr pm123 qw comma no perm no payment means that no permissions will be changed between during the connection between the host and the samba and all the files will not change the permission once they've been uploaded to a Samba and vice versa and that is it so if I press Ctrl X to close y to right enter to confirm another thing with the Nano let's say I'm I will edit something here if I press Ctrl o and press enter it will write the file but it will not close the file now I need to press Ctrl X to close it so now if I done everything correctly if I put sudo Space Mountain a that means that I'm running super user of command as a super user I'm running the command Mount and it says Dash a is Auto Mount press enter and has given me a message says permission not working so let me go and check what's going on I found what the problem is my configurations inside the semi file server wasn't really fully completed so I had to just enable the um Mr P user to access Samba so I just gonna run this command again so sudo Mount space Dash a press enter no errors and if I type DF space Dash H I should be able to see that this folder is actually linked to this folder or to this location inside the samba and it's over 240 gigabytes in size so right now from now on every Docker container that I will run I can go and represent or send the send the permission data or persistent data admin can come on I can't even remember this password now that's not good here we go I mean so every container right now that I'm gonna run I can choose where do I want to store data let's say for example if I go into containers actually on the stack container there is right now linked to the Mount volume is linked to local location which is this I can actually go right now and replace that to be actually linked into the uh into assembership but for for protein it's not required it's more things for like a Plex and other Docker containers that requires or will store a lot and a lot of data right now I can push that to be stored inside my NASA instead of being inside my Docker container which is limited to 64 gigabytes in size so this is how we set up Ubuntu Server VM inside your proxbox and how to set up Docker Docker compose and a portana in next videos we're going to start setting up some amazing containers that are quite useful for your home Labs situated for for your home lab setup I can't speak anymore anyway thank you much for watching I hope you enjoyed this video and I'll see you in the next one goodbye
Info
Channel: MRP
Views: 6,247
Rating: undefined out of 5
Keywords: docker, docker-compoe, ubuntu server cm, proxmox, PVE, proxmox 8, portainer, setting up docker vm inside proxmox, docker inside ubuntu server, ubuntu server live 22.04, homelab, self-hosting, proxmox home server
Id: ElF1ZC4al2Q
Channel Id: undefined
Length: 26min 21sec (1581 seconds)
Published: Mon Sep 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.