Self-hosted n8n – Installation and backup on TrueNAS

Table of contents

Installing N8n on TrueNAS – a quick guide and effective configuration backup

Why N8n in the self-hosted version?

Installing N8n on TrueNAS

Creating effective backups

Summary

Installing N8n on TrueNAS – a quick guide and effective configuration backup

Process automation using platforms such as N8n is becoming increasingly popular, especially among companies that value full control over their data and independence from the public cloud. Version self-hosted This tool is an excellent solution for those who want to ensure the security of their infrastructure and avoid passing access keys to external services.

Why N8n in the self-hosted version?

Automation platforms often have access to sensitive data: databases, email accounts, CRM systems, and language models. For this reason, hosting N8n on your own server eliminates the risk of sharing data with third parties. TrueNAS, as a stable and flexible storage management solution, is perfect for this role.

Installing N8n on TrueNAS

The process of installing N8n on TrueNAS is quick and straightforward—the entire process can be completed in just a few minutes.
Just create two dataset:

  • first for N8n application data (configurations, workflows, settings),

  • the second for the Postgres database, where configuration information is stored.

After preparing the environment, change the owner of the dataset to the user. app, which ensures that the application works correctly and eliminates permission issues. Next, using the TrueNAS application panel, you can install N8n, select the appropriate version of Postgres, set passwords, and configure ports. The whole process requires minimal intervention and can be performed directly from the TrueNAS graphical interface.

Creating effective backups

A key element of implementing self-hosted N8n is securing the configuration. This material presents how to create backupów bazy danych Postgres using a simple bash script that utilizes the command docker exec. The script performs automatic dump bazy danych, saving a copy in the selected directory.

Thanks to integration with the system cron In TrueNAS, you can easily schedule regular backups – even every minute, if necessary. Each backup is given a unique name with the current date, which makes it easier to restore data later.

It is worth remembering that full security is ensured by making copies of both the dataset with N8n data and backups of the Postgres database.

Summary

Installing N8n on TrueNAS is a quick way to launch a powerful automation tool in your own infrastructure. Thanks to a simple implementation process and easy backup capabilities, users can safely use automation features without having to entrust their data to external services.

This solution is ideal for IT administrators, small businesses, and automation enthusiasts who value security, independence, and control over their own environment.

Additional information:

How to configure an automatic, free SSL certificate – Nginx proxy manager –  https://youtu.be/FOkJWH8B7Qk

Script for creating backup copies of a Postgress database maintained in a container

				
					#!/bin/bash
/usr/bin/docker exec -i ix-n8n-postgres-1 bash -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_dump -U "$POSTGRES_USER" -h localhost -d "$POSTGRES_DB"' > /mnt/db-bkp_$(date +"%Y%m%d_%H%M").bak