Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Install Proxmox On Debian 12

Introduction

This tutorial will shown you how to install Proxmox on a freshly installed Debian 12 server. This may itself be a virtual machine, or a dedicated box.

Steps

Configure Hosts File

The hostname of your machine must be resolvable from the /etc/hosts file to the IP of your server. E.g if you are on an internal LAN, this would mean the IP address would be something like 192.168.0.45 rather than 127.0.0.1 or 127.0.1.1. You should still have localhost pointing to 127.0.0.1 though.

An example /etc/hosts file would be:

127.0.0.1       localhost
192.168.0.23   proxmox1.programster.org proxmox1

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

To test this, run the following command:

hostname --ip-address

Check the output is your server's IP and not 127.0.0.1.

Install Repository, Kernel, and Reboot

Run the chained command below in order to install the proxmox repository, use it to install the Proxmox modified version of the kernel, and reboot.

sudo apt update \
  && sudo apt install wget -y \
  && sudo wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg \
  && sudo echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription" \
  | sudo tee /etc/apt/sources.list.d/pve-install-repo.list \
  && sudo apt update \
  && sudo apt full-upgrade -y \
  && sudo apt install -y proxmox-default-kernel \
  && sudo reboot

Install Packages And Remove Old Kernel

Once your server has rebooted, run the following command to install the proxmox-ve software and some additional packages it requires. This will also remove the original kernel and remove os-prober which is normally used for dual booting systems, but can cause issues with partitions from virtual machines.

sudo apt install -y proxmox-ve postfix open-iscsi chrony \
  && sudo apt remove linux-image-amd64 'linux-image-6.1*' -y \
  && sudo update-grub \
  && sudo apt remove os-prober -y

When you get the postfix configuration setup page, you probably want to select "No configuration" if you are unsure. Otherwise, you probably want to configure the use of one of your SMTP servers. I will leave that with you.

Log In

You can now log into your proxmox VM with the root user and its password. Just navigate to:

https://my-proxmox-vm-ip-or-hostname:8006/

... and specify the username root with whatever the root user's password is.

Notes For Installing In A DigitlOcean Instance

Package Installation Issue

When I first created this tutorial, I set up and configured Proxmox inside a virtual machine on my KVM server, which all worked perfectly. Whilst testing this on DigitalOcean (using the 4GB RAM "Premium AMD" instance), I noticed that I hit the following error:

... which was resolved simply by rebooting again and then running:

sudo dpkg --configure -a

This resolved the issue, and Proxmox was running inside my VM.

Root Login

Proxmox expects you to log in with the root user by default. Since used an SSH key for setup, rather than a password, I had to manually set a password for the root user, and changed the SSH configuration value for PermitRootLogin to "prohibit-password" rather than "yes". Make sure to set a strong password, and/or possibly set up an IP whitelist on port 8006 so only your IPs can access it.

Networking Issue

I then ran into issues to do with setting up the internal network for the LXC containers to use in this environment as I can't just use a simple bridge like I did on my home LAN. I am looking into this and will be publishing separately.

Notes For Installing In An AWS EC2 Instance

Package Installation Issue

When I first created this tutorial, I set up and configured Proxmox inside a virtual machine on my KVM server, which all worked perfectly. Whilst testing this on DigitalOcean (using the 4GB RAM "Premium AMD" instance), I noticed that I hit the following error:

... which was resolved simply by rebooting again and then running:

sudo dpkg --configure -a

This resolved the issue, and Proxmox was running inside my VM.

Root Login

Proxmox expects you to log in with the root user by default. Since used an SSH key for setup, rather than a password, I had to manually set a password for the root user, and changed the SSH configuration value for PermitRootLogin to "no". Make sure to set a strong password, and/or possibly set up an IP whitelist on port 8006 so only your IPs can access it.

Networking Setup

This will be covered in a separate post.

References

Last updated: 17th June 2024
First published: 16th June 2024