How to Install Proxmox Virtual Environment on a Dedicated Server
This tutorial is going to show you how to install Proxmox VE on a dedicated server. Proxmox VE (Virtual Environment) is an open-source virtual platform based on Debian. It allows you to easily create virtual machines and containers in a graphical web-based interface.
Proxmox Features
- web-based administration interface.
- Full virtualization (KVM)
- Supports containers
- live migration: move running VM from one physical host to another without downtime.
- pre-installed applications. Up and running within a few seconds.
- Proxmox uses OVMF (Open Virtual Machine Firmware), which is a port of Intel’s open-source TianoCore UEFI implementation, to enable UEFI support for Virtual Machines.
Prerequisites
- You need a physical server or dedicated server to install Proxmox. It’s not meant to be installed inside a VM.
- You also need a clean hard disk, because all partitions and data on the hard disk will be removed by Proxmox during installation.
Step 1: Download Proxmox VE ISO Image
Go to the Proxmox download page, and download the Proxmox VE 6.2 ISO installer. The latest stable version is 6.2, which is based on Debian 10 buster.
Once downloaded, you can create a bootable USB stick using tools like Etcher or Rufus. If your dedicated server has a remote web-based management interface like IPMI, then simply log in and insert the ISO file to the virtual drive.
Step 2: Lauch the Proxmox VE Installer
Reboot your server and use the BIOS/UEFI interface to boot it from the Proxmox ISO. When the Proxmox ISO installer shows up, press Enter
to install it.
Then agree to the Proxmox license agreement.
Next, choose the target hard disk. The following screenshot shows a VirtualBox hard disk, which is for teaching purposes only. You will need to select a big hard disk in production environment. Note that all partitions and data on the hard disk will be removed.
Then select your country, time zone, and keyboard layout.
Create a password and enter your email address.
Next, configure network settings.
After that, Proxmox will give you a summary to review. If everything is ok, click the Install button.
Once the installation is complete, reboot your server.
Step 3: The Web-Based Admin Interface
The web-based admin interface is available at https://server-ip-address:8006
. Because it’s using a self-signed TLS certificate, you need to add security exception in your web browser.
The default username is root
. The password is the one you set when installing Proxmox. Note: You can also use this username and password for SSH login.
Proxmox might tell you that you don’t have a valid subscription. If you don’t need a paid subscription, simply ignore this message.
Step 4: Create Your First VM (Virtual Machine)
First, you need to upload ISO image files to Proxmox by going to Datacenter -> pve -> local(pve) -> Content -> Upload.
Then select an ISO image file from your local hard drive.
Once the ISO image file is uploaded, click the Create VM button on the upper-right corner.
A setup wizard will appear. On the General
tab, give your VM a name and click Next.
On the OS
tab, select your ISO image file.
On the System
tab, simply accept the default values and click Next.
On the Hard Disk tab, you can change the VM disk size.
On the CPU
tab, enter the number of CPU cores you want the VM to have access to. Change the CPU type to host
for maximal performance.
On the Memory
tab, choose the RAM size for your VM.
On the Network
tab, simply accept the default values.
Then confirm your VM configurations and click the Finish button.
Once the VM is created, it will appear on the left sidebar. Select it and click the Start button to start the VM. Then click the Console
tab. You will be able to install an OS to the VM.
Once the installation is complete, you need to remove the ISO image from the virtual optical drive. Select the Hardware tab and the CD/DVD drive. Click the Edit button.
Select do not use any media and click Ok. Now you can reboot your VM.
I also recommend going to the Options
tab and enabling start at boot
, which will start the VM when the Proxmox host starts up.
How to Enable NAT Networking Mode
The default bridge networking mode makes VMs request IP addresses from the Proxmox host’s gateway. In other words, VMs and the Proxmox host will be in the same network. If you don’t have control over this network, then a VM might not be able to obtain an IP address from the gateway. You can enable NAT networking mode, so Proxmox will create a separate network for the VMs, which use the Proxmox host as the gateway.
SSH into the Proxmox host, and edit the /etc/network/interfaces
file.
sudo nano /etc/network/interfaces
Proxmox has a default bridge network interface vmbr0
.
auto lo iface lo inet loopback iface eno1 inet manual auto vmbr0 iface vmbr0 inet static address 10.10.22.215 netmask 255.255.255.0 gateway 10.10.22.1 bridge_ports eno1 bridge_stp off bridge_fd 0
Add the following lines at the end of this file.
auto vmbr1 iface vmbr1 inet static address 10.10.10.1 netmask 255.255.255.0 bridge_ports none bridge_stp off bridge_fd 0 post-up echo 1 > /proc/sys/net/ipv4/ip_forward post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
Save and close the file. Then bring up the new interface.
sudo ifup vmbr1
When you create a new VM, you need to select the vmbr1
interface on the Network
tab.
And when you install an operating system in the VM, you need to manually configure networking. For example:
- IP address: 10.10.10.100
- Gateway: 10.10.10.1
- DNS: 8.8.8.8, or 1.1.1.1
Note that if you change the settings in /etc/network/interface
file, you might also need to restart the VMs in order to use the new network configuration. Also, if you run a VPN client on the Proxmox host, it should run in split-tunning mode. A full-tunnel VPN on the Proxmox host can block VMs from accessing the Internet when the NAT networking mode is turned on.
How to Increase Virtual Disk Size
First, select your VM and go to the hardware
tab to resize disk.
Choose the amount of the disk size you want to increase.
Save the setting. Now the virtual disk is enlarged. We need to enlarge the partition to use all of the remaining space. You will need to do this from a live Linux system because you can’t enlarge a root partition when it’s mounted.
Go to the options
tab and set the VM to boot from CD-ROM first. (Make sure the virtual CD-ROM has an ISO image.)
Then reboot the VM into the live Linux system. Next, go to the Console
tab and wait for the live system to boot.
Launch Gparted
from the live system and enlarge the root partition of the VM.
After that, go to the options
tab and change the boot order back. Finally, reboot your VM.
How to Reduce Virtual Disk Size
First, you need to boot your VM from CD-ROM like the previous section and use Gparted to shrink the file system to your desired size.
Then you need to log into the main Proxmox host via SSH and use the lvresize
command to reduce the VM disk to the same size.
lvresize --size -20G /dev/mapper/pve-vm--100--disk--0
The above command will reduce 20G for the disk /dev/mapper/pv-vm--100--disk--0
. You can use the following command to find the disk name for your VM.
parted -l
Note that the Proxmox web interface will still show the original size but actually the disk size is reduced and you can use the free space for new VMs. You can use the following command to get the real size of the disk.
lvdisplay /dev/pve/vm-100-disk-0
If you previously created snapshots for this VM, then you need to delete those snapshots to reclaim the free disk space.
Your VM can’t boot after shrinking the disk because GPT table is corrupt.
GPT places a backup of partition table and headers at the last sector of the disk. If you shrink the disk, the backup partition table will be corrupt.
Here is how to recover the GPT partition table. Boot the VM from a Linux Live ISO file, then use gdisk to repair the partition table on your disk. (Your disk name might be different such as /dev/sda
.)
sudo gdisk /dev/vda
Then enter the following command one by one in gdisk:
r
: recovery.d
: rebuild backup from the main GPT header.e
: load main partition table from disk.v
: verify disk.w
: write table to disk and exit.
Now the VM can boot again.
Server Health Monitoring
You should keep an eye on the server load average. A healthy server should have a load average under 1.0
.
It’s recommended to restart your Proxmox host at least twice a year. I add a Cron job on the Proxmox host, so it will automatically restart twice a year.
sudo crontab -e
Add the following lines to the crontab file.
# Restart twice a year. When Proxmox host restarts, the VMs will automatically restart. 0 5 30 6 * /usr/sbin/shutdown -r now 0 5 31 12 * /usr/sbin/shutdown -r now
Save and close the file.
Wrapping Up
I hope this tutorial helped you install Proxmox VE and create virtual machines. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂
Hola Xiao, eres lo mejor (you are the best).
I have a few questions:
1. Do you recommend to use this and make your own VPS’s on a dedicated server? What should we take on account for it?
2. Scenario: 1 dedicated server with Proxmox to install as much as possible decent VPS’s.
A basic (“cheap”)Dedicated server comes with just 4 cores (OVH deals today for example https://www.ovh.com/world/deals). Someday I read Virtual Cores. Is a virtual core an option here? Because if you just have 4 cores on a dedicated server, you just can make 2 decent VPS’s, am I right?
Thanks so much Xiao
Hi DiegoJ,
Proxmox in a homelab is great for learning and testing, not only with VMs but also with LXC Linux containers. Use LXC as much as you can, it’s far more light weight than the VM (on hypervisor).
If you just have 4 cores on a dedicated server, you should usually have 8 threads. Normally Proxmox distributes processing power between the VPUs, so you will not run out of available CPUs ^^ and 4 cores is enough to run even more than 20 containers or more than 10 VMs, depending how much workload they have, of course.
One addition, you may want to detail how to get rid of their subscription warning so it can update properly off the community repo’s.
Hi Michael,
there is no problem to update from the “Proxmox VE No-Subscription Repository” with the subscription warning, just use the right repo settings as explained here:
https://pve.proxmox.com/wiki/Package_repositories
Somewhere I saw a workaround to get rid of the subscription warning, but it will be back after the next update.
Hi Jurgen, thanks a lot taking time to answer us. 🤓 Thank you so much.
I will have on account what you say: testing, lab, and see what happens after learning on the road.
Thanks for the info.
To get rid of the nag popup use these instructions: https://johnscs.com/remove-proxmox51-subscription-notice/
Regarding networking model: you may use VLAN (aware) interfaces for isolating VMs to specific VLAN remaining Bridge mode.