Skip to content

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.

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 PAM once; it provides PHP 8.5, Composer and the pam desktop command:

Terminal window
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.sh
rm pam-install.sh
pam --version

See Installation for details. PAM has no Windows release: on Windows install PHP 8.5 and Composer yourself and run vendor/bin/pam-desktop directly.

The host is a GTK 4 application, and every command of the host needs GTK, init included. On Debian and Ubuntu:

Terminal window
sudo apt install libgtk-4-1 gstreamer1.0-plugins-base gstreamer1.0-plugins-good

Add WebKitGTK 6 only if your application embeds web pages with WebView (Ubuntu 24.04 and later):

Terminal window
sudo apt install libwebkitgtk-6.0-4

The 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.

pam desktop runs the launcher of the PHP package, vendor/bin/pam-desktop. The first time, the launcher:

  1. downloads pam-desktop-<version>-<target>.tar.gz from the GitHub release that matches the installed package version;
  2. verifies it against the published SHA-256;
  3. keeps the host in your user cache: ~/.cache/pam-desktop on Linux (or $XDG_CACHE_HOME/pam-desktop), ~/Library/Caches/pam-desktop on macOS and %LOCALAPPDATA%\pam-desktop on 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:

Terminal window
pam desktop --version

To run a host you built yourself, point the launcher at it:

Terminal window
PAM_DESKTOP_HOST=/path/to/pam-desktop/target/debug/pam-desktop pam desktop dev

The host starts your application as <php> <worker bootstrap> <entry script>. It picks <php> in this order:

  1. the path in PAM_DESKTOP_PHP;
  2. pam on PATH or at ~/.local/bin/pam, started as pam exec;
  3. php on PATH.

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.

The Linux host needs an X11 or Wayland display. On a CI runner, a container or an SSH session, start a virtual X server:

Terminal window
sudo apt install xvfb
Xvfb :99 -screen 0 1280x800x24 &
DISPLAY=:99 pam desktop dev --yes

GTK then logs that it cannot reach a session bus and falls back to software rendering. Both messages are harmless.

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.