Welcome Guest to Defaut site!

Proxmox VE Command Reference

Site: none Role: Admin Only

Current Proxmox Infrastructure

3-Host Cluster (Updated Dec 23, 2025):

K8s Nodes: Master (proxmoxws VM 100), Workers (proxmox720 VM 201, proxmoxws VM 103)

This document provides a comprehensive list of command-line operations for managing Proxmox VE environments, including virtual machines, containers, networking, storage, backups, and more.

Table of Contents

Virtual Machine Management (QEMU/KVM)

The qm command is used to manage QEMU/KVM virtual machines.

Basic VM Operations

# List all VMs
qm list

# Show VM configuration
qm config <vmid>

# Start a VM
qm start <vmid>

# Stop a VM (immediate power off)
qm stop <vmid>

# Gracefully shutdown a VM
qm shutdown <vmid>

# Reset a VM
qm reset <vmid>

# Suspend a VM
qm suspend <vmid>

# Resume a suspended VM
qm resume <vmid>

# Reboot a VM
qm reboot <vmid>

# Delete a VM
qm destroy <vmid>

VM Creation and Cloning

# Create a new VM with ID 100
qm create 100

# Create a VM with basic configuration
qm create 101 --name "web-server" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0

# Create a VM with an OS disk
qm create 102 --name "db-server" --memory 4096 --cores 4 --net0 virtio,bridge=vmbr0 --scsi0 local-lvm:20

# Clone a VM
qm clone <source-vmid> <target-vmid> --name "clone-name"

# Create a template from a VM
qm template <vmid>

VM Configuration

# Set VM name
qm set <vmid> --name <name>

# Set memory (in MB)
qm set <vmid> --memory <memory>

# Set CPU cores
qm set <vmid> --cores <cores>

# Set CPU type
qm set <vmid> --cpu <cputype>

# Add a network interface
qm set <vmid> --net0 virtio,bridge=vmbr0

# Set IP address for a VM (requires QEMU guest agent)
qm set <vmid> --ipconfig0 ip=192.168.1.100/24,gw=192.168.1.1

# Add a virtual disk
qm set <vmid> --scsi0 local-lvm:20

# Resize a disk (increase to 40GB)
qm resize <vmid> scsi0 40G

# Set boot order
qm set <vmid> --boot c --bootdisk scsi0

# Enable/disable QEMU guest agent
qm set <vmid> --agent enabled=1,fstrim_cloned_disks=1

# Set VM to start on boot
qm set <vmid> --onboot 1

# Set VM startup/shutdown order
qm set <vmid> --startup order=1,up=120,down=60

VM Migration

# Migrate a VM to another node
qm migrate <vmid> <target-node>

# Migrate with specific options
qm migrate <vmid> <target-node> --online --with-local-disks

VM Snapshots

# Create a snapshot
qm snapshot <vmid> <snapshot-name> --description "Description"

# List snapshots
qm listsnapshot <vmid>

# Rollback to a snapshot
qm rollback <vmid> <snapshot-name>

# Delete a snapshot
qm delsnapshot <vmid> <snapshot-name>

Container Management (LXC)

The pct command is used to manage Linux Containers (LXC).

Basic Container Operations

# List all containers
pct list

# Show container configuration
pct config <ctid>

# Start a container
pct start <ctid>

# Stop a container
pct stop <ctid>

# Restart a container
pct restart <ctid>

# Enter a container (get shell)
pct enter <ctid>

# Delete a container
pct destroy <ctid>

Container Creation and Cloning

# Create a container from a template
pct create <ctid> <storage>:vztmpl/<template> --hostname <hostname> --memory <memory> --net0 name=eth0,bridge=vmbr0,ip=dhcp

# Create a container with static IP
pct create <ctid> <storage>:vztmpl/<template> --hostname <hostname> --memory <memory> --net0 name=eth0,bridge=vmbr0,ip=192.168.1.100/24,gw=192.168.1.1

# Clone a container
pct clone <source-ctid> <target-ctid> --name <name>

Container Configuration

# Set container hostname
pct set <ctid> --hostname <hostname>

# Set memory limit (in MB)
pct set <ctid> --memory <memory>

# Set CPU cores
pct set <ctid> --cores <cores>

# Set container to start on boot
pct set <ctid> --onboot 1

# Set container startup/shutdown order
pct set <ctid> --startup order=1,up=120,down=60

# Add a network interface with DHCP
pct set <ctid> --net0 name=eth0,bridge=vmbr0,ip=dhcp

# Set static IP address for a container
pct set <ctid> --net0 name=eth0,bridge=vmbr0,ip=192.168.1.100/24,gw=192.168.1.1

# Add a mount point
pct set <ctid> --mp0 <host_path>,mp=<container_path>

# Resize a container disk
pct resize <ctid> rootfs 20G

Network Configuration

Host Network Configuration

# View network interfaces
ip addr show

# View routing table
ip route show

# Restart networking service
systemctl restart networking

# Apply network changes without reboot
ifreload -a

Bridge Management

# Create a bridge
echo "auto vmbr1
iface vmbr1 inet static
    address 192.168.2.1/24
    bridge-ports none
    bridge-stp off
    bridge-fd 0" >> /etc/network/interfaces

# Activate a bridge
ifup vmbr1

# Deactivate a bridge
ifdown vmbr1

Storage Management

The pvesm command is used to manage Proxmox VE storage.

Storage Operations

# List all storage
pvesm status

# Show storage configuration
pvesm config <storage>

# Add a directory storage
pvesm add dir <storage> --path <path>

# Add an NFS storage
pvesm add nfs <storage> --server <server> --export <export> --path <path>

# Add an iSCSI storage
pvesm add iscsi <storage> --portal <portal> --target <target>

# Add a Ceph RBD storage
pvesm add rbd <storage> --pool <pool> --monhost <monhost>

# Add an LVM storage
pvesm add lvmthin <storage> --vgname <vgname> --thinpool <thinpool>

# Add a ZFS storage
pvesm add zfspool <storage> --pool <pool>

# Remove a storage
pvesm remove <storage>

Backup and Restore

VZDump Backup

# Backup a single VM
vzdump <vmid> --compress zstd --mode snapshot --storage <storage>

# Backup multiple VMs
vzdump <vmid1>,<vmid2>,<vmid3> --compress zstd --mode snapshot --storage <storage>

# Backup all VMs
vzdump --all --compress zstd --mode snapshot --storage <storage>

# Backup with specific options
vzdump <vmid> --compress zstd --mode snapshot --storage <storage> --maxfiles 5 --mailto [email protected]

Restore from Backup

# Restore a VM from backup
qmrestore /var/lib/vz/dump/vzdump-qemu-<vmid>-<date>.vma.zst <vmid> --storage <storage>

# Restore a container from backup
pct restore <ctid> /var/lib/vz/dump/vzdump-lxc-<ctid>-<date>.tar.zst --storage <storage>

Cluster Management

The pvecm command is used to manage Proxmox VE clusters.

Cluster Operations

# Create a new cluster
pvecm create <clustername>

# Add a node to a cluster
pvecm add <hostname>

# Show cluster status
pvecm status

# Show cluster nodes
pvecm nodes

# Remove a node from the cluster
pvecm delnode <nodename>

Firewall Management

Firewall Operations

# Show firewall status
pve-firewall status

# Start firewall
pve-firewall start

# Stop firewall
pve-firewall stop

# Reload firewall configuration
pve-firewall reload

Firewall Rules Management

# List firewall rules
pvesh get /cluster/firewall/rules

# Add a firewall rule to allow SSH
pvesh create /cluster/firewall/rules --action accept --proto tcp --dport 22 --enable 1

# Add a firewall rule to allow HTTP
pvesh create /cluster/firewall/rules --action accept --proto tcp --dport 80 --enable 1

# Add a firewall rule to allow HTTPS
pvesh create /cluster/firewall/rules --action accept --proto tcp --dport 443 --enable 1

# Delete a firewall rule
pvesh delete /cluster/firewall/rules/<pos>

API and Shell Interface

The pvesh command provides a shell interface to the Proxmox VE API.

API Operations

# Get API version
pvesh get /version

# List all API paths
pvesh get /

# Get cluster resources
pvesh get /cluster/resources

# Get node status
pvesh get /nodes/<node>/status

# Get VM list
pvesh get /nodes/<node>/qemu

# Get container list
pvesh get /nodes/<node>/lxc

# Get storage list
pvesh get /storage

# Get task list
pvesh get /nodes/<node>/tasks

System Administration

System Operations

# Show system status
pveversion -v

# Show node status
pvesh get /nodes/<node>/status

# Show subscription status
pvesh get /nodes/<node>/subscription

# Update package lists
apt update

# Upgrade packages
apt dist-upgrade

# Reboot node
reboot

# Shutdown node
shutdown -h now

Additional Resources

Last updated: 2026-02-18