Skip to content

Enable the registry

The registry is enabled by default on every Pier install. You only need to:

  1. Mint a personal token in the panel.
  2. Drop a .npmrc (or .yarnrc.yml for yarn berry) into your project.
  3. Optionally toggle upstream proxy on if you want public packages cached too.
  1. Open the Pier panel and go to Packages → Manage tokens.
  2. Click New token, give it a name like laptop-2026.
  3. Pier shows the plaintext token once — copy it now. Format is pier_npm_….

The token is bound to your panel account. Revoke it from the same screen whenever you want — every existing client using that token starts getting 401 immediately.

The minimum .npmrc (works for npm, pnpm, bun and yarn classic with one extra line):

registry=https://YOUR-PIER-HOST/registry/npm/
//YOUR-PIER-HOST/registry/npm/:_authToken=pier_npm_…
always-auth=true

always-auth=true is required for yarn 1.x (which otherwise omits the bearer on GET) and harmless for npm/pnpm/bun.

For yarn berry (2/3/4) the config file is different — see Use yarn 2/3/4 with Pier.

Terminal window
curl https://YOUR-PIER-HOST/registry/npm/-/ping
# {}

A successful {} response confirms the registry is reachable. Then:

Terminal window
npm whoami
# tester

If you get 401, recheck the token and always-auth=true. If you get 503, Traefik isn’t up yet — give it 30 seconds after a fresh bash install.sh run.

If you want to mirror npmjs.org through Pier so the team uses a single URL:

  1. Open Packages → Upstream proxy.
  2. Toggle Enable upstream proxy on.
  3. Upstream URL defaults to https://registry.npmjs.org — keep it unless you’re mirroring an internal NPM Enterprise instance.
  4. Packument TTL (seconds) — 600 (10 min) is a sane default; bump it to 3600 if you want fewer upstream round-trips.
  5. Max cache size (MiB)0 means unlimited (recommended on hosts with plenty of disk). Set 2–5 GiB for small teams; 20+ GiB for CI mirrors.
  6. Click Save.

The whole Mirror tab now lists every public package the team has installed through Pier. Star the ones you care about and filter with Pinned only.