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

# Deployment

> Install and run bLIS Gateway on a VM or with Docker.

bLIS Gateway is distributed as a single compiled binary with no external dependencies. You can run it directly on a Linux VM or as a Docker container.

## VM deployment

### Install with the install script

The recommended way to install bLIS Gateway on a VM is with the install script. Run the following command with `sudo`:

```bash theme={null}
curl -fsSL https://releases.blis.app/gateway/install.sh | sudo bash
```

This script:

1. Detects your platform (Linux x64 or ARM64)
2. Downloads the latest stable binary
3. Installs it to `/usr/local/bin/blis-gateway`
4. Creates directories for configuration, logs, and data
5. Generates a default configuration file at `/etc/blis-gateway/gateway.yaml`
6. Sets up a systemd service (enabled but not started)

After installation, edit the configuration file and start the service:

```bash theme={null}
sudo nano /etc/blis-gateway/gateway.yaml
sudo systemctl start blis-gateway
```

<Note>
  You can install from a specific release channel by passing `--channel=dev` or `--channel=beta`. The default is `stable`.
</Note>

### Install manually

If you prefer to install manually, download the binary for your platform and place it on your `PATH`:

```bash theme={null}
# Download the binary (example for Linux x64)
curl -fL https://releases.blis.app/gateway/latest/stable/blis-gateway-linux-x64 \
  -o /usr/local/bin/blis-gateway

chmod +x /usr/local/bin/blis-gateway

# Create directories
sudo mkdir -p /etc/blis-gateway /var/log/blis-gateway /var/lib/blis-gateway
```

### Set up as a systemd service

bLIS Gateway can generate its own systemd service file:

```bash theme={null}
blis-gateway systemd \
  --config /etc/blis-gateway/gateway.yaml \
  --user blis-gateway \
  --output /etc/systemd/system/blis-gateway.service
```

Then enable and start the service:

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl enable blis-gateway
sudo systemctl start blis-gateway
```

Useful service commands:

| Command                               | Description          |
| ------------------------------------- | -------------------- |
| `sudo systemctl status blis-gateway`  | Check service status |
| `sudo systemctl restart blis-gateway` | Restart the service  |
| `sudo journalctl -u blis-gateway -f`  | Follow service logs  |

### Update the gateway

To update to the latest version, use the built-in upgrade command:

```bash theme={null}
blis-gateway upgrade
```

To check for updates without installing:

```bash theme={null}
blis-gateway upgrade --check
```

## Docker deployment

bLIS Gateway publishes multi-architecture container images (Linux x64 and ARM64) to the GitHub Container Registry.

### Run with Docker

```bash theme={null}
docker run -d \
  --name blis-gateway \
  --restart unless-stopped \
  -v /path/to/config.yaml:/etc/blis-gateway/config.yaml:ro \
  -v /path/to/logs:/var/log/blis-gateway \
  -v /path/to/data:/var/lib/blis-gateway \
  -p 3000:3000 \
  -p 8080:8080 \
  ghcr.io/gammapeak/blis-gateway:latest
```

Adjust the published ports to match the instrument ports in your configuration file, plus the web dashboard port if enabled.

### Run with Docker Compose

Create a `docker-compose.yml` file:

```yaml theme={null}
services:
  blis-gateway:
    image: ghcr.io/gammapeak/blis-gateway:latest
    container_name: blis-gateway
    restart: unless-stopped
    volumes:
      - ./config.yaml:/etc/blis-gateway/config.yaml:ro
      - ./logs:/var/log/blis-gateway
      - ./data:/var/lib/blis-gateway
    ports:
      - "3000:3000"   # Instrument 1
      - "3001:3001"   # Instrument 2
      - "8080:8080"   # Web dashboard
```

Start the container:

```bash theme={null}
docker compose up -d
```

<Note>
  Publish a port for each instrument defined in your configuration, plus port `8080` (or your chosen port) if you enable the web dashboard.
</Note>

### Volumes

| Mount point                     | Purpose                                                  |
| ------------------------------- | -------------------------------------------------------- |
| `/etc/blis-gateway/config.yaml` | Configuration file (mount read-only)                     |
| `/var/log/blis-gateway`         | Log files                                                |
| `/var/lib/blis-gateway`         | Data directory (SQLite database for message persistence) |

## Validate your configuration

After installation, verify your configuration file is valid before starting the gateway:

```bash theme={null}
blis-gateway validate --config /etc/blis-gateway/gateway.yaml
```

This checks for syntax errors, missing required fields, and configuration conflicts (such as duplicate instrument ports).

## Next steps

<CardGroup cols={2}>
  <Card title="Configuration" icon="gear" href="/gateway/configuration">
    Learn about all available configuration options.
  </Card>

  <Card title="What is bLIS Gateway?" icon="circle-info" href="/gateway">
    Return to the gateway overview.
  </Card>
</CardGroup>
