install docker – compose – portainer in LXC

Choosing a template for your LXC

  1. click on your local drive in Proxmox and click on CT Templates on the right pane.
  2. I like to use Ubuntu-22.04-standard bet you are free to use what your like some will not work click on download and we are ready here.
  3. Alway test this first under a new Proxmox installation or a test machine!!

Making the Proxmox LXC container.

  1. Click create CT to make a new container and follow the below examples the hostname can be what you want and remember the password you give it >>>> Next.
  1. Select the CT Template you just uploaded >>>> Next.
  1. Select the disk you want to use for your container the size you choose what you want, But REMEMBER you can always make it bigger but not smaler >>>> Next.
  1. For the CPU choose minimum 2 cores and Memory 4096 will be sufficient you can always change it later. For the Network you choose DHCP and next until you created the Container.
  2. Check the settings bellow >>>> Finish

Starting up your container and installing docker.

  1. select console and click start the container should boot up login with ROOT and your password you typed in before.
  1. First we are going to update our container wit he following command
apt update && apt upgrade -y

Install Docker and Docker Compose

  1. Copy and past the following code inside the console
apt install docker.io curl -y
curl -SL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Installing Portainer

  1. Portainer is an open-source management tool that allows users to easily manage their Docker environments. It provides a simple and intuitive web-based user interface for managing Docker containers, images, networks, and volumes, as well as the ability to deploy and manage stacks. Portainer also has built-in support for managing multiple Docker environments, making it a useful tool for both development and production environments.
  2. Copy again the code below to install Portainer.
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
  1. Thats it now we have to lookup the IP address so you can open portainer in a browser window
  2. Type Clear to clear the console and type “ip a” to list your current network configuration see below.
  1. Open a new browser window and type in the following address : Https:// <your IP> :9443 you will see the following screen, put in a new user and password and click Create User.
  1. You are now logged in to your Portainer see below.

Thats it you are now ready to deploy some more docker containers inside a Proxmox LXC

The following links will help you on your way

Docker

Docker Hub a repository of 1000+ docker programs

Docker Compose

Portainer

3149