The easiest and fastest way to install n8n is to use the Portainer template provided by our team. This method minimizes manual configuration and ensures a stable, production-ready setup in just a few minutes.

Requirements:

  • a valid domain directed to the IP address of your server or VPS;
  • VPS with Portainer installed using the script from Unihost;
  • already deployed NPM (Nginx Proxy Manager) – for proxying and generating a free Let’s Encrypt certificate;
  • already deployed PostgreSQL database server;

Step 1: To install n8n, please open Portainer and navigate to Templates

Log into your Portainer dashboard.

Navigate to the App Templates section from the left sidebar.

Select the n8n Template provided by our team.
(If you don’t see the template, make sure your Portainer is connected to the correct template URL or manually import the template.)

Step 2: Fill Out Template Variables

Once you open the n8n template in Portainer, you’ll see a list of configuration fields. Here’s a breakdown of each field with an example from the screenshot:

  1. Name – Set the name of the stack or container (Example: n8n);
  2. Public domain – Enter the domain name where your n8n instance will be accessible. This domain must already point to your server’s IP address (Example: example.org);
  3. Encryption key – A Base64-encoded string used to encrypt credentials stored in n8n. You can generate one using the command: openssl rand -base64 48 (Example:  S8EWtT68IkDtC4HjNaeE3y/2OvJmDRL+B60np2OuKYTPksqqjcb3tc7GuoL/A5ZB);
  4. Database name – The name of the PostgreSQL database that n8n will use (Example: n8n_db);

  5. n8n DB user – The username that n8n will use to connect to the PostgreSQL database (Example: n8n_db_user);

  6. n8n DB password – The password for the n8n database user (Example: n8n_db_password). It is strongly recommended to use a password that meets all security requirements.;

  7. PostgreSQL admin user – The PostgreSQL admin user that has permission to create the database and grant privileges. Used only during initial setup (Example: postgres_admin_user);

  8. PostgreSQL admin password – The password for the PostgreSQL admin user (Example: postgres_admin_password);

PostgreSQL host, Public protocol, PostgreSQL port – often do not require editing and remain unchanged.
Timezone – The timezone setting for the n8n instance (Example: Europe/London). Available time zones can be found, for example, here.

Step 3: Deploy the Stack

Click Deploy the Stack.

Portainer will start pulling the necessary Docker images and create containers.

Step 4: Create and configure a proxy host with SSL via Nginx Proxy Manager

Go to your Nginx Proxy Manager instance (already installed on the same server) and create a new proxy host using your domain name, which should already point to your server’s IP address. Refer to the screenshot for guidance.

Proxying traffic from your domain to the internal n8n container (typically on port 5678).

Generating and applying an SSL certificate via Let’s Encrypt.

This ensures your instance of n8n is accessible over HTTPS.

Step 5: First-Time Access and Setup

When you open your n8n domain in the browser, you should see the n8n setup screen. Create an admin user on first login.

Final Notes

Using a pre-configured template in Portainer saves time and reduces the chance of misconfigurations. With n8n, PostgreSQL, and Nginx Proxy Manager working together, you’ll have a stable and secure automation platform ready to go.

Tagged: