Skip to content
dockurPublic

Latest commit

 

History

250 Commits

Folders and files

Repository files navigation

Proxmox

Build Version Size Package Pulls

Proxmox VE inside a Docker container.

Features ✨

  • Runs a full Proxmox VE node inside Docker
  • Provides the familiar Proxmox web interface
  • Supports fast KVM-accelerated virtual machines
  • Supports LXC containers out of the box
  • Includes a pre-configured NAT bridge with DHCP
  • Supports both AMD64 and ARM64 host platforms

Usage 🐳

Docker Compose:
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 CLI:
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".

GitHub Codespaces:

Open in GitHub Codespaces

Screenshot 📸

Requirements ⚙️

  • Docker or Podman on a Linux host with KVM support.
  • Docker Desktop or Podman (Desktop) on Windows 11 with nested virtualization enabled.
  • At least 2 GB of available RAM.
  • At least 32 GB of free disk space.

Note

Docker Desktop on Linux, macOS, and Windows 10 does not currently provide KVM access to containers and is therefore not supported.

FAQ 💬

How do I use it?

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!

How do I change the location of the storage pool?

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.

How do I change the location of the configuration data?

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.

How do I enable SSH access?

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.
  • If 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.
  • Only these files are mounted, read-only, under /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 is key-only; password authentication is disabled.
  • SSH=N (default) keeps sshd disabled. Proxmox features that use SSH, such as clustering, require SSH=Y.
  • SSH host keys are generated on first start. Recreating the container changes them, so update 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.

Are there containers available for other Proxmox products?

Yes, see our Proxmox Backup Server, Proxmox Datacenter Manager and Proxmox Mail Gateway containers.

How do I verify that KVM is available?

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:

  • Hardware virtualization (Intel VT-x or AMD-V) is enabled in your BIOS or UEFI.
  • Nested virtualization is enabled when the host itself is a virtual machine.
  • Your VPS or cloud provider supports nested virtualization.

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.

Acknowledgements 🙏

Special thanks to rtedpro-cpu and LongQT-sea, this project would not exist without their invaluable work.

Stars 🌟

Stargazers

Disclaimer ⚖️

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.

Packages

Used by

Contributors

Languages