> ## Documentation Index
> Fetch the complete documentation index at: https://3to1go.docs.thesteau.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install Station

> Run Station and its PostgreSQL database with Docker Compose.

Station ships as a Docker image, `ghcr.io/thesteau/3to1go-station`, and needs PostgreSQL. The example deployment in the repository runs both.

## Requirements

* Docker with Compose
* An x86-64 (`linux/amd64`) host.
* Enough disk for your snapshots, which are full archives (see [retention](/station/snapshots#retention))
* A port Scouts can reach, `6555` by default

## Set up

<Steps>
  <Step title="Get the example files">
    ```sh theme={null}
    mkdir 3to1go-station && cd 3to1go-station
    curl -fsSLO https://raw.githubusercontent.com/thesteau/3to1go/main/deploy-example/station/docker-compose.yml
    curl -fsSL https://raw.githubusercontent.com/thesteau/3to1go/main/deploy-example/station/.env.example -o .env
    ```

    Or copy [`deploy-example/station/`](https://github.com/thesteau/3to1go/tree/main/deploy-example/station) from GitHub.
  </Step>

  <Step title="Edit .env">
    ```sh .env theme={null}
    # Host folder mounted into Station at /backups.
    BACKUP_DIR=./data/backups
    POSTGRES_DB=three_to_one_go
    POSTGRES_USER=three_to_one_go
    POSTGRES_PASSWORD=change-this-password
    # Only used when Station creates the first admin user.
    INITIAL_ADMIN_PASSWORD=admin
    ```

    Set a real `POSTGRES_PASSWORD`. Point `BACKUP_DIR` at wherever snapshots should live. See [Storage](/concepts/storage-and-3-2-1#where-station-can-store-snapshots).
  </Step>

  <Step title="Start it">
    ```sh theme={null}
    docker compose up -d
    ```

    Station waits for PostgreSQL to be healthy before starting.
  </Step>

  <Step title="Sign in">
    Open `http://<station-host>:6555/` and sign in as `admin`. See [Sign-in and accounts](/shared/sign-in).
  </Step>

  <Step title="Connect your first Scout">
    Click **Mint Scout Credential** and paste the result into Scout. See [Scout credentials](/station/scout-credentials).
  </Step>
</Steps>

## What gets created

The example Compose file keeps everything next to it:

```text theme={null}
3to1go-station/
├── docker-compose.yml
├── .env
├── config/          # issuer.key, trusted-certs/
├── hook-scripts/    # scripts for Custom Scripts
├── secrets/         # mounted at /run/secrets
└── data/
    ├── backups/     # snapshots (unless BACKUP_DIR points elsewhere)
    ├── staging/     # uploads in progress
    └── postgres/    # database files
```

<Warning>
  Preserve `config/` (it holds `issuer.key`) and a consistent backup of PostgreSQL, as well as the snapshot folder. Stop PostgreSQL before copying its data directory, or use PostgreSQL's backup tools. Losing the database loses snapshot metadata, users, and credential records. Losing `issuer.key` invalidates every Scout credential.
</Warning>

See [Recover Station](/station/disaster-recovery) for backup commands and steps to restore it on a replacement host.

## Update

```sh theme={null}
docker compose pull
docker compose up -d
```

**Admin** shows the running version: the tag (`v1.2.0`) on prod builds, the commit hash on main builds.

## Build from source

To build the image yourself, use the Compose file in [`station/`](https://github.com/thesteau/3to1go/tree/main/station) instead. It builds from the repository root so the shared code is included.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.