# FreeBSD

> Install Trident on FreeBSD using pkg with automatic or manual repository setup.

Install Trident on FreeBSD using `pkg`.

<Admonition type="note" title="Note">
FreeBSD packages are currently available for amd64 only.
</Admonition>

## Automatic Setup

The repository setup script handles everything:

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

FreeBSD-native variant (works on minimal hosts without `curl`/`sudo`):

```bash
fetch -qo - https://pkg.trident-cache.com/setup | su -m root -c sh
```

Then install:

```bash
sudo pkg install -U trident
```

## Manual Setup

### 1. Add the repository

Create `/usr/local/etc/pkg/repos/trident.conf`:

```
trident: {
    url: "https://pkg.trident-cache.com/freebsd/<MAJOR>/amd64",
    enabled: yes
}
```

Use your FreeBSD major version for `<MAJOR>`:

- FreeBSD 14.x: `14`
- FreeBSD 15.x: `15`

Example:

```bash
MAJOR=$(uname -r | cut -d. -f1)
sudo tee /usr/local/etc/pkg/repos/trident.conf >/dev/null <<EOF
trident: {
    url: "https://pkg.trident-cache.com/freebsd/${MAJOR}/amd64",
    enabled: yes
}
EOF
```

### 2. Install

```bash
sudo pkg update -f
sudo pkg install -U trident
```

`-U` skips package catalog auto-refresh during install. This avoids a known
`pkg` metadata-format issue while Trident's FreeBSD repository is publishing
legacy `packagesite.txz` metadata.

## Verify Installation

```bash
trident --version
```

## Next Steps

- [Configuration](https://docs.qoliber.com/docs/trident/configuration) -- edit `/usr/local/etc/trident/config.toml`
- [Service Management](https://docs.qoliber.com/docs/trident/service) -- enable the rc.d service
