Proxmox VE inside a Docker container.
10K+
Proxmox VE inside a Docker container.
services:
proxmox:
hostname: pve
image: dockurr/proxmox
container_name: proxmox
environment:
PASSWORD: "root"
SSH: "${SSH:-N}"
ports:
- 8006:8006
- "${SSH_PORT:-2222}:22"
volumes:
- ./data:/var/lib/vz
- ./config:/var/lib/pve-cluster
- type: bind
source: "${SSH_AUTHORIZED_KEY:-/dev/null}"
target: /run/ssh-imports/authorized_keys.in
read_only: true
bind:
create_host_path: false
- type: bind
source: "${SSH_PRIVATE_KEY_PATH:-/dev/null}"
target: /run/ssh-imports/id_ed25519.in
read_only: true
bind:
create_host_path: false
- type: bind
source: "${SSH_PUBKEY_PATH:-/dev/null}"
target: /run/ssh-imports/id_ed25519.pub.in
read_only: true
bind:
create_host_path: false
restart: always
privileged: true
stop_grace_period: 2m
docker run -it --rm --name proxmox --hostname pve --privileged -e "PASSWORD=root" -p 8006:8006 -v "${PWD:-.}/data:/var/lib/vz" -v "${PWD:-.}/config:/var/lib/pve-cluster" --stop-timeout 120 docker.io/dockurr/proxmox
Tip
To enable SSH with the CLI, add `-e SSH=Y -p 2222:22` and mount your public key, for example: `-v "$HOME/.ssh/id_ed25519.pub:/run/ssh-imports/authorized_keys.in:ro"`.
Note
Docker Desktop on Linux, macOS, and Windows 10 does not currently provide KVM access to containers and is therefore not supported.
Very simple! These are the steps:
Start the container and connect to port 8006 using your web browser.
Login using the username root and the password you specified in the PASSWORD environment variable.
Enjoy your time with your brand new Proxmox VE installation, and don't forget to star this repo!
To change the location for the local storage pool used by Proxmox to store large objects like disk images and .iso files, include the following bind mount in your compose file:
volumes:
- ./data:/var/lib/vz
Replace the example path ./data with the desired storage folder or named volume.
To change the location of your Proxmox VE configuration data, include the following bind mount in your compose file:
volumes:
- ./config:/var/lib/pve-cluster
Replace the example path ./config with the desired storage folder or named volume.
Minimal — authorized key only:
SSH=Y
SSH_AUTHORIZED_KEY=$HOME/.ssh/id_ed25519.pub
Full — authorized key plus the Ansible key pair:
SSH=Y
SSH_AUTHORIZED_KEY=$HOME/.ssh/id_ed25519.pub
SSH_PRIVATE_KEY_PATH=$HOME/.ssh/id_ed25519
SSH_PUBKEY_PATH=$HOME/.ssh/id_ed25519.pub
Then start:
docker compose up -d
Compose reads .env automatically. The compose snippet above already includes the SSH mounts; if you copied an older snippet, add them from compose.yml.
SSH_PORT changes only the published host port (default 2222); sshd listens on 22 inside the container.SSH_AUTHORIZED_KEY is the host path to the file sshd trusts. It can be a single .pub key or an authorized_keys file with multiple keys.SSH_PRIVATE_KEY_PATH and SSH_PUBKEY_PATH are the client key pair installed at /root/.ssh/id_ed25519 and /root/.ssh/id_ed25519.pub for Ansible inside the container. They are independent from SSH_AUTHORIZED_KEY.SSH_AUTHORIZED_KEY is not set, SSH_PUBKEY_PATH is used; if that is also missing, the public key is derived from SSH_PRIVATE_KEY_PATH. Set SSH_PUBKEY_PATH when the private key is passphrase-protected.sshd uses the Proxmox default /root/.ssh/authorized_keys, which links to /etc/pve/priv/authorized_keys./run/ssh-imports (0700 root:root). They are copied to root-owned files in /root/.ssh; the mounted sources are never modified.~/.ssh is not exposed and the client's known_hosts stays writable.SSH=N (default) keeps sshd disabled. Proxmox features that use SSH, such as clustering, require SSH=Y.known_hosts or persist /etc/ssh if you need stable keys.Ansible:
pve ansible_host=127.0.0.1 ansible_port=2222 ansible_user=root ansible_ssh_private_key_file=~/.ssh/id_ed25519
Inside the container, with the full configuration, use ansible_ssh_private_key_file=/root/.ssh/id_ed25519.
Yes, see our Proxmox Backup Server, Proxmox Datacenter Manager and Proxmox Mail Gateway containers.
First, make sure your platform and container runtime meet the requirements listed above.
On a Linux host, install cpu-checker and run:
sudo apt install cpu-checker
sudo kvm-ok
A working configuration should report:
KVM acceleration can be used
You can also verify that the KVM device exists:
ls -l /dev/kvm
If KVM is unavailable, check whether:
Intel VT-x or AMD-V) is enabled in your BIOS or UEFI.If kvm-ok succeeds but the container still reports that KVM is unavailable, you can temporarily add privileged: true to your Compose file to rule out a permission or device-access issue.
Special thanks to rtedpro-cpu and LongQT-sea, this project would not exist without their invaluable work.
The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Proxmox Server Solutions GmbH.
docker pull dockurr/proxmox:latestLast week