Post

Migrating TrueNAS Scale apps to docker compose part 1

I have been running TrueNAS for years as my main homelab NAS. When TrueNAS Scale came out with integrated k3s for applications, I was intrigued about the new app model combined with the migration to Linux from FreeBSD. TrueCharts, a third party app community, started releasing many pre-built apps to TrueNAS scale thatwas suppose to make app management simple, or so I thought. As time went on, the setup became cumbersome and complicated to manage, compounded by TrueCharts constantly re-working their applications. It made management of homelab applications high. I have rebuilt my whole homleab NAS setup at least half a dozen times since then.

TrueNAS recently made the decision to simplify application deployment altogether for their community. In the recent release of TrueNAS 24.10, Electric Eel, kubernetes was removed and and replaced with docker and docker compose. TrueNAS still provided pre-templated apps with docker under the hood which all of my apps migrated to automatically upon upgrade. However, I have been spending more and more time with docker and docker-compose via portainer setup inside my proxmox cluster. So I decided to re-work my applications to be fully defined in code.

Add new Portainer environment

Since I already ran Portainer via LXC on my proxmox cluster with some other services, I decided to expand it’s usage to centralize management of my applications needed on my TrueNAS boxes. The first step is to add a new environment to the portainer configuration. Add a Docker Standalone environment.

Add the name and address of the truenas host. The default port is 9001

Installing Portainer agent

The next step is to deploy the portainer agent to the TrueNAS Scale server. Open the Apps section → Discover Apps → Click triple dots next to Custom App to Install an application via yaml.

Install Custom application via docker-compose yaml file

Here an example of the portainer-agent docker config for docker-compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
version: "3.6"
services:
  portainer-agent:
    restart: unless-stopped
    image: portainer/agent:2.21.4
    environment:
      - PGID=568
      - PUID=1001
      - TZ=America/New_York
    ports:
      - 9001:9001
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes

Once the portainer agent is deployed it should connect and appear in the portainer web UI under Environments

Now we are ready to define and deploy our homelab services to our truenas scale server directly from portainer. In Part 2 we will deploy services with portainer stacks integrated with gitlab directly.

Part 2

This post is licensed under CC BY 4.0 by the author.