# Vaultwarden: Close Registration

LLMS index: [llms.txt](/en/llms.txt)

---

Lead paragraph:
Vaultwarden often runs as a personal or team password vault. In some scenarios—corporate policy, responsibility separation, or just reducing attack surface—completely disabling new account creation is necessary. This is done via a single environment variable, but requires admin attention to preserve existing user access.

## 1. Why close registration
Disabling registration prevents new users from appearing in the vault. This matters when Vaultwarden serves a closed group, and new accounts are created manually by admin, or when security policy forbids self‑service. Additionally, turning off `SIGNUPS_ALLOWED` removes the need for regular orphan account cleanup and simplifies user list auditing.

## 2. SIGNUPS_ALLOWED configuration
Primary way to block registration: set `SIGNUPS_ALLOWED` env var to `false`. Can be applied in `.env`, docker‑compose `environment:` block, or `-e` at runtime.

```bash
# docker-compose.yml example
environment:
  - SIGNUPS_ALLOWED=false
```
After change, restart:
```bash
docker compose up -d
```

| Variable | Value | Description |
|----------|-------|-------------|
| `SIGNUPS_ALLOWED` | `true` | Allows new account creation via web UI |
| `SIGNUPS_ALLOWED` | `false` | Blocks registration, login only for existing users or admin |

If variable not set, default allows registration. Ensure after restart that opening registration page redirects to login or returns access error, depending on reverse proxy config.

> [!TIP]
> If you already use `ADMIN_PASSWORD` instead of token, remember that Vaultwarden web UI accepts `admin` login and password set via `ADMIN_PASSWORD`. Token is preferred for scripts and automation.

## 3. Using ADMIN_TOKEN
Blocking registration doesn’t remove management capability. Admin uses `ADMIN_TOKEN`. Generated once at init or when changing access policy.

```bash
ADMIN_TOKEN=$(openssl rand -hex 32)
```
In docker‑compose:
```yaml
environment:
  - SIGNUPS_ALLOWED=false
  - ADMIN_TOKEN=${ADMIN_TOKEN}
```
Token used in `Authorization: Bearer <header>` for Vaultwarden API calls (list users, change password, etc.). Important to store securely. Loss requires container restart with new value and manual client config updates.

## 4. Verification: login & account creation
After restart with `SIGNUPS_ALLOWED=false` and `ADMIN_TOKEN` set, verify two ways:
1. Registration attempt via web UI — should block or redirect to login.
2. Login under existing account or admin API — should work fine.

```bash
curl -H "Authorization: Bearer $ADMIN_TOKEN" https://your-vaultwarden.example.com/api/ping
```
Expected: `{"status":"ok"}`. If token valid, service accessible. New account creation via browser should end with `Signup disabled` or similar message.

## 5. What if ADMIN_TOKEN lost
Lost token recoverable but needs caution. Stored in container env var, removal/change requires restart with new value.

1. Choose new token, update var in `.env` or docker‑compose.
2. Restart container:
   ```bash
   docker compose up -d
   ```
3. Update client configs (e.g., `bw config` for `bitwarden-cli`) if tied to old token for automation.

> [!WARNING]
> Changing `ADMIN_TOKEN` invalidates old token instantly. Ensure all automated scripts and workstations are updated before service reload, else lose programmatic API access until token replaced everywhere used.
> If web UI access preserved (e.g., via `ADMIN_PASSWORD`), admin can login and check user list, but programmatic access requires token update everywhere. In extremis, can enter container and read current env value, but that’s outside typical ops.
