LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pct-push

copy a local file into a Proxmox LXC container

TLDR

Push a local script into a container
$ pct push 100 ./bootstrap.sh /root/bootstrap.sh
copy
Push a config and set guest ownership
$ pct push 100 ./nginx.conf /etc/nginx/nginx.conf --user root --group root
copy
Push with executable permissions
$ pct push 100 ./setup.sh /usr/local/bin/setup.sh --perms 0755
copy

SYNOPSIS

pct push vmid file destination [OPTIONS]

DESCRIPTION

pct push copies a single local file from the Proxmox host into an LXC container. It is commonly used to install bootstrap scripts, drop configuration files, or stage packages without scp/SSH into the guest.After a push, pct exec is often used to chmod and run the file. Ownership options refer to users and groups inside the container when names (not numeric ids) are given.

PARAMETERS

vmid

The numeric ID of the container (100–999999999)
file
Path to a local file on the host
destination
Destination path inside the container to write to
--user name|id
Owner user name or id. When using a name, it must exist inside the container
--group name|id
Owner group name or id. When using a name, it must exist inside the container
--perms mode
File permissions (octal by default; prefix with 0x for hexadecimal)

CAVEATS

Single-file only; recursive directory push is not supported. Parent directories inside the container must already exist. For large tree copies, mount the filesystem with pct mount or use a network share instead. Name-based --user/--group fail if that account is not defined in the guest.

HISTORY

pct push is part of the Proxmox VE pct (Proxmox Container Toolkit) for managing LXC containers.

SEE ALSO

pct(1), pct-pull(1), pct-exec(1), pct-enter(1), pct-mount(1)

RESOURCES

Copied to clipboard
Kai