Getting Started with Proxmox Containers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video we're going to talk a little bit about proxmox containers and even go so far as to set up a base proxmox container for faster deployment of future containers in the future but first a quick message from today's video sponsor this episode is sponsored by lenode the largest independent cloud computing provider if you don't want to or can't for whatever reason self-host applications the way we talk about on this channel lenode provides virtual servers that make it easy and affordable for you to host anything in the cloud you can set up any of the applications that they have available in their marketplace with just a few clicks or you can set up your own docker vps and install basically whatever you'd like in a docker container they have load balancers and firewalls available to help keep your apps online and safe if you run into any trouble getting set up lenode comes with amazing 24 7 customer support by phone or ticket along with hundreds of guides and tutorials to help you get started sign up today at lenovo.com and get a 100 60 day credit on your new lenot account links are in the description so in this video we're going to be using the proxmox instance that we set up in our previous video here and when we're dealing with proxmox there's kind of just a couple of basic ways to uh to deploy things in proxmox that's either via a virtual machine which allows us to set up a virtual computer and install an entire operating system on it and deploy it that way or if we want a smaller image and be able to deploy things we can use things called proxmox containers now the thing that i like about proxmox containers is that you can kind of think of them similarly to docker containers in that it's not an entire operating system that you're installing you're actually sharing resources like the kernel of the host operating systems proxmox with each of your individual containers and in in return you're actually making your your containers that you're that you're setting up smaller and more lightweight they don't need as many resources to run because they're sharing resources again like the kernel with the host operating system in this case proxmox so with proxmox vms or virtual machines you could install stuff like open media vault or windows or a linux desktop or whatever you wanted to install whereas containers are more purpose built in most cases in fact if we actually take a look this is my production proxmox environment and i currently have uh one two three four five containers set up on it currently only three of them are running i've got one for the website dbtech.com i've got one for dbtech.fans and then i've got one called pi alert that i was kind of testing out uh so it's just kind of sitting there it's off it's not running but it's still technically there and then i've also got my template container and that's what i want to show how to set up in this video so the reason i like the idea of having a template that i have pre-built for my own needs actually stems back to when i was a website developer uh i've mentioned this in the past i originally kind of got started using joomla in the 1.0 days and then in the joomla 1.5 days i was still doing that further moving on to a wordpress later on and after building websites for a while i realized that it was more beneficial and more time saving for me to have a base template to work off of so i built my own custom joomla joomla and wordpress themes so that i would have kind of a base foundation that i was familiar with because i built it i knew the ins and outs of it i knew what i could and couldn't do with it so we can actually do something very very similar with that or similar to that rather with proxmox containers so let me show you kind of what i mean by that so when we come up to the top right hand corner of the screen we've got documentation create vm or virtual machine or create ct or create container if i click on create container our first screen here is just kind of general information starting with what node do you want this to be on because we've only got one node set up that's all we've got access to so we'll just click that our our container id uh some people like to categorize you know different types of containers with different with different numbers basically maybe you'll have you know all of your your just little one-off linux containers uh set up with uh a 100 or maybe you've got more complex stuff like maybe you've built a container for next cloud or something like that you want to you want to set that aside and have a different identifier just for quick reference you can absolutely change container ids to fit your needs they don't need to be anything special uh just put in a number there that means something to you uh whether it's again for categorization or just some other number for so you'll remember what that is for so uh below that we've got a host name i'm just going to call this template uh just again to keep things simple here uh next we've got a re well we've got unprivileged container privilege container going to nest it uh check those boxes accordingly i'm just going to leave these both checked because that's just how i need this to run right now our resource pool there's nothing in there so it's not i mean there's nothing there password this is going to be your root password so i'm going to go ahead and put that in and i'll enter it again in the public or the confirm password line there and then if you wanted to upload a public key an ssh key you could do that for authentication i'm not going to but you absolutely could with the next little section here next we've got this template icon or you can click next either of those will take you to the next screen so we'll click on template and we've got an option for where uh which uh storage option you want to look under we've just got local for this one and if we click here there's there's no template there so uh then the first thing we want to do before we actually start building a template is kind of get our base template information so let's take a look at how to do that so if we come over here to our local storage right here we've got some options for iso images or container templates uh if we click on iso images we can either upload an image or download an image from a url directly to the server either of those is how you would upload an image to your server for an iso image however again we want to use container templates so we can either upload again from uh from our local system we can download from a specific url or we can use a pre-built template here and we've got a few different options the first two are proxmox mail gateways and then we've got alpine center west arch linux alpine center west debian you can kind of get an idea there's a lot of different things going on in here in fact when we get down here to the turnkey section uh we've actually got pre-built um uh basically like pre-built containers already set up and ready to go for us uh you know we could we could do a type o three or a canvas lms a docuwiki a domain controller moodle bugzilla bugzilla uh laravel again lots and lots of pre-built things uh that you can just set up in fact i even believe there's like a there's next cloud in here there's wordpress in here a joomla own cloud lots of different options that you can just deploy quickly that is pre-built and that's fine um i'm not going to do that in this video we may take a look at that in a future video uh of course if there's a specific uh turnkey core image here that you'd like me to take a look at let me know in the comment section down below and we can make a video about some of those different uh different pre-built containers and kind of how they work so coming back to this we've got a couple of options here uh we could just take a base image you know whether it's alpine or debian or whatever and deploy a new container that way i actually like to look for a turnkey core image oops you know that's what i want type in core there so we've got turnkey core version 16.1-1 and we've got a turnkey asp.net core image i want to just use the basic turnkey core image uh in the past i've also used debian 10 and 11 either of those are fine it's just kind of depending on what it is you're trying to deploy pick the right image for your setup i again like to use turnkey core because it's very very lightweight so we're going to go ahead and click on download right here and then it's going to go through this process and at the bottom when it's ready it will say task okay so we'll wait for that to come up okay so it calculated the checksum it verified it everything there is good task okay so we're going to go ahead and close this and then what we'll do is we'll come back to up here to the top and click on create container again again i'm going to call this a template and i'll enter my username and password or my password twice rather because our username in this case will be root so once we've got that we can click on template and then we can come over here and select our debian 10 turnkey core 16.1-1 uh that's still compressed we can see our size here it's 206.79 megabytes so we're going to go ahead and select that and click next so here we've got the option for disks so uh the way i do things uh for for a template like this um i just leave this as either 8 or 16 gigs you can change this later if you need to let's just make this 16 gigs just so that we've got a little extra space and if we needed to we could add additional uh points of storage and we could just put that in like that again we could adjust we can adjust this we're not going to do the additional storage for this but this is showing how you could have additional drives available to your container if you needed it so we're going to go ahead and delete that we're going to have just 16 gigs of storage for our operating system here uh next we'll choose cpu again you can click cpu or next either of those will take you to the same place i'm going to give it two cores uh depending on what you're trying to deploy uh you may want to switch that to one or two depending again what your needs are for that particular thing um if we go to memory we can select how much memory we want each of our containers to have if we actually let me take a look at this i want to show something here so if we take a look this again this is my live production server uh where i've got uh dbtech.com and dbtech.fans um as well as an nginx proxy manager uh container that i needed for different projects so let's open that one first uh here we can see that i it's i've allocated 512 megabytes to this container as well as 512 gigs or 12 megs of storage or swap and then my boot size ridiculous i gave it 62 gigs i didn't need to do that uh so here we can see that i'm using 211 megs of my 512 megs of ram i'm using three and a half megs of my swap space and less than three gigs of my actual hard drive space for this container so this just kind of gives an idea of what an nginx proxy manager container might look like as far as resource usage is concerned but if we were to come over here to like dbtech.com this is running on book stack and again i've given it 512 megs of ram and swap and again 62 gigs of storage uh if we take a look again i'm using 273 megs of ram 39 megs of swap and uh three and a quarter gigs of hard drive space now of course because uh because ghost is a content management system that i'll be uploading pictures and and and other media to uh having 62 gigs here isn't necessarily a bad thing uh because again this will continue to grow as i upload more content to this system so giving this one that much space really isn't a big deal because i was kind of thinking ahead as far as what i was going to be putting on this particular container uh if we take a look at dbtech.fans uh this one uh again i gave this one one gig of ram uh because if we look we're actually using 619 megs 620 megs of ram here so i knew the 512 wouldn't work uh so i just doubled that and made sure i had plenty of overhead in case anything happened and i needed more so um below that i've got i'm using less than three megs of swap and again this is a content management system where i'll be uploading different forms of media so again yes i gave this one you know 62 gigs of storage and i'm already using about four three and a half to four gigs of that so uh so so when you're when you're creating containers think about what that container is going to be and allocate the resources for that container appropriately so that you don't oversell or undersell what you're going to need for that setup so if we come back over here to the container that we're building um i'm just going to leave this at 512 megs again this is going to be a template uh before we deploy it we can uh adjust values and i'll show you that here in just a moment as well uh for our network that's going to be next we can decide what we want our network uh device name to be so we're just gonna leave this as ether0 that's pretty standard uh we can set a mac address uh we can change our our our mode uh well just bridge mode is uh vbmr0 that's fine vlan tag if you were setting up vlans you could put that here uh we could rate limit uh the throughput for upload and download speeds um we can set our our ip address oh we've also got a firewall uh option there as well we've got an ipv4 static or dhcp address that's completely up to you um what i like to do it's a little weird but what i like to do is deploy via dhcp uh figure out what what uh what it's going to pull from the network and then change it to static and adjust it later that way i'm not trying to remember all of the different devices on my network and find an ip address uh appropriate for this i let the network figure it out and then and then adjust it in my system here later that's completely up to you how you want to handle that if you do this as static though you will want to enter an ipv4 gateway address again i'm going to change this to dhcp and that'll just get rid of that again ipv6 you can set that up if you want to i'm just going to leave it as it is here for dns i like to set up a couple of different dns hosts from different providers just in case one of them goes down i'll still have good dns um and i and and so then we can oops i gotta put in that last eight there and then we can click next then it's like hey this is what everything is going to look like are you sure this is what you want to do if you're good with that then you've got a couple more options you can say do i want to start this after it's created yes or no by checking the box and then once we're once we're happy with everything we can click on finished so it's going to go ahead and extract everything here and here in just a moment we'll be up and running and again it says task ok right there which tells us that this process has been completed so we can close this window if you'd like to get early access to my content you can head over to patreon become a channel member here on youtube or head over to dbtech.fans and any of those ways will help support the channel and give you early access to ad-free content and here we can see we've got a little uh green triangle little play button right there so we'll click that we'll click on console right here so it's going through it's kind of first a boot up process [Music] and now it says template login so now we can log into our instance here so what we'll do is type in uh root and then the password that we entered when we built this template and now we're logged in so because we're using a turnkey core image for this it's going to ask us some questions i'm just going to skip the hub services here [Music] system notifications and critical security alerts who should get that email i'm going to put in my email address now this won't always be the case if you were to do something just like debian 10 or debian 11 you wouldn't get this but because this is turnkey core uh they do have this kind of setup process so we'll go ahead and say enable uh is this email address correct yep so security updates do you want to do this uh it says you will need to be online i'm going to go ahead and install security updates so we'll just go ahead and click install now we are using a debian version 10 for the for the underlying os of turnkey core here uh so there will be some updates in fact quite a few more than it would be if we were using a debian 11 base for the turnkey core but that's not where this is this is still on version 10 so it'll have some updates to run okay so now we are good to go and we have got uh our our appliance services screen here we can see uh the web shell address the web bin address as well as the ssh sftp address here um and that's basically it now we are good to go so what we're going to do is uh click advanced menu and then we're going to go down here to quit and we're going to say yes and basically that's just going to take us back to our terminal screen here so we can there we go now we can just clear that screen and now we can get to work on actually setting up the services that we want to run in our template now if you've been watching this channel for a while you know that i like to use docker for a lot of things i like to containerize things uh just for easier management that sort of thing so that's what we want to get set up in this container or in this template container template i can get my words right here so what we're going to do is actually get docker and docker compose installed on our template here so that when we want to deploy another docker template later on we can just duplicate this and be ready to go in just a matter of moments rather than spending all of the time to go through all of the steps here to get uh docker installed i know this isn't a lot but it's tedious and i prefer to just be able to duplicate quickly and move on and get my stuff done as quickly and efficiently as possible so what we're going to do is come back over here and we're going to just run some commands here the first one will be oops we're going to do apt update like so uh this is just going to update our app repository so it says that there are 35 packages that can be upgraded so let's just go ahead and do that real quick okay so that says it is now done that's good let's clear our screen oops let's clear our screen again so what we're going to do is install a few things here we're going to install ca certificates curl new pg uh an lsb release so we'll hit enter and here we can see that everything is up and running everything there is good to go so the next thing we're going to do is actually uh download the docker key ring here for this so we're going to go ahead and enter there that's good to go and then we just want to get make sure that that is uh in the right place so we're going to go ahead and run this command like so and then we're going to do app oops update again okay all of that's good to go so the next thing we're going to do is make sure that we've got uh docker ce doctor ces cli uh containered and the docker compose plug-in we're gonna go ahead and get all of that installed okay so now it says that that is all done so again we'll clean up clear our screen we'll do docker ps and here we go now we can see that docker is running so we'll do docker compose dash v oops i forgot this is a new version of docker compose oh there we go a version oops like that here we are we're on docker compose version 2.5.0 so that's basically all the further we're going to go in this video uh because that's the gist of creating a container so basically what we did was we we went in here and we set up the parameters for the new container we dictated uh which base os it was going to use uh we set up all of you know the the ram and the cpu and all of that sort of thing we configured it we then did all of its updates all of its upgrades and we installed docker and docker compose and all of the stuff that we need for docker to run so the next thing we actually want to do here is uh basically do a uh uh shutdown now and hit enter so now it's going to go and and basically i safely shut down the system and then over here on the left hand side once that goes away we're good to go so moving forward if we ever want to um quickly deploy a new container this way what we can do is right click it click clone and again here we are we can uh we can set our target node our our container id our host name um we're going to say a template uh demo our resource pool we're not going to do anything with and then we can decide where we want our target storage to be i'm going to say storage there and i'm going to click clone so we're going to give this a moment to do what it needs to do here so once this is done we can click on our new container here go to resources and then we can go to like memory for instance and click edit and we can say you know what i want i want a gig of memory there and our swap at 512 is fine uh we can come over here to uh our root disk and click um edit oops nope i lied we can't click edit we're going to close that what we can do though is click on resize disk and then we can say how much bigger do we want it to be so let's make it let's make it a total of 32 gigs so we're going to the size increment we'll click on resize and here we can see task okay and then right here we can see that now it is 32 gigs instead of uh 16. uh you can move the volume if you want to do that and then basically once we're once we're happy with all of this we can come over here right click click on start then we click on console we'll give this a moment and just that quickly we're up and running so check this out we're going to log in as root so we type in docker compose version here and hit enter there we go now we've got docker composer version 2.5 which means that it actually took the the previous instance that we that we had set up earlier with all of its updates and upgrades and and the docker compose stuff that we installed and the docker stuff in general that we installed and just duplicated it redeployed it now we're up and ready to go uh to deploy uh whatever uh docker stuff we want to deploy in this container and it's not just docker that you can do this with but that's what we use a lot on this channel so i wanted to give an example of how we could quickly deploy a new docker server basically in a virtual or a container on proxmox here of course you could set up multiple uh different templates if you wanted to um you know you might add additional things to your template you know like whether it's watchtower or pertainer or whatever it is that you know you're going to want to use on your uh upcoming containers you might deploy now the caveat to that is if you if you like when if i were to go back to template 100 and add portainer to that that will not go back and retroactively add that to our template demo number 101. um it has already duplicated it it's not going to continue to reduplicate anytime you add to the originals so that's something to keep in mind as well um so if you add something to your template it won't automatically update all of the the containers that you built from that template i hope that makes sense but that's that's kind of the quick gist on on how i like to use uh proxmox containers and templates within containers to quickly deploy new containers uh using the template that i already built so hopefully you found this video informative helpful whatever if you did do me a favor give the video a thumbs up that would really help me out quite a bit i will have links to everything in the description down below of course there are other things in the description down below where you can support the channel if you found the video helpful and wanted to do that there's also now a thank you button under this video of course there's a subscribe button under this video if you'd like to do that uh with all of that said i think i'm gonna go ahead and wrap this up and i hope you guys have a great rest of your day thanks for spending a few minutes of it with me and i will talk to you in the next video so let's take a look at another way to download container templates so earlier i showed this process of coming in here going to templates and downloading them from from this list right here the other way we can do this is come over to uh to our node here go to our shell we can do pv oops p v a m update and we can do a p v a m available and this will show basically the exact same thing we saw in the other screen but this is of course doing it via command line in our shell here and of course we can then select any of these that we would like just for the sake of doing this let's do a debian uh 11 standard here so i'm just going to right click on that click copy i'm going to scroll back down you know what i'm going to i'm going to clear my screen just to make it a little easier i'm going to do p v e a m download uh then you can choose where you'd like to download it too i'm gonna say local and then i'm going to paste in uh the the uh the image id there or the image name and i'm gonna hit enter so now it's going through the process of downloading everything that we need here all right it calculated our checksum everything there looks good so now if we come back over to our local that we just downloaded this to right here come over to local right there now we have debian 10 turnkey core that we had originally as well as now a debian 11 standard so that's just an alternate way to download container templates on your system
Info
Channel: DB Tech
Views: 77,506
Rating: undefined out of 5
Keywords: proxmox getting started, proxmox, proxmox ve, proxmox tutorial, proxmox virtual environment, containers, proxmox ve tutorial, proxmox ve 7.0, proxmox install, proxmox 7 tutorial, proxmox virtual environment tutorial, container, how to get started with proxmox, proxmox step by step, get started with proxmox and home assistant, proxmox containers, docker containers in proxmox, docker containers on proxmox, install proxmox, proxmox docker in container
Id: ksvoWpyWHUY
Channel Id: undefined
Length: 25min 8sec (1508 seconds)
Published: Tue May 24 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.