# Alpine Linux

> Install Trident on Alpine Linux using APK with automatic or manual repository setup.

Install Trident on Alpine Linux using APK.

<Admonition type="info" title="Tested Distribution">
This installation method is tested end-to-end on **Alpine 3.20** using automated integration tests that verify binaries, configuration, caching behavior, and graceful shutdown.
</Admonition>

## Automatic Setup

The repository setup script handles everything:

```bash
curl -sSL https://pkg.trident-cache.com/setup | sudo sh
```

Then install:

```bash
sudo apk add trident
```

## Manual Setup

### 1. Download the RSA public key

```bash
sudo mkdir -p /etc/apk/keys
sudo curl -fsSL https://pkg.trident-cache.com/gpg.rsa.pub \
  -o /etc/apk/keys/packages@trident-cache.com.rsa.pub
```

### 2. Add the repository

Append the repository URL to `/etc/apk/repositories`:

```bash
echo "https://pkg.trident-cache.com/apk/$(uname -m)" \
  | sudo tee -a /etc/apk/repositories
```

### 3. Install

```bash
sudo apk update
sudo apk add trident
```

## What Gets Installed

The package installs and configures the following:

| Component | Path |
|-----------|------|
| Main binary | `/usr/bin/trident` |
| CLI tool | `/usr/bin/trident-cli` |
| Default config | `/etc/trident/config.toml` |
| Cache directory | `/var/lib/trident/` (owned by `trident:trident`) |
| Log directory | `/var/log/trident/` (owned by `trident:trident`) |

A `trident` system user and group are created automatically by the package's preinstall script.

<Admonition type="note" title="Note">
Alpine Linux uses OpenRC instead of systemd. See [Service Management](https://docs.qoliber.com/docs/trident/service) for OpenRC-specific instructions.
</Admonition>

## Verify Installation

```bash
trident --version
trident-cli --version
```

## Next Steps

- [Configuration](https://docs.qoliber.com/docs/trident/configuration) -- edit `/etc/trident/config.toml`
- [Service Management](https://docs.qoliber.com/docs/trident/service) -- manage the Trident service
