Skip to content

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.

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.

Terminal window
curl -fsSL https://pamphp.com/install | sh

The installer detects x86_64 or aarch64, downloads the matching archive and installs it without root.

When it finishes, the installer prints the installed version and the release directory:

pam 2.2.27
PAM installed at /home/alice/.local/share/pam/v2.2.27-linux-x86_64

If the script also prints Add /home/alice/.local/bin to PATH, add that directory to your shell profile and open a new terminal:

~/.bashrc
export PATH="$HOME/.local/bin:$PATH"

Then confirm the command works:

Terminal window
pam --version
pam doctor

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.

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:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/download/v2.2.27/install.sh \
| PAM_VERSION=v2.2.27 sh

Print the built-in help with sh install.sh --help.

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 pam symlink is switched, and the switch is an atomic rename.

pam doctor checks the embedded PHP, its php.ini, the loaded extensions and, inside a project, Composer’s autoloader and platform requirements:

Terminal window
pam doctor
PAM / 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=true

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

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:

Terminal window
pam self-update --check # verify and report a newer release, change nothing
pam self-update # install the latest authorized release
pam self-update v2.2.27 # install one exact version

Downgrades are refused unless you name the version and opt in explicitly:

Terminal window
pam self-update v2.2.26 --allow-downgrade

Re-running the installer script also works and is the simplest way to update inside container builds.

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.

Terminal window
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.

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:

Dockerfile (excerpt)
ARG PAM_VERSION=v2.2.26
FROM debian:bookworm-slim AS pam
ARG PAM_VERSION
ARG TARGETARCH
RUN 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 --version

When 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:$PATH

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

Remove the symlink and the release directories. Delete the cache and process-manager state too if you no longer need them:

Terminal window
pam ps # make sure no managed application is still running
rm ~/.local/bin/pam
rm -rf ~/.local/share/pam ~/.cache/pam ~/.local/state/pam

If you installed with PAM_INSTALL_DIR or PAM_BIN_DIR, remove those directories instead.

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:

Terminal window
sudo apt-get install -y build-essential php8.5-dev libphp8.5-embed
cargo build --locked --release

The repository’s own Dockerfile builds the same way on Debian bookworm. See the Contribution Guide for the full workflow.