Administration

Proxmox Command Line Reference: Essential CLI Tools

A practical reference for Proxmox VE command line tools including qm, pct, pvecm, vzdump, pvesh, pveum, ha-manager, and pvenode with real-world examples.

ProxmoxR app icon

Managing Proxmox? Try ProxmoxR

Monitor and control your VMs & containers from your phone.

Try Free

Why the Command Line Matters

The Proxmox web interface covers most daily tasks, but the command line gives you speed, automation potential, and access to operations that are not exposed in the GUI. Whether you are scripting bulk operations, troubleshooting a stuck VM, or managing a cluster remotely over SSH, knowing the core CLI tools will make you significantly more effective.

qm - Virtual Machine Management

The qm command manages KVM virtual machines. It handles everything from creating and starting VMs to modifying hardware and taking snapshots:

# List all VMs on this node
qm list

# Start, stop, and reset a VM
qm start 100
qm shutdown 100        # graceful ACPI shutdown
qm stop 100           # force stop (like pulling the power)
qm reset 100          # hard reset

# Create a snapshot
qm snapshot 100 clean-install --description "Fresh OS install"

# Modify VM configuration (add memory, CPU)
qm set 100 --memory 4096 --cores 4

# Clone a VM (full clone)
qm clone 100 200 --name my-clone --full

# Show VM configuration
qm config 100

# Show current VM status
qm status 100

pct - Container Management

The pct command manages LXC containers. The syntax mirrors qm closely, making it easy to switch between VM and container management:

# List all containers
pct list

# Create a new container from a template
pct create 200 local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst \
    --hostname mycontainer --memory 1024 --cores 2 \
    --rootfs local-lvm:8 --net0 name=eth0,bridge=vmbr0,ip=dhcp

# Start and enter a container
pct start 200
pct enter 200

# Execute a command inside the container without entering it
pct exec 200 -- apt update

# Push and pull files
pct push 200 /tmp/config.txt /etc/myapp/config.txt
pct pull 200 /var/log/syslog /tmp/container-syslog.log

# Resize container disk
pct resize 200 rootfs +5G

pvecm - Cluster Management

The pvecm command handles Proxmox cluster operations including creation, joining, and status monitoring:

# Create a new cluster
pvecm create my-cluster

# Join an existing cluster (run on the joining node)
pvecm add 192.168.1.10

# Check cluster status
pvecm status
pvecm nodes

# Check quorum status
pvecm expected
corosync-quorumtool -s

# Remove a node from the cluster (run on a remaining node)
pvecm delnode old-node

vzdump and Restore

The vzdump tool creates backups, and qmrestore or pct restore bring them back:

# Backup a VM with snapshot mode and zstd compression
vzdump 100 --mode snapshot --compress zstd --storage backup-nas

# Backup all VMs and containers on this node
vzdump --all --mode snapshot --compress zstd --storage backup-nas

# Backup specific guests
vzdump 100 101 200 --mode snapshot --compress zstd

# Restore a VM backup to a new VMID
qmrestore /var/lib/vz/dump/vzdump-qemu-100-2026_02_27-03_00_01.vma.zst 150 --storage local-lvm

# Restore a container backup
pct restore 250 /var/lib/vz/dump/vzdump-lxc-200-2026_02_27-03_00_01.tar.zst --storage local-lvm

pvesh - API from the Shell

The pvesh command gives direct access to the Proxmox REST API from the command line, which is extremely useful for scripting and querying data not easily visible elsewhere:

# Get cluster resources overview
pvesh get /cluster/resources --output-format json-pretty

# Get node status
pvesh get /nodes/pve1/status

# List available storage
pvesh get /storage --output-format json-pretty

# Get VM status via API
pvesh get /nodes/pve1/qemu/100/status/current

# Create a VM via the API
pvesh create /nodes/pve1/qemu --vmid 300 --name api-vm --memory 2048 --cores 2

pveum - User and Permission Management

The pveum command manages users, groups, roles, and access control:

# List all users
pveum user list

# Add a new user
pveum user add devops@pve --password mypassword --comment "DevOps team"

# Create a role with specific privileges
pveum role add VMOperator --privs "VM.Audit VM.Console VM.PowerMgmt"

# Assign permissions (user gets VMOperator role on /vms path)
pveum acl modify /vms --users devops@pve --roles VMOperator

# Create an API token for automation
pveum user token add admin@pam automation --privsep 0

ha-manager and pvenode

These tools manage high availability and node-level operations:

# Add a VM to HA management
ha-manager add vm:100 --group ha-group1 --max_restart 3 --max_relocate 2

# Check HA status
ha-manager status

# Remove a resource from HA
ha-manager remove vm:100

# Set a node's power management wake-on-lan config
pvenode config set --wakeonlan AA:BB:CC:DD:EE:FF

# View node task history
pvenode task list

# Start all ACPI-shutdown VMs on boot
pvenode startup-order set --order 100:1,101:2,200:3

Putting It Together

The real power of these tools comes from combining them in scripts. Here is a quick example that lists all VMs across a cluster with their status:

# List all VMs across all cluster nodes
pvesh get /cluster/resources --type vm --output-format json | \
    jq -r '.[] | [.vmid, .name, .status, .node, .maxmem/1024/1024/1024] | @tsv' | \
    column -t -N "VMID,NAME,STATUS,NODE,RAM_GB"

Mastering these command line tools transforms how you manage Proxmox. For times when SSH is not convenient, ProxmoxR provides quick access to common VM and container operations from your phone, bridging the gap between the terminal and mobile management.

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.

ProxmoxR

Manage Proxmox from your phone

Monitor, control, and manage your clusters on the go.

Free 7-day trial · No credit card required