<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Piotr Skwarna</title>
    <description>The latest articles on DEV Community by Piotr Skwarna (@spiderpl).</description>
    <link>https://dev.to/spiderpl</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1603248%2F2d3949d3-7167-428c-b26f-05cb8490f41a.png</url>
      <title>DEV Community: Piotr Skwarna</title>
      <link>https://dev.to/spiderpl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spiderpl"/>
    <language>en</language>
    <item>
      <title>php-virt-manager: a lightweight web panel for the KVM hosts you already have</title>
      <dc:creator>Piotr Skwarna</dc:creator>
      <pubDate>Sun, 29 Nov 2026 08:15:14 +0000</pubDate>
      <link>https://dev.to/spiderpl/php-virt-manager-a-lightweight-web-panel-for-the-kvm-hosts-you-already-have-57li</link>
      <guid>https://dev.to/spiderpl/php-virt-manager-a-lightweight-web-panel-for-the-kvm-hosts-you-already-have-57li</guid>
      <description>&lt;p&gt;My KVM hosts are plain Linux servers with libvirt. For years I managed them with &lt;code&gt;virsh&lt;/code&gt; and, when I had a desktop at hand, with virt-manager. That works for one person at one machine. It stops working when a colleague needs to restart a test VM, when you want to do it from a phone, or when someone asks "can I get a VM for a week?".&lt;/p&gt;

&lt;p&gt;The usual answers did not fit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Proxmox VE&lt;/strong&gt; is excellent, but it is a whole platform: you reinstall the host with it. My hosts already run Debian with other services on them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cockpit with cockpit-machines&lt;/strong&gt; is light, but it manages one host at a time and has no per-machine permissions, schedules or API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebVirtCloud&lt;/strong&gt; does a lot, but it is a Django application with several services, and on each KVM host it wants its own agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I wrote &lt;a href="https://github.com/spidero/php-virt-manager" rel="noopener noreferrer"&gt;php-virt-manager&lt;/a&gt;: a web panel that talks to libvirt and nothing else. It is PHP without a framework, ships as a single Docker image, and the KVM hosts need nothing besides libvirt (remote hosts are reached over &lt;code&gt;qemu+ssh://&lt;/code&gt;). Version 2.4.0 came out on 28 November 2026.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2gz35eq71hipoxonkx7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2gz35eq71hipoxonkx7x.png" alt="The dashboard: machine table with live usage, tags, host charts" width="800" height="671"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start in two minutes
&lt;/h2&gt;

&lt;p&gt;On the KVM host (or any machine that can reach its libvirt socket):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -d --name php-virt-manager \
  --network host \
  --restart unless-stopped \
  -e &lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Europe/Warsaw \
  -e &lt;span class="nv"&gt;HTTPS_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;9443 \
  -e &lt;span class="nv"&gt;HTTP_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;9080 \
  -e &lt;span class="nv"&gt;WS_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;6081 \
  -e &lt;span class="nv"&gt;PVM_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;admin \
  -e &lt;span class="nv"&gt;PVM_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;change-me \
  -v /var/run/libvirt:/var/run/libvirt \
  -v pvm-data:/app/data \
  -v pvm-ssl:/etc/nginx/ssl \
  ghcr.io/spidero/php-virt-manager:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open &lt;code&gt;https://&amp;lt;host&amp;gt;:9443/&lt;/code&gt; and log in. Host networking is there because the VNC consoles of the machines listen on the host's &lt;code&gt;127.0.0.1&lt;/code&gt;; the browser console goes through an authenticated websocket proxy in the container. Without Docker there is &lt;code&gt;deploy/install.sh&lt;/code&gt;, which sets up nginx, php-fpm, websockify and the cron timer on Debian or Ubuntu.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Machines
&lt;/h3&gt;

&lt;p&gt;Everything you would do in virt-manager, from the browser: power actions, saving the state to disk, editing memory, CPU topology and vCPUs (also live), disks with I/O limits, network interfaces (libvirt network, host bridge or macvtap), UEFI with Secure Boot and TPM, host device passthrough, an XML editor for administrators, cloning, live migration to another hypervisor, snapshots with schedules and retention. Two consoles: noVNC with key combinations and "type text", and the serial console in xterm.js.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsohdz8yr97grqb614v5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsohdz8yr97grqb614v5r.png" alt="The machine page in the Graphite look, dark mode" width="800" height="812"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  New machines from cloud images in about a minute
&lt;/h3&gt;

&lt;p&gt;Pick Ubuntu, Debian, AlmaLinux or Rocky Linux from the catalog, give it a name, an SSH key (or a saved one) and press &lt;em&gt;Create&lt;/em&gt;. The panel copies the image, grows the disk and builds a NoCloud seed ISO. Since 2.4.0 the form also takes a static address with gateway and DNS, the sudo mode of the user, and your own &lt;code&gt;#cloud-config&lt;/code&gt; that is merged into the panel's configuration: lists like &lt;code&gt;packages&lt;/code&gt; and &lt;code&gt;runcmd&lt;/code&gt; are appended, the user and the guest agent set by the panel stay.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9sago4imdd30bvch6gv3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9sago4imdd30bvch6gv3.png" alt="A new machine from a cloud image with a static address and extra cloud-init" width="800" height="781"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Backups of running machines
&lt;/h3&gt;

&lt;p&gt;A backup is a plain directory: &lt;code&gt;domain.xml&lt;/code&gt;, the disks and a small &lt;code&gt;manifest.json&lt;/code&gt;. A shut off machine is copied directly. A running one keeps running: its disks get a temporary external snapshot, the frozen images are copied, and the snapshot is merged back with &lt;code&gt;blockcommit --pivot&lt;/code&gt;. When the QEMU guest agent runs in the guest, its file systems are frozen first, so the copy is consistent rather than "like after a power cut". Backups run on demand or on a schedule with retention, and the &lt;em&gt;Backups&lt;/em&gt; page restores them as a new machine, also when the original was deleted. The disks are read through libvirt, so this works for remote hypervisors and inside Docker.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzpg9sferxbyhukezompx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzpg9sferxbyhukezompx.png" alt="Restoring a backup as a new machine" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Import from VMware, VirtualBox and Hyper-V
&lt;/h3&gt;

&lt;p&gt;Many people are moving off ESXi right now. The import page takes an OVA (memory, vCPUs, disks and UEFI are read from the OVF) or a single disk image: VMDK, VHDX, VHD, VDI, qcow2 or raw. Upload it in the browser, give a URL or point to a file already in a storage pool. Disks are converted to qcow2 by libvirt on the hypervisor. Windows guests get SATA disks and an e1000e network card so they boot before you install the virtio drivers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6lebjr7220r52ujkacbh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6lebjr7220r52ujkacbh.png" alt="The import form" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  People: roles, quotas, LDAP
&lt;/h3&gt;

&lt;p&gt;Six roles, from read-only &lt;code&gt;viewer&lt;/code&gt; and &lt;code&gt;auditor&lt;/code&gt; up to &lt;code&gt;admin&lt;/code&gt;. The interesting ones are &lt;code&gt;user&lt;/code&gt; and &lt;code&gt;localadmin&lt;/code&gt;: they see only the machines they own and create new ones within quotas (machines, vCPUs, memory, disk, per hypervisor). That is self-service VMs for a team without giving anyone the whole host. Accounts are local or come from LDAP / Active Directory, with the role taken from group membership on every login.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F81ib2x6982nb47d5v0nj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F81ib2x6982nb47d5v0nj.png" alt="Users with roles, LDAP accounts and quotas" width="799" height="632"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Knowing when something breaks
&lt;/h3&gt;

&lt;p&gt;Notifications go to ntfy, Slack or Mattermost, Microsoft Teams, Discord, any JSON webhook, or e-mail: failed background tasks and schedules, a crashed machine, low free space in a storage pool or in the backup directory, a new release. Each problem is reported once and again only after it was fixed and came back. For dashboards there is &lt;code&gt;metrics.php&lt;/code&gt; in the Prometheus format: host, machines (CPU, memory, disk and network counters, tags), storage pools, backups and jobs, so an alert like "no backup of this machine for two days" is one PromQL expression.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6fck53dunlulb6yxb1e0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6fck53dunlulb6yxb1e0.png" alt="Notification channels" width="800" height="688"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  And the rest
&lt;/h3&gt;

&lt;p&gt;Tags on machines with a filter in the machine table, usage history for 90 days, several hypervisors switched in the menu, a REST API with per-user tokens and an OpenAPI description, an action log, six interface languages (English, German, Norwegian, Polish, Spanish, Ukrainian) and five looks, each in a light and a dark mode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3hx5rzq0pz6qk8or7aj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3hx5rzq0pz6qk8or7aj3.png" alt="Four of the five looks" width="799" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it compares
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;php-virt-manager&lt;/th&gt;
&lt;th&gt;Cockpit + machines&lt;/th&gt;
&lt;th&gt;WebVirtCloud 5.0&lt;/th&gt;
&lt;th&gt;Proxmox VE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Runs on your existing libvirt hosts&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes (agent on each host)&lt;/td&gt;
&lt;td&gt;no, it is the host OS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Installation&lt;/td&gt;
&lt;td&gt;one container or one script&lt;/td&gt;
&lt;td&gt;distribution packages&lt;/td&gt;
&lt;td&gt;Django and several services&lt;/td&gt;
&lt;td&gt;ISO installer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Several hosts in one panel&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;one at a time&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes (cluster)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Roles per machine, quotas&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backups&lt;/td&gt;
&lt;td&gt;full, scheduled, of running VMs&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;incremental, scheduled&lt;/td&gt;
&lt;td&gt;yes (with PBS)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import OVA/VMDK/VHDX&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes (VMware import)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LDAP / AD with roles from groups&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;via the host's PAM&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two-factor login&lt;/td&gt;
&lt;td&gt;not yet&lt;/td&gt;
&lt;td&gt;via the host&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Notifications, Prometheus&lt;/td&gt;
&lt;td&gt;ntfy, Slack, Teams, Discord, e-mail; metrics&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;e-mail, webhook&lt;/td&gt;
&lt;td&gt;e-mail, webhook; metric server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST API&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Cockpit bridge&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To be fair: WebVirtCloud 5.0 (released a week before 2.4.0) has incremental backups and two-factor login, which php-virt-manager does not have yet, and Proxmox gives you clustering and HA that a panel on top of libvirt will never replace. php-virt-manager is for the case in the title: you already have KVM hosts, you want to keep them as they are, and you want a panel that is easy to run and easy to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is next
&lt;/h2&gt;

&lt;p&gt;On the list for the next releases: two-factor login (TOTP) and OIDC single sign-on, incremental backups with daily/weekly/monthly retention and an off-site target, protected machines, cancelling background tasks, VLANs on network interfaces and putting a host into maintenance.&lt;/p&gt;

&lt;p&gt;The project is GPL-3.0 on GitHub: &lt;a href="https://github.com/spidero/php-virt-manager" rel="noopener noreferrer"&gt;spidero/php-virt-manager&lt;/a&gt;. Ideas and bug reports are welcome in the issues, and if it saves you time, there is a &lt;a href="https://github.com/sponsors/spidero" rel="noopener noreferrer"&gt;GitHub Sponsors&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://skwarna.eu/blog/posts/php-virt-manager-kvm-web-panel/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kvm</category>
      <category>libvirt</category>
      <category>selfhosted</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
