# TrueNAS SCALE

Source: https://tiltas.openpanel.sh/docs/devices/truenas

> Run Tiltas on TrueNAS SCALE as a custom app from YAML, share your home LAN, update and remove it.

Tiltas runs on TrueNAS SCALE 24.10 and later as a custom app, from a Docker Compose file. The NAS joins your Network as
a Server, and it can share your home LAN with your other Devices.

## 1. Get a Join key

1. In the [console](/app), open **Join keys** and choose **Create Join key**.
2. Name it after the machine, such as “truenas”. Leave **Reusable** off: the key then adds one Server and is spent.
3. Create it and copy the key, which starts with `qlj_`. It is shown once and works for 7 days unless you chose
   otherwise.

## 2. Make a place for its state

Create a dataset for the app, such as `tank/apps/tiltas` (**Datasets** → **Add Dataset**). It holds the Device's
sign-in: keep it, and the app stays the same Device through restarts and updates. Use your own pool's path in the file
below.

## 3. Install the app

1. Open **Apps** → **Discover Apps**, open the menu beside **Custom App** and choose **Install via YAML**.
2. Name it `tiltas` and paste the file below with your Join key into **Custom Config**.
3. Choose **Save**. TrueNAS downloads the image and starts the app.

```yaml title="Custom Config"
services:
  tiltas:
    image: tiltas-registry.openpanel.sh/tiltas/tiltas:latest
    container_name: tiltas
    restart: unless-stopped
    network_mode: host
    cap_add: [NET_ADMIN]
    devices: ["/dev/net/tun:/dev/net/tun"]
    environment:
      TILTAS_JOIN_KEY: qlj_your_join_key
      TILTAS_HOSTNAME: truenas
      # TILTAS_ROUTES: 192.168.1.0/24
    volumes:
      - /mnt/tank/apps/tiltas:/var/lib/tiltas
```

`network_mode: host` puts the NAS itself in your Network. TrueNAS SCALE has `/dev/net/tun`, so this uses kernel
networking; to use userspace networking instead, delete the `cap_add` and `devices` lines. The Join key is read on the
first start only.

## 4. Check that it is online

In the console, **Devices** lists `truenas` as **Online** with its address, such as `100.64.0.7`. It is a Server: other
Devices reach it only where an [Access rule](/docs/access) or a [Service](/docs/services) allows.

Under **Apps** → **Installed**, the app is running; its logs say whether it uses kernel or userspace networking, and its
shell runs Tiltas commands such as `tiltas status`.

## 5. Share your home LAN

Your LAN is the network your router hands out, written as a subnet: a NAS at `192.168.1.20` with the mask
`255.255.255.0` is on `192.168.1.0/24`.

Open the app, choose **Edit**, uncomment `TILTAS_ROUTES` with your LAN in the YAML and save. Then:

1. In the console, open **Devices**, then `truenas`. Under **Subnet routes** the LAN shows as **Offered**: switch it on
   to approve it.
2. Open **Access rules** and choose **Add a rule**: under **Who**, who may use the LAN; under **May reach**, a
   **Subnet**, `192.168.1.0/24`, with ports if you want to narrow it.

Nothing reaches the LAN until both are done. More in [Subnet routers](/docs/access/subnet-routers).

## Update

The file above follows `latest`. To know what you run, and to pin it, use the version tag:

1. In the app's shell, run `tiltas version`. Its long version, such as `1.104.7-ql.46770747c`, is the image's tag.
2. To pin that version, choose **Edit** and set the tag on the `image` line:

   ```yaml
       image: tiltas-registry.openpanel.sh/tiltas/tiltas:1.104.7-ql.46770747c
   ```

3. To update, set the tag of a newer version (or `latest`) and save. The app is recreated from the same dataset and
   reconnects as the same Device.

## Remove

1. In the app's shell, run `tiltas logout`. It removes the Device from your Network. Or remove it in the console under
   **Devices**.
2. Under **Apps** → **Installed**, delete the app, then delete its dataset.

If Tailscale also runs on this NAS, see [Tiltas and Tailscale on one machine](/docs/troubleshooting/tailscale).
