Default Proxmox Container Template.
Part 1:Creating the container.
In the Proxmox control panel - Select ‘Create CT’ to open the ‘Create: LXC Container’ Wizard.
Note : If any option boxes have a coloured border, they are mandatory, any other options can be left as default.
General: – fill in as required, I usually leave it all as is,except add a password and confirm.
Template: - make sure the correct storage is selected, where you store your templates, then below select the template you want to use. I will use Debian 12 Bookworm.
Disks: - leave as default (this can be changed later).
CPU: - leave as default (this can be changed later).
Memory: - leave as default (this can be changed later).
Network: - you can use DHCP, but I prefer to set a static IPv4 Address and Gateway. I don’t use Ipv6 (leave blank).
DNS: - leave as default (this can be changed later).
Confirm: - check all settings are correct or go back and change. When happy check the ‘Start after created’ box, then click ‘Finish’.
When you see ‘TASK OK’, you can close this panel and open a console. Make sure you have highlighted the correct container in the far left menu and click on ‘>_console’ in the next panel or just below to ‘Create CT’ button.
You now have a bare bones container. Login in as root with the password you set.
Part 2: Setup the container.
Check for updates: - once logged in: type apt update && apt upgrade -y
Install any dependencies: apt install sudo wget git curl -y
Add your User: - adduser <username> (replace <username> with your own username) and follow the prompts.
Add User to sudo Group: - adduser <username> sudo
Now you can log out by typing exit and login as your user.
Part 3: Converting to Template.
If you are now finished setting up the Container, you can convert it to a template ready to clone at a later date.
In the Proxmox Control Panel, shutdown the container.
Right click on the dead container and select ‘convert to template’.
When done, the right click menu will only have two options -
‘Migrate’ or ‘Clone’. (You can only use ‘Migrate’ if you have a cluster with more than one node).
Part 4: Creating Container from Template.
When ready to create a container, select ‘Clone’ and it will create the container with the next available number. You will need to edit the new containers hostname and ip settings in the main Proxmox Panel.
Part 5: Optional Extras.
ADGuardHome is a self hosted ad blocker and local DNS server.
To Install: (All on one line)
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
Access with:
http//:container-ip-address:3000
Neofetch can help identify the container when you login.
sudo apt install neofetch -y
then add to the bash script to run automatically
sudo nano ~/.bashrc
then add to the bottom of the file, neofetch , then close save & close
the file with: Ctrl+O enter Ctrl+X. Now everytime you login, you will see information about the Container OS.
Add Cockpit to help with maintainance of the container.
sudo apt install cockpit -y
When installed, you will be able to access Cockpit with the IP address and port :9090.
If you don’t want the use port :9090, you can change it.
Start by creating the directory:
sudo mkdir -p /etc/systemd/system/cockpit.socket.d/
Then create the configuration file:
sudo nano /etc/systemd/system/cockpit.socket.d/listen.conf
Then paste into the configuration file:
[Socket] ListenStream= ListenStream=443
then close save & close the file with: Ctrl+O enter Ctrl+X.
Now you can access cockpit on port :443 instead of :9090.
In a web browser goto:
https://github.com/45Drives/cockpit-navigator
Find the Releases section and click the link.
In the next page, right-click on the .deb and copy link address.
In the console type wget and paste in the link address to upload the file to the container.
In the console enter: sudo dkpg -i *.deb
Now refresh the browser page to see file manager in Cockpit.
Note: If you intend to use the NFS option, you will need to use a full VM instead of a Container, as a VM has it’s own Kernel to run the NFS Service.