Installation
Every PAM project starts with one command: pam. You install it once per machine, and it brings everything a PHP application needs to run: a private PHP 8.5 build with the Embed SAPI, a curated set of extensions, its own php.ini, and a verified Composer toolchain. You do not need a system PHP, a global Composer, PHP-FPM, Rust or PHP development headers.
After installation the same pam command creates projects, runs the development server, executes tests, builds production bundles and supervises workers.
Requirements
Section titled “Requirements”Official releases are prebuilt for these hosts:
| Host | Architecture | Notes |
|---|---|---|
| Linux | x86_64, ARM64 | Built on Ubuntu 22.04, so glibc 2.35 or newer is required. |
| macOS | Apple Silicon (arm64), Intel (x86_64) | The Apple Silicon archive also carries the iOS PHP runtimes. |
| Windows | x86_64 via WSL 2 | There is no native Windows server runtime; use the Linux build inside WSL 2. |
The installer itself only needs standard tools that every supported system ships: curl, tar, sha256sum (Linux) or shasum (macOS), awk, sed and find.
Installing PAM
Section titled “Installing PAM”curl -fsSL https://pamphp.com/install | shThe installer detects x86_64 or aarch64, downloads the matching archive and installs it without root.
curl -fsSL https://pamphp.com/install | shThe same script detects Apple Silicon or Intel. If you have a checkout of the PAM repository, ./install-macos.sh runs the same installer and refuses to run on anything other than macOS.
Open your WSL 2 distribution (Ubuntu 22.04 or newer) and run the Linux installer there:
curl -fsSL https://pamphp.com/install | shKeep your projects inside the Linux file system (for example ~/code), not under /mnt/c, so file watching in pam dev and Composer stay fast.
When it finishes, the installer prints the installed version and the release directory:
pam 2.2.27PAM installed at /home/alice/.local/share/pam/v2.2.27-linux-x86_64If the script also prints Add /home/alice/.local/bin to PATH, add that directory to your shell profile and open a new terminal:
export PATH="$HOME/.local/bin:$PATH"Then confirm the command works:
pam --versionpam doctorWhere Files Go
Section titled “Where Files Go”The installer follows the XDG base directories and never writes outside your home directory:
| Path | Contents |
|---|---|
~/.local/share/pam/vX.Y.Z-<target>/ |
One directory per installed release: bin/, lib/ (PHP and its shared libraries), lib/php/extensions/, etc/php.ini, etc/conf.d/. |
~/.local/bin/pam |
A symlink to the active release’s bin/pam-run launcher. |
~/.cache/pam/ |
The verified Composer PHAR and other caches. |
~/.local/state/pam/ |
Process-manager state and logs, created the first time you use pam up. |
After a successful install PAM keeps the active release plus the two newest previous releases, so you can roll back, and removes older ones for the same platform.
Installer Options
Section titled “Installer Options”The installer accepts a release tag as its only argument and reads a few environment variables:
| Variable | Purpose |
|---|---|
PAM_VERSION |
Release tag to install, such as v2.2.27. Defaults to the latest GitHub release. |
PAM_INSTALL_DIR |
Directory that holds the versioned release directories. Defaults to $XDG_DATA_HOME/pam or ~/.local/share/pam. |
PAM_BIN_DIR |
Directory for the pam symlink. Defaults to $XDG_BIN_HOME or ~/.local/bin. |
PAM_RELEASE_BASE_URL |
Alternate download base for a controlled mirror. |
Pin an exact version in CI and container builds so every run installs the same bits:
curl -fsSL https://github.com/push-in/pam/releases/download/v2.2.27/install.sh \ | PAM_VERSION=v2.2.27 shPrint the built-in help with sh install.sh --help.
What the Installer Verifies
Section titled “What the Installer Verifies”You can pipe the installer into sh because it is defensive by design:
- downloads are HTTPS-only and size-bounded (1 MiB metadata, 16 KiB checksum, 1 GiB archive);
- the archive must match the single SHA-256 entry published next to it;
- extraction rejects paths outside the archive root, links, special files and archives that expand past 4 GiB or 100,000 entries;
- the new runtime must report exactly the requested version before the
pamsymlink is switched, and the switch is an atomic rename.
Verifying Your Machine With pam doctor
Section titled “Verifying Your Machine With pam doctor”pam doctor checks the embedded PHP, its php.ini, the loaded extensions and, inside a project, Composer’s autoloader and platform requirements:
pam doctorPAM / SYSTEM DIAGNOSTICS────────────────────────────────────────────────────────────● [ok] PHP Embed version: 8.5.13◆ [info] Embed SAPI: embed◆ [info] Zend Engine: 4.5.13◆ [info] Embed php.ini: /home/alice/.local/share/pam/v2.2.27-linux-x86_64/etc/php.ini◆ [info] Embed scanned INI files: 38◆ [info] Xdebug=false · OPcache=trueUseful options:
| Option | Effect |
|---|---|
--fix |
Apply safe repairs after a dependency preflight (for example, install the Android runtimes in a PAM Native project). |
--ci |
Disable interactive and colored output for automation. |
--json |
Emit a stable, structured report. |
--schema |
Print the JSON Schema of that report. |
--validate FILE |
Validate a saved report offline. |
Pass a directory to check another project: pam doctor ../billing-api --ci.
Updating PAM
Section titled “Updating PAM”pam self-update installs a newer release, but only one that is signed by PAM’s pinned distribution key and built for your exact platform:
pam self-update --check # verify and report a newer release, change nothingpam self-update # install the latest authorized releasepam self-update v2.2.27 # install one exact versionDowngrades are refused unless you name the version and opt in explicitly:
pam self-update v2.2.26 --allow-downgradeRe-running the installer script also works and is the simplest way to update inside container builds.
Choosing the PHP Version
Section titled “Choosing the PHP Version”Each PAM release embeds exactly one PHP build for the server runtime. PAM 2.2.27 ships PHP 8.5.13, and new projects require php: ^8.5. To move to a newer PHP patch release, update PAM; there is no separate PHP to manage.
pam -r 'echo PHP_VERSION, PHP_EOL;'PAM Native and PAM Desktop builds pick their PHP runtime from a versioned catalog instead. See the PHP Runtime Manager for pam mobile runtime:use and runtime locks.
Running PAM in Docker
Section titled “Running PAM in Docker”Server applications usually ship as a container. The official Nimbus skeleton includes a production Dockerfile that installs a pinned, checksum-verified PAM release into a distroless image:
ARG PAM_VERSION=v2.2.26
FROM debian:bookworm-slim AS pamARG PAM_VERSIONARG TARGETARCHRUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl \ && rm -rf /var/lib/apt/lists/*RUN set -eu; \ case "${TARGETARCH:-amd64}" in \ amd64) target=linux-x86_64 ;; \ arm64) target=linux-aarch64 ;; \ esac; \ archive="pam-${PAM_VERSION}-${target}.tar.gz"; \ base="https://github.com/push-in/pam/releases/download/${PAM_VERSION}"; \ cd /tmp; \ curl --proto '=https' --tlsv1.2 -fsSLO "${base}/${archive}"; \ curl --proto '=https' --tlsv1.2 -fsSLO "${base}/${archive}.sha256"; \ sha256sum -c "${archive}.sha256"; \ mkdir -p /opt/pam; \ tar --no-same-owner -xzf "${archive}" -C /opt/pam --strip-components=1; \ /opt/pam/bin/pam --versionWhen you call the pam binary directly (without the pam-run launcher), export the same variables the launcher sets so PHP finds its extensions and php.ini:
ENV PAM_HOME=/opt/pam/share/pam \ PAM_EXTENSION_DIR=/opt/pam/lib/php/extensions \ PHPRC=/opt/pam/etc/php.ini \ PHP_INI_SCAN_DIR=/opt/pam/etc/conf.d \ PATH=/opt/pam/bin:$PATHA ready-made image of the skeleton is published as ghcr.io/push-in/nimbus-skeleton for amd64 and arm64 on every release. The Deployment guide walks through the full image and the Helm chart.
Uninstalling
Section titled “Uninstalling”Remove the symlink and the release directories. Delete the cache and process-manager state too if you no longer need them:
pam ps # make sure no managed application is still runningrm ~/.local/bin/pamrm -rf ~/.local/share/pam ~/.cache/pam ~/.local/state/pamIf you installed with PAM_INSTALL_DIR or PAM_BIN_DIR, remove those directories instead.
Building From Source
Section titled “Building From Source”Only runtime contributors need this. You need Rust 1.88 or newer, a C toolchain, and PHP 8.5 development headers plus the Embed library:
sudo apt-get install -y build-essential php8.5-dev libphp8.5-embedcargo build --locked --releaseThe repository’s own Dockerfile builds the same way on Debian bookworm. See the Contribution Guide for the full workflow.
Next Steps
Section titled “Next Steps”- Your First Application: create, run, test and build an API.
- Configuration: environment variables,
pam.json,php.iniand extensions. - The PAM CLI: a tour of every command group.