TrueNAS AppsTrueNAS Apps: Tutorials
Application maintenance is independent from TrueNAS version release cycles.
App versions, features, options, and installation behavior at time of access might vary from documented tutorials and UI reference.

Home Assistant

The TrueNAS Home Assistant app provides a streamlined way to install, manage, and leverage the powerful capabilities of Home Assistant. TrueNAS deploys the Home Assistant app in a Docker container using Docker Compose. Once the app is successfully deployed, you can access the Home Assistant web interface directly from TrueNAS. The Home Assistant interface lets you control, automate, and monitor various smart home devices. With support for thousands of integrations, you can customize automations, create detailed dashboards, and easily manage your smart home setup.

Home Assistant provides a Quickstart Setup Guide with step-by-step instructions to help users get started.

Before You Begin

Prepare TrueNAS before installing Home Assistant by:

  • Set a pool for applications to use if not already assigned.

    You can use either an existing pool or create a new one. TrueNAS creates the ix-apps (hidden) dataset in the pool set as the application pool. This dataset is internally managed, so you cannot use this as the parent when you create required application datasets.

    After setting the pool, the Installed Applications screen displays Apps Service Running on the top screen banner.

  • Locate the run-as user for the app.

    Take note of the run-as user for the app, shown on the app information screen in the Run As Context widget and in the Application Metadata widget on the Installed applications screen after the app fully deploys. The run-as user(s) get added to the ACL permissions for each dataset used as a host path storage volume.

  • Create datasets for the storage volumes for the app.

    Do not create encrypted datasets for apps if not required! Using an encrypted dataset can result in undesired behaviors after upgrading TrueNAS when pools and datasets are locked. When datasets for the containers are locked, the container does not mount, and the apps do not start. To resolve issues, unlock the dataset(s) by entering the passphrase/key to allow datasets to mount and apps to start.

    Go to Datasets and select the pool or dataset where you want to place the dataset(s) for the app. For example, /tank/apps/appName.

Create a parent dataset, such as HomeAssistant, within your apps pool. Home Assistant uses three datasets: config-storage, media-storage, and data-storage. Ensure you create the necessary datasets before you install the app since Home Assistant needs them to configure properly. Select apps as the Dataset Preset for these datasets. You can modify the dataset ACLs at the time of creation, or modify them later when adding them in the app.

Follow the instructions below in Creating Datasets for Apps to correctly set up these datasets.

Creating Datasets for Apps

When creating datasets for apps follow these steps:

  1. Go to Datasets, select the location for the parent dataset if organizing required datasets under a parent dataset, then click Add Dataset. For example, select the root dataset of the pool, and click Add Dataset to create a new parent called apps or appName*, where appName is the name of the app.

    Do not create the app datasets under the ix-applications or ix-apps dataset.

  2. Enter the name of the dataset, then select Apps as the Dataset Preset. Creating the parent dataset with the preset set to Generic causes permissions issues when you try to create the datasets the app requires with the preset set to Apps.

  3. Click Save. Return to dataset creation when prompted rather than configuring ACL permissions.

    You can set up permissions (ACLs) for a dataset after adding it by selecting Go to ACL Manager to open the Edit ACL screen, or wait and use the app Install wizard ACL settings to add permissions. You can also edit permissions after installing the app using either method.

  4. Select the parent dataset and then click Create Dataset to open the Add Dataset screen again.

  5. Enter the name of a dataset required for the app, such as config, select Apps as the Dataset Preset, and then click Save. When prompted, return to creating datasets rather than setting up ACL permissions.

  6. Repeat for remaining datasets required for the app.

  • (Optional) Create a new TrueNAS user account to manage this application. When creating a new user account to manage this application or using an existing TrueNAS administrator account, enable sudo permissions for that TrueNAS user account, select Create New Primary Group, and add the appropriate group in the Auxiliary Group for the type of user you want to create. Make note of the UID for the new user to add in the installation wizard.

    Add the user ID to the dataset ACL permissions when setting up app storage volumes in the Install app wizard.

Installing the Application

This basic procedure covers the required Home Assistant app settings. For optional settings, see Understanding App Installation Wizard Settings.

You can have multiple deployments of the same app (for example, two or more from the stable or enterprise trains, or a combination of the stable and enterprise trains).

Naming Multiple App Deployments

Each deployment of the same app requires a unique name. App names can include numbers, dashes, or underscores (for example, syncthing2, syncthing-test, syncthing_1, minio2, etc.).

Use a consistent file-naming convention to avoid conflict situations where data does not or cannot synchronize because of file name conflicts. Path and file names in apps are case-sensitive. For example, a file named MyData.txt is not the same as the mydata.txt file in Syncthing.

Go to Apps, click on Discover Apps, and locate the app widget by either scrolling down to it or typing the name into the search field. For example, to locate the Home Assistant app widget, begin typing Home Assistant into the search field to show app widgets matching the search input.

Example of Locating an App Widget
Figure 2: Example of Locating an App Widget

If this is the first application you are installing, TrueNAS displays a dialog about configuring apps.

Configuring Apps Dialog

Click Confirm then Agree to close the dialog and open the application details screen.

If not the first time installing apps the dialog does not show, click on the widget to open the app information screen.

Home Assistant Information Screen
Figure 4: Home Assistant Information Screen

Click Install to open the app installation wizard.

Application configuration settings are grouped into several sections, each explained below in Understanding App Installation Wizard Settings. To find specific fields begin typing in the Search Input Fields search field to show the section or field, scroll down to a particular section, or click on the section heading in the list of sections on the upper-right of the wizard screen.

Home Assistant Install Screen
Figure 5: Home Assistant Install Screen

Accept the default value or enter a name in Application Name field. In most cases use the default name, but if adding a second deployment of the application you must change this name.

Accept the default version number in Version. When a new version becomes available, the application shows an update badge and the Application Info widget on the Installed applications screen shows the Update button.

Enter the Home Assistant Configuration settings.

The TrueNAS app is configured with all the required environment variables, but if you want to further customize the container, click Add to the right of Additional Environment Variables for each to enter the variable(s) and values(s).

Add your Storage Configuration settings.

Set Host Path (Path that already exists on the system) in Type for Data Storage. Select Enable ACL, and then enter or browse to select the data-storage dataset to populate the Host Path field.

Add Home Assistant Storage Configurations
Figure 6: Add Home Assistant Storage Configurations

Click Add to the right of ACL Entries for each user or group entry you want to add. For example, add the 568 user and 0, and give each FULL_CONTROL Access.

Select Force Flag.

Repeat the storage steps above each additional storage volume. See Storage Configuration Settings below for more information.

Accept the defaults in Resources Configuration, and select the GPU option if applicable.

Click Install. A progress dialog displays before switching to the Installed applications screen. The Installed screen displays with the nextcloud app in the Deploying state. Status changes to Running when ready to use.

Click Web UI on the Application Info widget to open the Home Assistant web portal sign-up screen.

Home Assistant Sign Up Screen
Figure 7: Home Assistant Sign Up Screen
Home Assistant Dashboard
Figure 8: Home Assistant Dashboard

Understanding App Installation Wizard Settings

The following section provides more detailed explanations of the settings in each section of the Install Home Assistant installation wizard.

Application Name Settings

Accept the default value or enter a name in Application Name field. In most cases use the default name, but if adding a second deployment of the application you must change this name.

Accept the default version number in Version. When a new version becomes available, the application shows an update badge and the Application Info widget on the Installed applications screen shows the Update button.

Home Assistant Configuration Settings

Home Assistant configuration settings include setting up credentials, APT packages (previously referred to as the commands), the host IP and port, data directory path, upload limits, execution times, memory limits and cache memory consumption, adding a cron job with schedule, and adding additional environment variables.

The Home Assistant Configuration section contains a Database Password field. This is where you set the password Home Assistant uses to securely connect to your TrueNAS system. This is not the field where you enter your current Home Assistant password or the password you intend to use to log into the app.

Upon deployment, users can set the desired Home Assistant login credentials or log in to an existing account from the Home Assistant UI.

Home Assistant Add Devices Option
Figure 9: Home Assistant Add Devices

Users can select the Add Devices drop-down menu to configure device settings for any Home Assistant-compatible devices that they currently own. Users do not have to own any devices before installing the app and can leave this section blank if not applicable.

Adding Environment Variables

The app wizard is configured with all settings required to deploy the container, but you can add additional settings if you want to further customize the app in TrueNAS.

Click Add to the right of Environmental Variables to show a set of fields to configure the application with additional variables.

You can add environment variables to the app configuration after deploying it. Click Edit on the Application Info widget for the app found on the Installed Application screen to open the edit screen.

Refer to Home Assistant documentation for more information on environment variables.

User and Group Configuration

It is recommended to make a user and group for the Home Assistant app. If you choose to follow the recommendation, ensure that the user and group have full access to the config-storage, media-storage, and data-storage datasets.

Some TrueNAS apps have predefined run-as user and group IDs. These assignments vary based on the app train and other variables such as installing but not running as the root user.

Default user and group IDs are:

  • 473 for the MinIO stable train app.
  • 568 (apps user), used in some community apps and all apps in the enterprise train
  • 999 (netdata user), used for all postgres storage volumes
  • 0 (root user).

Accept the default user and group ID in the User and Group Configuration section or enter the user ID for a new TrueNAS user created to serve as the administrator for this app.

Create any app administrator user before installing the application, and take note of the UID. Enter this user ID when configuring the user for the app and as the user when setting up storage volume permissions.

Network Configuration

The default web port for Home Assistant is 30027.

All TrueNAS apps are assigned default port numbers. Accept the default port numbers, but if changing port number assignments, enter a number within the range 1-65535, however, 0-1024 might require the application to have elevated privileges. Before changing default ports, refer to the TrueNAS default port list for a list of assigned and available port numbers.

To use a certificate, best practice is to create the self-signed certificate before you begin using the app installation wizard. If you did not create a certificate before starting the installation wizard you can select the default TrueNAS certificate and edit the app to change the certificate after deploying the application.

Select the certificate created in TrueNAS for the app from the Certificate dropdown list.

Storage Configuration

TrueNAS provides two options for storage volumes: ixVolumes and host paths.

Setting the Storage Volume Type

To allow TrueNAS to create the storage volume, leave Type set to ixVolume (Dataset created automatically by the system). This adds a storage volume for the application nested in the hidden ix-apps dataset, located on the pool selected as the apps pool. Using ixVolume is intended for a test deployment of an app but not for a full app deployment, as data does not persist for these volumes after deleting the app where a dataset does. Datasets make recovering, transferring, and accessing app configuration, user, or other data possible where ixVolumes do not.

To use an existing dataset, which is the recommended option, set Type to Host Path (Path that already exists on the system).

If the install wizard shows a Mount Path, either accept the default value or enter the correct mount path. For example, if the dataset name is data, enter /data as the mount path.

Select Enable ACL to define ACL permissions and to populate the Host Path field by either entering or browsing to and selecting the location of the dataset. Populating the Host Path with the dataset location and then selecting Enable ACL clears the values, so we recommend selecting Enable ACL before entering the host path.

Repeat the above for each required dataset.

Home Assistant needs three datasets for host path storage volume configurations:

  • config-storage to use as the Configuration storage volume.
  • data-storage to use as the User Data storage volume.
  • media-storage to use as the Media Data storage volume.

If you group these datasets under a parent dataset named Home Assistant, configure the ACL permissions for this parent dataset and add an ACE entry for the Home Assistant user. If the app includes postgres storage volumes, include the following information If the app installation wizard cannot set up the ACL type or correctly add user permissions for the postgres storage volume, you must configure these outside the install wizard using the Add Dataset and Edit ACL screens. When adding the postgresdata dataset set it up with a POSIX ACL, and add the Home Assistant user as the owner user and group with full control permissions.

If you have a postgres dataset, also include information in the Before You Begin section about adding the dataset and permissions.

See the instructions in the Before You Begin section for more on creating both the parent and postgres_data datasets and configuring the ACL permissions for each. You can add extra storage volumes at the time of installation or edit the application after it deploys. Stop the app before editing settings.

Configuring Additional Storage Volumes

If you choose to configure additional storage volumes, click Add to the right of Additional Storage to show the Type field with three options:

  • HostPath (Path that already exists on the system)
  • ixVolume (Dataset created automatically by the system)
  • SMB/CIFS Share (Mounts a volume to a SMB share)

The host path option requires an existing dataset on the system. The SMB/CIFS share option shows settings for configuring an SMB share as a storage option.

Setting Dataset ACL Permissions

You can configure ACL permissions for the required dataset in the Install Home Assistant wizard, or from the Datasets screen any time after adding the datasets.

Select Enable ACL to show the ACL and ACE Entries options. Configure ACE entries for each UID and/or GID you recorded from the Run As Context widget in Before You Begin.

Configuring ACE Entries

Enter or browse to select the dataset and populate Host Path.

Next, click Add to the right of ACL Entries to show the permissions settings. Set ID Type to Entry is for a USER or Entry is for a GROUP. If you configured a group in TrueNAS that you want to give access to instead of a single user, set the ID to the group option and enter the GID for that group.

Enter the UID and/or GID as one of the following:

  • The default app user:
    • 568 for apps in all trains if the app can run as any non-root user.
    • 999 for all postgres storage volumes.
    • 0 if running as root.
    • 473 for MinIO app in the stable train.
  • The run-as-user UID set as a default for the app. The run-as user shows on the app details screen in the Run As Content widget, and on the Installed application screen after the app deploys. You can refer to the tutorial for the app, or look in the questions.yaml file found in the GitHub repository for the application to find this UID/GID.
  • The user ID for the new or existing TrueNAS user added to serve as the administrator for the app.

If the app shows User and Group Configuration settings, the default UID shows on the screen. If not, choose the run-as user ID found in the Run As Content widget.

Use the default user ID 999 for all postgres storage volumes, not the run-as user.

If you created a new TrueNAS user to serve as the app administration user, add an entry record and enter the UID for this user in addition to the run-as user ID.

When adding the ACL entry for the run-as user, default user, and/or optional TrueNAS app administrator user, and postgres user ID, set the Access permissions level to FULL CONTROL.

Select Force Flag to apply the ACL even if the path has existing data. This allows you to update the app when an update is available.

Adding ACL Permissions from the Datasets Screen First, select the dataset row, then scroll down to the Permissions widget, and then click Edit to open the Edit ACL screen. Change the @owner and @group values from root to the administrative user for your TrueNAS system, and click apply for each. Next, add an ACL entry for the run-as user. For Home Assistant, the run-as users is 0 for root. Add a user entry for this user. Save the ACL before leaving the screen.

Mounting an SMB Share Storage Volume

TrueNAS Additional Storage options include the ability to mount an SMB share inside the container pod.

Set Type an SMB/CIFS Share (Mounts a volume to a SMB share) to add an SMB share storage volume.

Select Read Only to make the storage volume read only.

Enter the path inside the container to mount the storage for the share volume in Mount Path.

Enter the server address for the SMB share in Server, the path to mount the SMB share in Path, and the share authentication user credentials in User and Password. (Optional) enter the share domain name in domain.

Permissions are currently limited to the permissions of the user that mounted the share.

Use the SMB option for data synchronization between a share and the app if the option shows on the screen. A present, only the Syncthing app includes this option.

Resources Configuration

Resources Configuration Settings
Figure 13: Resources Configuration Settings

Accept the default values in Resources Configuration or enter new CPU and memory values. By default, this application is limited to use no more than 2 CPU cores and 4096 megabytes available memory. The application might use considerably less system resources.

To customize the CPU and memory allocated to the container the app uses, enter new CPU values as a plain integer value (letter suffix is not required). The default is 4096.

Accept the default value (4 Gb) allocated memory or enter a new limit in bytes. Enter a plain integer without the measurement suffix, for example, 129 not 129M or 123MiB.