---
title: "alpacon login"
description: "Sign in to Alpacon from the CLI. Use workspace and region for Alpacon Cloud or a host for self-hosted access, with browser, headless, and token login examples."
---

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

# alpacon login

Sign in to Alpacon Cloud or a self-hosted workspace.

## Usage

`alpacon login [HOST] [flags]`

## Key facts

- For Alpacon Cloud, use `--workspace` and `--region`.
- Use `HOST` for a self-hosted workspace.
- Browser sign-in is the default; use `--no-browser` on a headless machine.
- Token login cannot open interactive Websh or tunnels.

## Flags

| Flag | Type | Description | Default |
| --- | --- | --- | --- |
| `-h, --help` | `bool` | help for login | `false` |
| `--insecure` | `bool` | Skip TLS certificate verification | `false` |
| `--no-browser` | `bool` | Do not open the browser automatically | `false` |
| `-p, --password` | `string` | Password for login | — |
| `--region` | `string` | Region for Alpacon Cloud login (e.g., us1, ap1) | — |
| `-t, --token` | `string` | API token for login | — |
| `-u, --username` | `string` | Username for login | — |
| `--workspace` | `string` | Workspace name for Alpacon Cloud login | — |
| `--output` | `string` | Output format: table or json | `table` |

## Examples

Sign in to Alpacon Cloud interactively

```bash
alpacon login
```

Choose the cloud workspace and region

```bash
alpacon login --workspace myworkspace --region us1
```

Sign in to Alpacon Cloud with a token

```bash
alpacon login --workspace myworkspace --region us1 -t <api-token>
```

Sign in to a self-hosted workspace

```bash
alpacon login alpacon.example.com
```

Use a token with a self-hosted workspace

```bash
alpacon login alpacon.example.com -t <api-token>
```

Use a username and password with a self-hosted workspace

```bash
alpacon login alpacon.example.com -u admin -p mypassword
```

Use a self-signed certificate

```bash
alpacon login alpacon.example.com --insecure
```

Sign in from a machine without a browser

```bash
alpacon login --workspace myworkspace --region us1 --no-browser
```

Disable browser opening with an environment variable

```bash
ALPACON_NO_BROWSER=1 alpacon login --workspace myworkspace --region us1
```

## Details

Log in to Alpacon. There are two login paths:

- **Alpacon Cloud**: use the `--workspace` and `--region` flags, or run `alpacon login` with no arguments to be prompted interactively.
- **Self-hosted**: pass your host as the `HOST` argument (for example, `alpacon.example.com`).

For Alpacon Cloud login without an API token (`-t`), browser authentication is the default. The CLI opens the browser automatically and waits for you to complete sign-in. Use `--no-browser` only in headless environments (SSH, containers) where no browser is available.

A token login (`-t`) cannot open an interactive session. An interactive `alpacon websh` terminal, `websh join`, `websh invite`, `websh watch`, and `tunnel` do not work with a token, whatever its scopes and ACL entries (see [Troubleshooting](/reference/scopes/#troubleshooting)). On a machine without a browser, sign in with `--no-browser` instead: you complete the sign-in on another device, and the resulting login can open them.

The `HOST` argument accepts self-hosted hosts; a direct Cloud host such as `myworkspace.us1.alpacon.io` remains accepted for compatibility, but use `--workspace` and `--region` for new Cloud logins. A URL with a path, such as `alpacon.io/myworkspace`, is refused. Credentials, queries, and fragments in `HOST` are also refused.

Running `alpacon login` with no arguments reuses your saved workspace, or prompts for the workspace name and region if none is saved.

Source: https://docs.alpacax.com/reference/cli/login/
