TrueNAS: Install Organizr

TrueNAS: Install Organizr
Installing Organizr on your TrueNAS system is a great way to keep track of all the services and different webpages and port you have setup to manage them. Organizer aims to be your one stop shop for your Server’s Frontend. Organizr allows you to setup “Tabs” that will be loaded all in one webpage. You can then work on your server with ease from a single point of contact. Many of the services are integrated in the the ‘iframe’ which means it really feels like a seamless one stop location for managing your server. You can customize and configure all your pages and have them available on a single side tab, or you can setup multiple tabs. One of the best features is that you can set it up to let you know if the service is up or down, it integrates with Sonarr and Radarr and includes a calendar telling you when the next episode airs or a movie releases. It also can show basic information from your Plex server such as recently added and currently playing. It even has support for multiple users with different permission profiles. I haven’t been able to explore all the features yet, but already this software is superior to other front ends such as Heimdall. Organizr is a must install for anybody with a media server setup to make your life so much less complex. This article will walk you through the setup process for Organizr on your TrueNAS server.

This article installs V2.1 (or later) which uses an updated API and so needs some additional instruction which were not included in my previous FreeNAS: Install Organizr article.

This is part of my ongoing series of TrueNAS and FreeNAS setup, configuration and install articles.

Create a New Jail for Organizr

Use the TrueNAS WebUI to create a new jail. You can try and use an existing jail if you’d like, but consider whether there are any web servers in that jail which might conflict with the web server we are going to need for Organizr. To create new jail navigate to “Jails -> Add” and then enter the relevant information.

Install the Dependencies and Tools

We will now need to install all the dependencies for running Organizr, including the webserver (nginx), git and all the necessary php tools. To do so, you will need to go to the shell of the jail, either through the WebUI or using SSH – SSH might be easier if your are planning to copy and paste the commands below, some of which are pretty lenghthy. Once at the command prompt, enter the following:
pkg install -y nginx git wget nano php72 php72-curl php72-pdo php72-sqlite3 php72-simplexml php72-zip php72-openssl php72-hash php72-json php72-session php72-pdo_sqlite php72-filter

If this is a new jail it will probably ask if you want to install the pkg service (used to install software). Enter yes.

Configure PHP for the Web Server

Configure PHP by running the following seven commands which will add text to the PHP config files:

echo 'listen = /var/run/php-fpm.sock' >> /usr/local/etc/php-fpm.conf
echo 'listen.owner = www' >> /usr/local/etc/php-fpm.conf
echo 'listen.group = www' >> /usr/local/etc/php-fpm.conf
echo 'listen.mode = 0660' >> /usr/local/etc/php-fpm.conf
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
sed -i '' -e 's?;date.timezone =?date.timezone = "Universal"?g' /usr/local/etc/php.ini
sed -i '' -e 's?;cgi.fix_pathinfo=1?cgi.fix_pathinfo=0?g' /usr/local/etc/php.ini

Download Organizr V2

Use git to download and a install Organizer with the following command:
git clone -b v2-develop https://github.com/causefx/Organizr /usr/local/www/Organizr

Configure NGINX Webserver

Set Permissions:
chown -R www:www /usr/local/www

Edit the nginx configuration file:
nano /usr/local/etc/nginx/nginx.conf

I got mine working by having it look like this:

user  www;
worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  sage;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/local/www/Organizr;
            index  index.php index.html index.htm;	 
	}
	location /api/v2 {
	    try_files $uri /api/v2/index.php$is_args$args;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        location ~ \.php$ {
            root /usr/local/www/Organizr;
	    fastcgi_split_path_info ^(.+\.php)(/.+)$;
	    fastcgi_pass unix:/var/run/php-fpm.sock;
	    fastcgi_index index.php;
	    fastcgi_param SCRIPT_FILENAME $request_filename;
	    include fastcgi_params;
	}

    }

}

Here’s a list of the changes you need to make to the file:

1) set the user to www at the top of the file. Make sure you remove the “#” at the start of the line;
2) under the server section, location subsection change the root to: /usr/local/www/Organizr;
3) under the server section, location subsection add index.php to the index heading;
4) under the server section, add a new location which points to /api/v2 and includes the try_files line which reads

	location /api/v2 {
	    try_files $uri /api/v2/index.php$is_args$args;
        }

5) uncomment the 50x error page lines;
6) uncomment the “location ~ .php$ {” line and then add the following text after it:

root /usr/local/www/Organizr;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}

Below this section of the file there is alot of extraneos additional information that is for addition webpages etc. You can delete it or just keep it in the file and commented out. At the end, your file should look something like the image below.

TrueNAS Organizr: nginx Config

Start Services and Set them to Start on Boot

Now we are ready to set the services to start on boot by entering the following commands:

sysrc nginx_enable=YES
sysrc php_fpm_enable=YES

You can either reboot the jail now, or have them manually start now with the following commands:
service nginx start
service php-fpm start

That’s it! Organizr is installed and you’re ready to rock! You can now login at to Organizr at http:// [ localIPaddress ] and you will be greeted with a screen like that below to begin configuring the setup!

Organizr for FreeNAS Configuration Screen
Organizr for FreeNAS Configuration Screen

Alright folks, you should be up and running, so happy Organizrin’!

~Raze

Sources:
https://www.ixsystems.com/community/resources/fn11-2-iocage-jails-plex-tautulli-sonarr-radarr-lidarr-jackett-transmission-organizr.58/
https://gist.github.com/mow4cash/e2fd4991bd2b787ca407a355d134b0ff
https://docs.organizr.app/books/setup-features/page/organizr-20–%3E-21-migration-guide

Liked it? Take a second to support digiMoot on Patreon!

12 thoughts on “TrueNAS: Install Organizr

  1. Did a copy/paste of your nginx.conf file, but I’m receiving
    An error occurred.
    Sorry, the page you are looking for is currently unavailable.
    Please try again later.
    If you are the system administrator of this resource then you should check the error log for details.
    Faithfully yours, nginx.
    I even get this when i curl localhost.
    Any advice?

  2. I think I get a similar issue as above, installing on TrueNAS. When I do the “download dependencies and tools” step, I get this in return:
    pkg: http://pkgmir.geo.freebsd.org/FreeBSD:12:amd64/latest/All/nginx-1.18.0_37,2.txz: Not Found
    Everything else seems to install, but not nginx. Not sure if this is related to the fact that nginx isn’t installing but when I try to configure PHP for the Webserver, the first 4 commands work, however the 5th one: “cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini” does not work and I get this returned:
    cp: /usr/local/etc/php.ini-production: No such file or directory
    I did this:
    cd /usr/local/etc/
    ls -al
    and the file “php.ini-production” is no where to be found. The only php file there is “php-fpm.conf” and it contains the 4 lines we echo’d in there. Since php.ini-production is missing I cannot create the php.ini file and I cannot do these following commands either:
    sed -i ” -e ‘s?;date.timezone =?date.timezone = “Universal”?g’ /usr/local/etc/php.ini
    sed -i ” -e ‘s?;cgi.fix_pathinfo=1?cgi.fix_pathinfo=0?g’ /usr/local/etc/php.ini
    I’m not sure if I can continue considering I am missing both nginx and that php.ini-production and php.ini file. Any idea?

      1. Hi man! it worked. Do you have any idea why that worked? And after running and installing this, should I change the FreeBSD.conf back to latest?

      2. I changed it to latest for OpenVPN, I think i’m just going to install organizr on a different jail

      3. Hi there, I’ve tried setting /etc/pkg/FreeBSD.conf to latest and quarterly in separate attempts at the install however when editing this file with nano: nano /usr/local/etc/nginx/nginx.conf i always get the error: [ Directory ‘user/local/etc/nginx’ does not exist ]

  3. hi there, i during the first step im unable to download any php72 pkgs.

    “no packages available to install matching ‘php72’ have been found in the repositories”

    i have tried following this guide:https://computingforgeeks.com/how-to-install-php-7-2-on-freebsd-12/

    however this does not work either.

    there is a section regarding ports where i must enter:
    `cd /usr/ports/lang/php72`

    however i get the error:
    “No such file or directory.”

    any ideas?

  4. for the lazy if you’re having trouble with the php72 install:

    pkg install -y nginx git wget nano php73 php73-curl php73-pdo php73-sqlite3 php73-simplexml php73-zip php73-openssl php73-hash php73-json php73-session php73-pdo_sqlite php73-filter

Leave a Reply

Your email address will not be published. Required fields are marked *