Enable the registry
The registry is enabled by default on every Pier install. You only need to:
- Mint a personal token in the panel.
- Drop a
.npmrc(or.yarnrc.ymlfor yarn berry) into your project. - Optionally toggle upstream proxy on if you want public packages cached too.
1. Mint a token
Section titled “1. Mint a token”- Open the Pier panel and go to Packages → Manage tokens.
- Click New token, give it a name like
laptop-2026. - 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.
2. Configure your client
Section titled “2. Configure your client”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=truealways-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.
3. Verify it works
Section titled “3. Verify it works”curl https://YOUR-PIER-HOST/registry/npm/-/ping# {}A successful {} response confirms the registry is reachable. Then:
npm whoami# testerIf 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.
4. (Optional) enable upstream proxy
Section titled “4. (Optional) enable upstream proxy”If you want to mirror npmjs.org through Pier so the team uses a single URL:
- Open Packages → Upstream proxy.
- Toggle Enable upstream proxy on.
- Upstream URL defaults to
https://registry.npmjs.org— keep it unless you’re mirroring an internal NPM Enterprise instance. - Packument TTL (seconds) — 600 (10 min) is a sane default; bump it to 3600 if you want fewer upstream round-trips.
- Max cache size (MiB) —
0means unlimited (recommended on hosts with plenty of disk). Set 2–5 GiB for small teams; 20+ GiB for CI mirrors. - 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.
5. Pick your client guide
Section titled “5. Pick your client guide”- Use npm — npm 7 through 11.
- Use yarn 1.x — the always-auth quirk.
- Use yarn 2 / 3 / 4 — the
.yarnrc.ymlsetup. - Use pnpm — workspaces tip.
- Use bun — abbreviated packument note.
Next: publish or install
Section titled “Next: publish or install”- Want to publish a private package? Go to Publish private packages.
- Want CI to install through Pier? See CI integration.
- Hit a wall? Troubleshooting covers the common 401/409/304 cases.