---
title: "alpacon server token create"
description: "Create an Alpamon server registration token with group assignments and an expiry. Keep its scope and lifetime small, and save the key when it is shown."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# alpacon server token create

Create a token for registering servers with Alpamon.

## Usage

`alpacon server token create [flags]`

## Key facts

- Limit `--groups` to the smallest set needed for the installation batch, and set `--expires-in-days` so the token does not outlive its purpose.
- Save the token key when it is shown; it cannot be retrieved again.

## Flags

| Flag | Type | Description | Default |
| --- | --- | --- | --- |
| `--expires-in-days` | `int` | Number of days until the token expires (0 = the workspace maximum lifetime; a longer one is refused). | `0` |
| `-g, --groups` | `strings` | Group names or UUIDs to assign on registration (comma-separated). | — |
| `-h, --help` | `bool` | Show command help. | `false` |
| `-n, --name` | `string` | Name used to identify the registration token. | — |
| `--output` | `string` | Output format: `table` or `json`. Inherited by all commands. | `table` |

## Examples

Interactive mode

```bash
alpacon server token create
```

Create with name and group assignment

```bash
alpacon server token create --name k8s-nodes --groups infra
```

Create with expiry

```bash
alpacon server token create --name k8s-nodes --groups infra --expires-in-days 365
```

Source: https://docs.alpacax.com/reference/cli/server/token-create/
