How to Change the Hostname of a Proxmox VE Node
Guide to changing the hostname on a Proxmox VE node, including all required file updates, SSL certificate regeneration, and cluster considerations.
Why Change the Hostname?
You might need to rename a Proxmox VE node if the initial hostname was poorly chosen, if you are standardizing naming conventions across your infrastructure, or if you repurposed a server. Unlike a typical Linux server, Proxmox uses the hostname in its configuration directory structure (/etc/pve/nodes/HOSTNAME), SSL certificates, and cluster membership. Renaming requires careful updates to multiple files.
Standalone Node: Change the Hostname
For a Proxmox node that is not part of a cluster, follow these steps in order:
Step 1: Update /etc/hostname
# Set the new hostname:
echo "pve-new" > /etc/hostname
# Apply immediately (temporary until reboot):
hostnamectl set-hostname pve-new
Step 2: Update /etc/hosts
# Edit the hosts file:
nano /etc/hosts
# Replace the old hostname with the new one:
10.0.0.50 pve-new.homelab.local pve-new
# Ensure the hostname is NOT mapped to 127.0.0.1 or 127.0.1.1
Step 3: Update /etc/postfix/main.cf
Proxmox installs Postfix for email notifications. Update the mail hostname:
nano /etc/postfix/main.cf
# Update these lines:
myhostname = pve-new.homelab.local
mydestination = $myhostname, pve-new, localhost.localdomain, localhost
# Restart Postfix:
systemctl restart postfix
Step 4: Rename the Node Directory
Proxmox stores node-specific configuration in /etc/pve/nodes/HOSTNAME. This directory must match the hostname:
# Rename the node directory:
# First, check the current name:
ls /etc/pve/nodes/
# Copy the directory (direct rename may not work on pmxcfs):
cp -r /etc/pve/nodes/pve-old /etc/pve/nodes/pve-new
# Update VM configs to reference the new node name if needed:
# Check for any references to the old hostname:
grep -r "pve-old" /etc/pve/nodes/pve-new/
# After confirming everything works, remove the old directory:
rm -rf /etc/pve/nodes/pve-old
Step 5: Regenerate SSL Certificates
# Remove old certificates:
rm /etc/pve/local/pve-ssl.pem /etc/pve/local/pve-ssl.key
# Regenerate certificates:
pvecm updatecerts --force
# Restart the web proxy:
systemctl restart pveproxy pvedaemon
Step 6: Reboot
# Reboot to apply all changes cleanly:
reboot
Verify After Reboot
# Verify hostname:
hostname
hostname -f
# Check the web UI is accessible:
curl -k https://10.0.0.50:8006
# Verify the node name in the web UI matches:
pvesh get /nodes --output-format json | python3 -m json.tool
# Check that VM configs are intact:
qm list
pct list
Cluster Node: Hostname Change (Not Officially Supported)
Proxmox does not officially support renaming a node that is part of a cluster. The recommended approach is to remove the node from the cluster, rename it, and re-add it. Here is the workaround process:
# 1. Migrate all VMs and containers off the node:
# For each VM:
qm migrate 100 pve1 --online
# For each container:
pct migrate 200 pve1
# 2. Remove the node from the cluster (from another node):
pvecm delnode pve-old
# 3. On the removed node, reset cluster configuration:
systemctl stop pve-cluster corosync
pmxcfs -l
rm -f /etc/corosync/*
rm -rf /etc/pve/corosync.conf
killall pmxcfs
systemctl start pve-cluster
# 4. Rename the node (follow standalone steps above)
# 5. Re-add the node to the cluster:
# From the renamed node:
pvecm add pve1-ip --name pve-new
# 6. Migrate VMs back:
qm migrate 100 pve-new --online
Additional Files to Check
Depending on your configuration, other files may reference the old hostname:
# Check for references to the old hostname:
grep -r "pve-old" /etc/pve/ 2>/dev/null
grep -r "pve-old" /etc/ 2>/dev/null
# Files that commonly need updating:
# /etc/mailname
echo "pve-new.homelab.local" > /etc/mailname
# /etc/cron.d/* (if you have custom cron jobs referencing the hostname)
# Storage configuration:
cat /etc/pve/storage.cfg
# Update any paths or NFS exports that reference the old hostname
Common Issues
- Web UI shows old hostname: Clear your browser cache and ensure
/etc/pve/nodes/only contains the new hostname directory. - VMs missing after rename: VM configs are stored under the node directory. Ensure they were copied to the new directory before deleting the old one.
- SSL certificate mismatch: Force certificate regeneration with
pvecm updatecerts --force.
Renaming a Proxmox node involves some downtime and multiple reboots. ProxmoxR lets you quickly verify that the node is back online and all VMs are running after each step — convenient when you are working through the rename process and want to confirm each change took effect.
Summary
Changing the hostname of a standalone Proxmox node requires updating /etc/hostname, /etc/hosts, /etc/postfix/main.cf, the node directory under /etc/pve/nodes/, and regenerating SSL certificates. For cluster nodes, the safest approach is to remove the node from the cluster, rename it, and rejoin. Always back up your configuration before making hostname changes and verify that VMs and containers are accessible after the rename.
Take Proxmox management mobile
All the features discussed in this guide — accessible from your phone with ProxmoxR. Real-time monitoring, power control, firewall management, and more.