Skip to main content

Getting Started with Containers

In this post/video we'll look at downloading Proxmox container images and setting up our own base image to deploy future containers more quickly.

There are a couple of ways to download images.

From the GUI

Get logged into your Proxmox interface and head over to the storage node labeled "local".

Then click the "CT Templates" option in the next column over.

Next, click the "Templates" button near the top of the screen. On the screen that pops up, you can select any of the images that are available and download it.

Note: You can also upload your own templates here if you'd like.

From the Command-Line

SSH into your Proxmox server and run the following commands:

pveam update
pveam available

This will update your repository and then show you what is available. Copy the name of the template you'd like to download and then run the following command:

pveam download local <image name>

Once the screen says "Task OK" you're good to go!

Building an Template

Once you have your template downloaded to your system, you can then click the "Create CT" button near the top right of the screen and fill out the different fields in the screen that pops up.

During this process, you'll be asked to give the container an ID, a hostname, select the template you'd like to use, how much RAM and hard drive space you'd like to use, as well as a few additional things.

Luckily Proxmox has made it very simple to set up a Container.

Once you've made all your selections, you can create your container and then start it up.

Configuring Your Template

Now go back to the left column in Proxmox and find and click the new template you created. Now right click it and click "Start". Then click the "Console" option and you can see a terminal screen where you can login as root with the password you provided during the setup process.

I like to use Docker for my containers, so here are the commands I used to set up Docker in my container template:

apt update
apt install \ca-certificates \curl \gnupg \lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Once that's been completed, your base Docker template is ready to go. You can, of course, customize this by adding things like Portainer or Watchtower or whatever you'd like your base template to have.

You can then run the command

shutdown now

and then clone your container any time you'd like to quickly deploy an new Docker template.