pct
Manage Proxmox containers and VMs
TLDR
List all containers
Start/Stop/Reboot a specific container
Access a specific container's shell
Create a container from template with 4GB size
Resize the container's disk to 20G
Show the configuration of a container, specifying its ID
Snapshot a specific container with description
Destroy a container and remove all related resources
SYNOPSIS
pct command vmid [options]
pct command [options] (for global commands like 'list')
PARAMETERS
create vmid template
Creates a new LXC container from a specified template.
start vmid
Starts the specified container.
stop vmid
Stops the specified container gracefully.
restart vmid
Restarts the specified container.
destroy vmid
Permanently deletes the specified container and all its associated data.
config vmid
Displays the current configuration of the specified container.
set vmid options
Modifies various configuration settings for the specified container, such as CPU, memory, and network.
list
Lists all containers managed by Proxmox VE, along with their status and other details.
enter vmid
Provides direct console access (shell) into the specified running container.
backup vmid
Creates a backup archive of the specified container.
restore vmid backup-file
Restores a container from a backup archive, optionally assigning a new VMID.
migrate vmid target-node
Migrates a container from the current node to another node in a Proxmox cluster.
DESCRIPTION
pct is the primary command-line interface for managing LXC (Linux Containers) within the Proxmox Virtual Environment (PVE). It allows administrators to perform a wide range of operations on containers, including creation, deletion, starting, stopping, restarting, migrating, backing up, and restoring. It also enables modification of container configurations, such as network settings, CPU limits, memory allocation, and storage. pct is an essential tool for automating container management tasks and for those who prefer command-line interaction over the Proxmox web interface. It integrates seamlessly with Proxmox's storage and network configurations, providing a robust solution for container orchestration.
CAVEATS
pct is specific to the Proxmox Virtual Environment and cannot be used on a standalone Linux system without PVE. Most operations require root privileges or equivalent permissions. Incorrect usage, particularly with commands like `destroy` or `set`, can lead to data loss, misconfigured containers, or system instability. Users should have a foundational understanding of LXC concepts and Proxmox's storage and networking models for effective and safe management.
CONTAINER TEMPLATES
pct heavily relies on pre-built container templates, which can be downloaded and managed using the `pveam` command-line tool or through the Proxmox web interface. These templates provide a base operating system for new containers, simplifying deployment.
RESOURCE MANAGEMENT
pct allows granular control over container resources such as CPU cores (e.g., `--cores`), memory (e.g., `--memory`), swap space (e.g., `--swap`), and I/O limits (e.g., `--ioproperty`). These settings are crucial for optimizing performance and ensuring fair resource distribution among containers.
NETWORK CONFIGURATION
Networking for LXC containers can be configured directly via pct set commands, supporting various modes like bridged networking, NAT, and VLANs. These configurations integrate seamlessly with the underlying Proxmox host's network setup, providing flexible connectivity options.
HISTORY
The pct command is an integral part of the Proxmox Virtual Environment, a leading open-source server virtualization management solution. Proxmox VE initially utilized OpenVZ for containerization but transitioned to LXC (Linux Containers) in version 4.0 (released 2015) to leverage upstream kernel features and improve container isolation. pct was developed to provide a native, robust command-line interface for managing these LXC containers within the Proxmox ecosystem, complementing the web-based GUI and ensuring seamless integration with Proxmox's clustering, storage, and networking features. Its development closely tracks Proxmox VE's release cycle, with new features and improvements added regularly.