Installation
A PAM Desktop project has two halves: the Composer package pushinbr/pam-desktop, which holds the PHP framework, and the native host pam-desktop, a Rust binary that opens windows and runs your PHP in a worker process. You install the package with Composer; the package downloads the matching host the first time you run it. This page covers what each system needs before that first run.
Requirements
Section titled “Requirements”| Requirement | Notes |
|---|---|
| PHP 8.5 and Composer | The PAM CLI brings both (pam composer ...). Ubuntu 24.04 and older package PHP 8.3 or older, so prefer PAM. |
| Linux | glibc 2.35 or newer and GTK 4.6 or newer (Ubuntu 22.04, Debian 12, Fedora 36 and later). GStreamer plugins for media. WebKitGTK 6 only for applications that show a WebView. |
| macOS | Nothing beyond PHP; the host uses AppKit, the system TLS stack and the Keychain. |
| Windows | Windows 10 version 1809 or later. The official PHP build needs the Visual C++ Redistributable 2015-2022 (x64). |
| Rust 1.92 or newer | Only to build the host from a checkout of the repository. |
Install the PAM CLI
Section titled “Install the PAM CLI”Install PAM once; it provides PHP 8.5, Composer and the pam desktop command:
curl --proto '=https' --tlsv1.2 --fail --silent --show-error --location \ --output pam-install.sh \ https://github.com/push-in/pam/releases/latest/download/install.sh
sh pam-install.shrm pam-install.sh
pam --versionSee Installation for details. PAM has no Windows release: on Windows install PHP 8.5 and Composer yourself and run vendor/bin/pam-desktop directly.
System libraries
Section titled “System libraries”The host is a GTK 4 application, and every command of the host needs GTK, init included. On Debian and Ubuntu:
sudo apt install libgtk-4-1 gstreamer1.0-plugins-base gstreamer1.0-plugins-goodAdd WebKitGTK 6 only if your application embeds web pages with WebView (Ubuntu 24.04 and later):
sudo apt install libwebkitgtk-6.0-4The host loads WebKitGTK the first time a WebView is shown. An application without one neither needs the library nor pays for it in memory.
The tray icon and global shortcuts need no extra library. A tray icon is shown only by desktops that host StatusNotifierItem icons: KDE, Cinnamon, XFCE, and GNOME with the AppIndicator extension.
No system packages are needed. The AppKit backend uses the system frameworks: TextKit for text, AVFoundation for media, WKWebView for web pages and the Keychain for secrets.
Install the Visual C++ Redistributable 2015-2022 (x64). The host says so when vcruntime140.dll is missing. WebView elements need the Evergreen WebView2 runtime, which current Windows versions include.
How the host is installed
Section titled “How the host is installed”pam desktop runs the launcher of the PHP package, vendor/bin/pam-desktop. The first time, the launcher:
- downloads
pam-desktop-<version>-<target>.tar.gzfrom the GitHub release that matches the installed package version; - verifies it against the published SHA-256;
- keeps the host in your user cache:
~/.cache/pam-desktopon Linux (or$XDG_CACHE_HOME/pam-desktop),~/Library/Caches/pam-desktopon macOS and%LOCALAPPDATA%\pam-desktopon Windows.
Releases ship hosts for Linux and macOS on x86_64 and arm64, and for Windows on x86_64. The first installation needs the Phar extension of PHP. Check which host you have with:
pam desktop --versionTo run a host you built yourself, point the launcher at it:
PAM_DESKTOP_HOST=/path/to/pam-desktop/target/debug/pam-desktop pam desktop devHow the host finds PHP
Section titled “How the host finds PHP”The host starts your application as <php> <worker bootstrap> <entry script>. It picks <php> in this order:
- the path in
PAM_DESKTOP_PHP; pamonPATHor at~/.local/bin/pam, started aspam exec;phponPATH.
When none exists, the host offers to install PHP for you. Nothing is installed without consent: in a terminal it shows what it will download and asks Install it now? [y/N]. Scripts and CI agree beforehand with --yes or PAM_DESKTOP_AUTO_INSTALL=1.
The host installs the PAM runtime, which embeds PHP 8.5. It downloads the signed PAM release manifest, verifies its Ed25519 signature against the pinned PAM release key, checks the archive’s size and SHA-256, and unpacks it in Rust. No curl | sh is involved. PAM_DESKTOP_PAM_VERSION=v2.2.9 pins a specific release.
PAM has no Windows release. The host downloads the newest official PHP 8.5 build (non thread safe, x64) from windows.php.net into %LOCALAPPDATA%\PAM Desktop\php\<version>. The archive must match both the SHA-256 that windows.php.net publishes and the one PAM Desktop pins for that build. PAM_DESKTOP_PHP_ALLOW_UNPINNED=1 accepts a newer, unpinned build with only the published checksum. This path has not been run on Windows yet.
Running without a display
Section titled “Running without a display”The Linux host needs an X11 or Wayland display. On a CI runner, a container or an SSH session, start a virtual X server:
sudo apt install xvfbXvfb :99 -screen 0 1280x800x24 &DISPLAY=:99 pam desktop dev --yesGTK then logs that it cannot reach a session bus and falls back to software rendering. Both messages are harmless.
Troubleshooting
Section titled “Troubleshooting”| Message | Cause and fix |
|---|---|
error while loading shared libraries: libgtk-4.so.1 |
GTK 4 is missing. Install the packages under System libraries. |
/usr/bin/env: 'php': No such file or directory |
vendor/bin/pam-desktop needs php on PATH. With PAM only, run pam desktop ... instead. |
Class "App\Navigation\AppRouter" not found |
composer.json lacks the App\ autoload. Run pam desktop init again (releases after 2.1.1 complete it) or add it by hand, then pam composer dump-autoload. |
bin/pam: error while loading shared libraries: libsodium.so.23 |
PAM 2.2.11 or earlier. Update PAM with pam self-update. |