> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.18.1/admin-panel/self-hosted/server-commands.md).

# Server commands

Use these commands to recover a setup token, create the first user without a browser or reset a password without email.

Run them inside the admin panel container:

```bash
docker exec <ADMIN_PANEL_CONTAINER> php artisan <COMMAND>
```

Replace `<ADMIN_PANEL_CONTAINER>` with the container name. Each section on this page gives the full command. If you lack server access, ask your server administrator.

{% hint style="info" %}
If you use the [Docker Compose example](https://github.com/WebSpellChecker/wproofreader-docker/tree/master/examples/admin-panel), run the commands in the folder with `docker-compose.yml`. Use the service name `admin-panel` instead of the container name:

```bash
docker compose exec admin-panel php artisan <COMMAND>
```

With the default project name, the container is `wproofreader-admin-panel-1`.
{% endhint %}

{% hint style="warning" %}
Command output can contain a setup token or password. Store it securely. A generated password is shown once.
{% endhint %}

### Get a new setup token

Use this command when the token is lost or expired before setup completes:

```bash
docker exec <ADMIN_PANEL_CONTAINER> php artisan app:setup-token --regenerate
```

It invalidates the old token and prints a replacement token and setup URL. The replacement expires after 24 hours.

Use the setup URL to [create the owner account](/v6.18.1/admin-panel/self-hosted/get-started.md#create-the-owner-account).

| Option         | What it does                                                                                    |
| -------------- | ----------------------------------------------------------------------------------------------- |
| `--generate`   | Creates a token when none exists. It refuses to replace an existing token, even an expired one. |
| `--regenerate` | Invalidates the current token and creates another.                                              |

Without an option, the command stops with "Pass --generate to create a token, or --regenerate to replace a lost one."

If a user exists, manual generation stops with "Setup is already complete: users exist. The setup flow can never run again."

### Create the first user without a browser

Use this command instead of browser setup on a new installation:

```bash
docker exec -it <ADMIN_PANEL_CONTAINER> php artisan admin:create --name="<NAME>" --email="<EMAIL>"
```

Replace `<NAME>` with the owner's display name and `<EMAIL>` with their sign-in address.

| Option       | What it does                                                                                                                                                                                                     |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--name`     | Sets the display name. If omitted, the command asks for it.                                                                                                                                                      |
| `--email`    | Sets the sign-in address. If omitted, the command asks for it.                                                                                                                                                   |
| `--password` | Sets a password of at least 12 characters. If omitted, the command generates a 20-character password and prints it once. We recommend omitting it: a password in the command line can stay in the shell history. |

The command creates the initial owner and completes setup. It confirms the email address without sending a verification email. It refuses to run when a user exists.

Store the generated password before closing the terminal. Sign in with the supplied email address to check the account.

Next, [check the license](/v6.18.1/admin-panel/self-hosted/subscription.md) and [activate a product](/v6.18.1/admin-panel/self-hosted/products.md#activating-a-product).

### Reset the password of a user

Use this command when email password reset is unavailable. It also resets the owner's password, which cannot be reset from **Team**.

```bash
docker exec <ADMIN_PANEL_CONTAINER> php artisan user:reset-password "<EMAIL>"
```

Replace `<EMAIL>` with the user's sign-in address.

The command generates a 20-character password and prints it once. With [database session storage](/v6.18.1/admin-panel/self-hosted/server-configuration.md#sessions), it signs the user out of all sessions.

1. Give the generated password to the user securely.
2. Ask the user to sign in with that password.
3. Ask the user to change it in [Profile](/v6.18.1/admin-panel/account-settings.md#changing-your-password).

If no user has the address, the command stops with "No user found with that email."

For other members, the owner or an administrator can also [set a password in Team](/v6.18.1/admin-panel/self-hosted/team.md#setting-a-password-for-a-member).
