Download the PHP package chuckbartowski/proxmox-sdk without Composer

On this page you can find all versions of the php package chuckbartowski/proxmox-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package proxmox-sdk

# 🖧 Proxmox VE SDK for PHP **A modern, fully typed PHP SDK for the Proxmox VE API — QEMU, LXC, cluster, storage, backups.** [![PHP Version](https://img.shields.io/badge/PHP-%3E%3D%208.2-777BB4?logo=php&logoColor=white)](https://www.php.net/) [![Symfony](https://img.shields.io/badge/Symfony-6.4%20%7C%207.x-000000?logo=symfony&logoColor=white)](https://symfony.com/) [![Tests](https://img.shields.io/badge/tests-17%20passing-brightgreen?logo=github)](tests/) [![Packagist](https://img.shields.io/packagist/v/chuckbartowski/proxmox-sdk?label=packagist&color=f28d1a)](https://packagist.org/packages/chuckbartowski/proxmox-sdk) [![License](https://img.shields.io/badge/license-MIT-yellow)](LICENSE) *QEMU · LXC · Cluster · Storage · Backups · Network · Access control · Task helpers* [Installation](#installation) · [Quick Start](#quick-start-plain-php) · [Tasks (UPID)](#asynchronous-tasks-upid) · [API Reference](#api-reference)

Framework-agnostic core — usable from any PHP project, script, or worker — with an optional bundle for first-class Symfony integration. Authenticated with API tokens or ticket/cookie credentials, typed exceptions, async task helpers, and a comment-free, strictly typed codebase (PHP 8.2+, declare(strict_types=1) everywhere).


Table of Contents


Features

Requirements

Dependency Version
PHP >= 8.2
Proxmox VE 7.x or 8.x (API tokens require 6.2+)
Symfony 6.4 LTS or 7.x — optional, only for the bundle integration

Installation

The package is published on Packagist:

Quick Start (plain PHP)

No framework required — build the client and go:

Client constructor signature:

Symfony Integration (optional)

Register the bundle:

Then create config/packages/proxmox_sdk.yaml:

Configuration reference

Key Type Default Description
host string required Proxmox VE hostname (no scheme, no port)
token_id string '' Full token id user@realm!tokenname (preferred)
token_secret string '' Token secret UUID
username / password string '' Ticket auth pair, used when no token is configured
realm string pam Realm appended to username when it has no @
port int 8006 API TLS port
verify_ssl bool true TLS peer/host verification (see Security Notes)
timeout float 30.0 Per-request timeout in seconds

The Proxmox facade is then autowirable in controllers, services, commands, and message handlers. The bundle reuses your application's http_client service when available and falls back to a native client otherwise.

Architecture

Design decisions:

Authentication

Two modes, checked in order:

  1. API token (recommended) — stateless, no CSRF, survives restarts. Create one in Datacenter » Permissions » API Tokens (or via this SDK):

Configure with tokenId: 'automation@pve!sdk' + the secret shown once at creation. Grant the token its own permissions when privsep is enabled — a common pitfall: a privilege-separated token has no permissions until you add ACLs for it.

  1. Ticket (username/password) — the SDK logs in against /access/ticket, stores the ticket and CSRF token in memory, sends PVEAuthCookie on every call and CSRFPreventionToken on writes, and re-logs automatically when the ticket expires (~2 hours).

Missing credentials throw an AuthenticationException immediately, before any network request.

Asynchronous Tasks (UPID)

Most mutating operations (start, clone, migrate, vzdump, destroy…) return immediately with a task identifier (UPID:node:…) while the work continues server-side:

waitForTask() polls the task status until it stops, returns the final status on success (OK or warnings), and throws an ApiException carrying the real exitstatus when the task failed — so a failed clone never masquerades as a success. taskLog() fetches the task output for diagnostics.

API Reference

Every method returns an Error Handling).

Nodes

$proxmox->nodes()

Method Endpoint
list() GET /nodes
status(string $node) GET /nodes/{node}/status
reboot(string $node) / shutdown(string $node) POST /nodes/{node}/status
version(string $node) GET /nodes/{node}/version
services(string $node) / restartService(string $node, string $service) GET/POST /nodes/{node}/services…
tasks(string $node, array $filters = []) GET /nodes/{node}/tasks
taskStatus(...) / taskLog(...) / stopTask(...) GET/DELETE /nodes/{node}/tasks/{upid}…
waitForTask(string $node, string $upid, float $timeout = 300.0, float $pollInterval = 1.0) polling helper

QEMU virtual machines

$proxmox->qemu() — full VM lifecycle on /nodes/{node}/qemu.

Method Notes
list(node) / create(node, vmid, options) / remove(node, vmid, purge: bool) purge: true also removes unreferenced disks and job entries
config(node, vmid) / updateConfig(node, vmid, options)
currentStatus(node, vmid)
start / stop / shutdown / reboot / reset / suspend / resume all return a UPID
clone(node, vmid, newid, options) ['full' => 1] for a full clone, template linked clones otherwise
migrate(node, vmid, target, options) ['online' => 1] for live migration
resize(node, vmid, disk, size) e.g. ('scsi0', '+10G')
snapshots / createSnapshot / deleteSnapshot / rollbackSnapshot
agentPing(node, vmid) / agentExec(node, vmid, command) QEMU guest agent
vncProxy(node, vmid) websocket-enabled console ticket

LXC containers

$proxmox->lxc() — the same lifecycle interface as QEMU (minus VM-only operations) on /nodes/{node}/lxc.

Cluster

$proxmox->cluster()version(), status(), resources(?type) (filter: vm, storage, node, sdn), tasks(), nextId(), options() / setOptions(), haResources(), and resource pools: pools(), pool(poolId), createPool(poolId, ?comment), updatePool(poolId, fields) (add/remove vms/storage members, delete => 1 to remove), deletePool(poolId).

nextId() + create() is the standard provisioning pattern shown in the Quick Start.

Storage

$proxmox->storage() — cluster-wide definitions (list, create, update, remove) and per-node views: nodeStorages(node), status(node, storage), content(node, storage, ?contentType), deleteVolume(...), and downloadUrl(node, storage, url, filename) to pull ISOs/templates straight from a URL (returns a UPID).

Backups

$proxmox->backups() — scheduled job management on /cluster/backup (jobs, createJob, updateJob, deleteJob) and on-demand dumps: run(node, options) (POST /nodes/{node}/vzdump) and defaults(node).

Network

$proxmox->network() — node network interfaces: list, find, create(node, iface, type, options) (types: bridge, bond, vlan, …), update, remove, plus apply(node) to activate pending changes and revert(node) to discard them. Proxmox stages network changes — nothing is live until apply().

Access control

$proxmox->access() — users (users, createUser, updateUser, deleteUser), API tokens (tokens, createToken, deleteToken), groups, roles(), and ACLs: acl(), updateAcl(path, roles, options) (add ['delete' => 1] to revoke), permissions(?path, ?userid).

Responses

All calls return an immutable ApiResponse; the Proxmox data envelope is already unwrapped:

Error Handling

All SDK exceptions implement ProxmoxSdkExceptionInterface, so a single catch covers everything:

Exception Thrown when Extras
ApiException The API answered but reported a failure, or an awaited task failed getErrors(), getStatusCode(), getRaw()
AuthenticationException Credentials are missing, login failed, or 401/403 persisted after re-login thrown before any request when credentials are empty
TransportException Network error, TLS failure, timeout, or a non-JSON response body wraps the underlying symfony/http-client exception

To inspect a failed response without exceptions, use the client directly — client-level methods return the response as-is:

Testing

The suite runs entirely offline against MockHttpClient:

To test your own services, inject a ProxmoxClient built with a mock:

Security Notes

WHMCS module

A ready-to-use WHMCS provisioning module ships in whmcs/modules/servers/proxmoxsdk/. It provisions VPS by cloning a template through this SDK — clone + wait + start on create, suspend/resume, terminate (stop + purge), and reboot.

Install

  1. composer require chuckbartowski/proxmox-sdk in your WHMCS root.
  2. Copy the proxmoxsdk folder into <whmcs>/modules/servers/.
  3. Add a server with Type: Proxmox VE (SDK), the PVE hostname, the token id (user@realm!name) as username, and the token secret in the Access Hash field.
  4. Set the config options: Node, Template VMID, and VMID base (the new VMID is base + service id, so it is deterministic and collision-free).
Operation SDK call
Create qemu()->clone()nodes()->waitForTask()qemu()->start()
Suspend / Unsuspend qemu()->suspend() / resume()
Terminate qemu()->stop()remove(purge: true)
Reboot qemu()->reboot()

License

MIT


All versions of proxmox-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/http-client Version ^6.4|^7.0
symfony/http-client-contracts Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chuckbartowski/proxmox-sdk contains the following files

Loading the files please wait ...