# Scopes and registries (/docs/pm/scopes-registries)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 235 · updated: 2026-07-28 -->
Related: [bunx](/docs/pm/bunx.md), [Workspaces](/docs/pm/workspaces.md), [Catalogs](/docs/pm/catalogs.md), [bun --filter](/docs/pm/filter.md), [Global cache](/docs/pm/global-cache.md), [Global virtual store](/docs/pm/global-store.md)

The default registry is `registry.npmjs.org`. To change it globally, set it in `bunfig.toml`:

```toml bunfig.toml icon="settings"
[install]
# set default registry as a string
registry = "https://registry.npmjs.org"
# set a token
registry = { url = "https://registry.npmjs.org", token = "123456" }
# set a username/password
registry = "https://username:password@registry.npmjs.org"
```

To configure a private registry scoped to a particular organization:

```toml bunfig.toml icon="settings"
[install.scopes]
# registry as string
"@myorg1" = "https://username:password@registry.myorg.com/"

# registry with username/password
# you can reference environment variables
"@myorg2" = { username = "myusername", password = "$NPM_PASS", url = "https://registry.myorg.com/" }

# registry with token
"@myorg3" = { token = "$npm_token", url = "https://registry.myorg.com/" }
```

### `.npmrc` [#npmrc]

Bun also reads [`.npmrc`](/pm/npmrc) files.
