Installation

pnpr is distributed on npm as @pnpm/pnpr. The npm wrapper requires Node.js 18 or newer. Install it globally:

pnpm add -g @pnpm/pnpr@next

Until the first stable release, every pnpr version is a prerelease published under the next dist-tag, so install @pnpm/pnpr@next.

The wrapper package resolves to the native binary published under @pnpm/pnpr.<platform>-<arch> (e.g. @pnpm/pnpr.linux-x64). Prebuilt binaries are available for:

  • linux-x64, linux-arm64
  • linux-x64-musl, linux-arm64-musl
  • darwin-x64, darwin-arm64
  • win32-x64, win32-arm64

Only the binary matching your platform is downloaded.

Container image#

pnpr is also published as the ghcr.io/pnpm/pnpr container image:

docker run --rm -v pnpr-storage:/pnpr/storage --entrypoint sh ghcr.io/pnpm/pnpr:<version> -c '
  test -f /pnpr/storage/pnpr.yaml || (umask 077 &&
    printf "secret: \"%s\"\nstorage: /pnpr/storage\ncache: /pnpr/cache\n" \
      "$(od -An -N32 -tx1 /dev/urandom | tr -d " \n")" > /pnpr/storage/pnpr.yaml.tmp &&
    mv /pnpr/storage/pnpr.yaml.tmp /pnpr/storage/pnpr.yaml)'
docker run -p 127.0.0.1:7677:7677 \
  -e PNPR_CONFIG=/pnpr/storage/pnpr.yaml \
  -v pnpr-storage:/pnpr/storage \
  -v pnpr-cache:/pnpr/cache \
  ghcr.io/pnpm/pnpr:<version>
  • The entrypoint is pnpr. Arguments after the image name replace the default command, serve --listen 0.0.0.0:7677 --storage /pnpr/storage --cache /pnpr/cache.

  • /pnpr/storage and /pnpr/cache are volumes. Only /pnpr/storage holds data that must survive.

  • pnpr refuses to start on a cache from a previous run unless the config sets a secret. The first command writes a config with a random secret into the storage volume, readable only by the container's user, and keeps an existing one. PNPR_CONFIG selects it and keeps the default command.

  • The default command passes --storage /pnpr/storage, so the metadata database, which holds accounts and tokens, lives in that volume. Pass the same flag when you replace the command, for example to create an account:

    docker run --rm -it -v pnpr-storage:/pnpr/storage ghcr.io/pnpm/pnpr:<version> add-user alice --storage /pnpr/storage
    
  • The server runs as the non-root pnpr user.

  • The example publishes the port on loopback only. pnpr serves plain HTTP, so put a TLS-terminating proxy in front before clients on other machines log in.

Verify the installation#

pnpr --version

Next steps#

Continue to the Quick start to run the server and point a client at it.