Custom Plugins
6 minute read.
Last Modified 2022-09-29 14:33 -0400Plugins are a technology for easily and securely deploying 3rd party applications directly on TrueNAS storage systems. The web interface allows users to deploy, start, stop, and update applications, along with configuration tasks such as assigning storage to them. Plugins are popular for content, security, development, collaboration, and backup applications for home and business use.
This feature is generally available in TrueNAS CORE and supported by the TrueNAS Community. iXsystems customers with TrueNAS Enterprise hardware and an iXsystems Support contract can contact Support about accessing these features.
This tutorial guides you through creating a custom plugin using the SABnzbd newsreader plugin as an example. A plugin adds metadata that provides an installation source, reasonable defaults, and user interface elements such as an icon. The components for the sabnzbd plugin are:
README.md : A popular convention for a file in markdown format for describing the project.sabnzbd.json : The JSON artifact file containing various plugin properties including an inventory of all other metadata components which might be in the same or a remote repository.overlay/ : An optional directory containing the files to copy into the Jail.ui.json : A file containing the plugin management interface URL and port number.settings.json : An optional JSON file that contains variables used during plugin startup and for its configuration.sabnzbd.png : A.png image such assabnzbd.png that displays in the TrueNAS plugins Index. It is used as the icon.post_install.sh : A shell script to run after jail creation to perform necessary configuration steps. It runs only once.
TrueNAS provides everything necessary for custom plugin development, but a FreeBSD system is also a good choice. The requirements are:
- A TrueNAS or FreeBSD system running iocage (
iocage
). - An internet connection and at least 1 GiB of available disk space.
- A publicly-accessible git repository (
git
), self-hosted or on a service like GitHub, Gitea or GitLab. You can run GitLab as its own plugin. - A text editor such as vi, ee, or nano, all of which are available in TrueNAS.
- Basic knowledge of FreeBSD and shell scripting.
//
and#
comments are not supported in JSON. Copy any examples from the files in the Git repository using raw mode.
Create and initialize a git repository and iocage-plugin-{PLUGIN_NAME}
, where {PLUGIN_NAME} is the name of the plugin.
For example, iocage-plugin-sabnzbd is the name of the Github repository in this example.
Put all the necessary files and directories in the newly created artifact repository.
The necessary files are listed above.
Next, open a pull request to the plugin hub index that adds the artifact file, icon, and entry into the
For guides on how to use Github, see Github Guides.