Files
n8n-install/README.md
Yury Kossakovsky c41cf5c0b7 Enhance installation instructions in README.md with detailed prerequisites and updated script usage
- Added a section on prerequisites before installation, including domain name and DNS configuration requirements.
- Clarified the installation process and emphasized the need for a Linux server.
- Updated the script usage instructions to reflect changes in the installation process and included prompts for user input during setup.
2025-05-05 15:56:38 -06:00

18 KiB
Raw Blame History

n8n Ecosystem Installer

n8n Ecosystem Installer is an open, docker compose template designed to significantly simplify the setup of a comprehensive development environment centered around n8n and Flowise. It bundles essential supporting tools like Open WebUI (as an interface for n8n agents), Supabase (database, vector store, auth), Qdrant (high-performance vector store), Langfuse (LLM observability), SearXNG (private metasearch), Grafana/Prometheus (monitoring), Crawl4ai (web crawling), and Caddy (managed HTTPS).

This is Cole's version with a couple of improvements and the addition of Supabase, Open WebUI, Flowise, Langfuse, SearXNG, and Caddy! Also, the RAG AI Agent workflows from the video will be automatically in your n8n instance if you use this setup instead of the base one provided by n8n! Note: these workflows might require external LLM API keys or a separate Ollama instance if you wish to use local models. Also, you have the option during setup to automatically import over 300 community workflows into your n8n instance!

What's included

Self-hosted n8n - Low-code platform with over 400 integrations and advanced AI components

Supabase - Open source database as a service - most widely used database for AI agents

Open WebUI - ChatGPT-like interface to privately interact with your local models and N8N agents

Flowise - No/low code AI agent builder that pairs very well with n8n

Qdrant - Open source, high performance vector store with an comprehensive API. Even though you can use Supabase for RAG, this was kept unlike Postgres since it's faster than Supabase so sometimes is the better option.

SearXNG - Open source, free internet metasearch engine which aggregates results from up to 229 search services. Users are neither tracked nor profiled, hence the fit with the local AI package.

Caddy - Managed HTTPS/TLS for custom domains

Langfuse - Open source LLM engineering platform for agent observability

Crawl4ai - Flexible web crawler designed for AI data extraction workflows.

Prometheus - Open source monitoring and alerting toolkit.

Grafana - Open source platform for monitoring and observability, often used with Prometheus.

Prerequisites

Before you begin, make sure you have the following software installed:

Installation

Prerequisites before Installation

  1. Domain Name: You need a registered domain name (e.g., yourdomain.com).
  2. DNS Configuration: Before running the installation script, you must configure the following DNS A-records for your domain, pointing to the public IP address of the server where you intend to install the n8n ecosystem. Replace yourdomain.com with your actual domain:
    • A n8n.yourdomain.com -> YOUR_SERVER_IP
    • A flowise.yourdomain.com -> YOUR_SERVER_IP
    • A supabase.yourdomain.com -> YOUR_SERVER_IP
    • A webui.yourdomain.com -> YOUR_SERVER_IP (for Open WebUI)
    • A prometheus.yourdomain.com -> YOUR_SERVER_IP
    • A grafana.yourdomain.com -> YOUR_SERVER_IP
    • A langfuse.yourdomain.com -> YOUR_SERVER_IP
    • A searxng.yourdomain.com -> YOUR_SERVER_IP Caddy (the included web server) will use these domains to automatically obtain and manage HTTPS/TLS certificates via Let's Encrypt.
  3. Server: A Linux server (Ubuntu 24.04 LTS x64 recommended and tested). The installation was tested on a machine with 8 GB Memory / 4 Intel vCPUs / 120 GB Disk.

Running the Installer

The recommended way to install is using the provided main installation script. Connect to your server via SSH and run:

git clone https://github.com/kossakovsky/n8n-installer && cd n8n-installer && bash ./scripts/install.sh

This single command automates the entire setup process, including:

  • System preparation (updates, firewall configuration with UFW, Fail2Ban setup for brute-force protection).
  • Docker and Docker Compose installation.
  • Generation of the .env configuration file with necessary secrets and your domain settings.
  • Launching all the services using Docker Compose.

During the installation, the script will prompt you for:

  1. Your primary domain name (Required, e.g., yourdomain.com). This must be the domain for which you configured the DNS records.
  2. Your email address (Required, used for service logins like Flowise, Supabase dashboard, Grafana, etc., and crucial for Let's Encrypt SSL certificates).
  3. An optional OpenAI API key (Not required, used by Supabase AI features and Crawl4ai if provided. Press Enter to skip).
  4. Whether you want to import ~300 ready-made n8n community workflows (y/n, Optional. This can take around 20-30 minutes depending on your server and network).

Upon successful completion, the script will display a summary report containing the access URLs and credentials for the deployed services.

Note

The install.sh script handles the creation and population of the .env file based on .env.example and the information you provide. You typically do not need to manually create or edit this file unless making advanced customizations after the initial setup.

The script will generate secure values for necessary secrets like:

  • N8N_ENCRYPTION_KEY
  • N8N_USER_MANAGEMENT_JWT_SECRET
  • POSTGRES_PASSWORD
  • JWT_SECRET
  • ANON_KEY (derived from JWT_SECRET)
  • SERVICE_ROLE_KEY (derived from JWT_SECRET)
  • DASHBOARD_PASSWORD
  • CLICKHOUSE_PASSWORD
  • MINIO_ROOT_PASSWORD
  • LANGFUSE_SALT
  • NEXTAUTH_SECRET
  • ENCRYPTION_KEY (Langfuse)
  • GRAFANA_ADMIN_PASSWORD
  • And others...

The installation script handles the generation of these secrets automatically.

The script will also configure hostnames in the .env file based on the domain you provide, for example:

  • N8N_HOSTNAME=n8n.yourdomain.com
  • WEBUI_HOSTNAME=openwebui.yourdomain.com
  • FLOWISE_HOSTNAME=flowise.yourdomain.com
  • SUPABASE_HOSTNAME=supabase.yourdomain.com
  • SEARXNG_HOSTNAME=searxng.yourdomain.com
  • LANGFUSE_HOSTNAME=langfuse.yourdomain.com
  • GRAFANA_HOSTNAME=grafana.yourdomain.com
  • PROMETHEUS_HOSTNAME=prometheus.yourdomain.com
  • LETSENCRYPT_EMAIL=your-email-address (filled with the email you provide)

Service Startup

The install.sh script automatically starts all services using Docker Compose after the configuration is complete. You generally do not need to start services manually after the initial installation. If you need to restart services after stopping them manually, the scripts/04_run_services.sh script can be used, or you can manage them via standard docker compose commands (though using the provided scripts is recommended).

Deploying to the Cloud

Prerequisites for the below steps

  • Linux machine (preferably Unbuntu) with Nano, Git, and Docker installed

Extra steps

Before running the above commands to pull the repo and install everything:

  1. Run the commands as root to open up the necessary ports:

    • ufw enable
    • ufw allow 8000 && ufw allow 3000 && ufw allow 5678 && ufw allow 3002 && ufw allow 80 && ufw allow 443
    • ufw allow 3001 (if you want to expose Flowise, you will have to set up the environment variables to enable authentication)
    • ufw allow 8080 (if you want to expose SearXNG)
    • ufw reload
  2. Set up A records for your DNS provider to point your subdomains you'll set up in the .env file for Caddy to the IP address of your cloud instance.

    For example, A record to point n8n to [cloud instance IP] for n8n.yourdomain.com

Quick start and usage

The main component of the self-hosted AI starter kit is a docker compose file pre-configured with network and disk so there isn't much else you need to install. After completing the installation steps above, follow the steps below to get started.

  1. Open http://localhost:5678/ in your browser to set up n8n. You'll only have to do this once. You are NOT creating an account with n8n in the setup here, it is only a local account for your instance!

  2. Open the included workflow: http://localhost:5678/workflow/vTN9y2dLXqTiDfPT

  3. Create credentials for every service:

    Postgres (through Supabase): use DB, username, and password from .env. IMPORTANT: Host is 'db' (name of the Supabase Postgres service within the Docker network).

    Qdrant URL: http://qdrant:6333 (API key can be whatever since this is running locally)

    Google Drive: Follow this guide from n8n. Don't use localhost for the redirect URI, just use another domain you have, it will still work! Alternatively, you can set up local file triggers.

  4. Select Test workflow to start running the workflow.

  5. Make sure to toggle the workflow as active and copy the "Production" webhook URL!

  6. Open http://localhost:3000/ in your browser to set up Open WebUI. You'll only have to do this once. You are NOT creating an account with Open WebUI in the setup here, it is only a local account for your instance!

  7. Go to Workspace -> Functions -> Add Function -> Give name + description then paste in the code from n8n_pipe.py

    The function is also published here on Open WebUI's site.

  8. Click on the gear icon and set the n8n_url to the production URL for the webhook you copied in a previous step.

  9. Toggle the function on and now it will be available in your model dropdown in the top left!

To open n8n at any time, visit http://localhost:5678/ in your browser. To open Open WebUI at any time, visit http://localhost:3000/.

With your n8n instance, you'll have access to over 400 integrations and a suite of basic and advanced AI nodes such as AI Agent, Text classifier, and Information Extractor nodes. To keep everything local, just remember to use the Ollama node for your language model (if configured) and Qdrant or Supabase as your vector store. nodes. Remember to use Qdrant or Supabase as your vector store. If you wish to use local language models, you can configure the Ollama node in n8n, assuming you have an Ollama instance running separately.

Note

This starter kit is designed to help you get started with self-hosted AI workflows. While it's not fully optimized for production environments, it This installer is designed to help you get started quickly with n8n and related tools. While it's not fully optimized for production environments, it combines robust components that work well together for proof-of-concept projects. You can customize it to meet your specific needs

Upgrading

To update all containers to their latest versions (n8n, Open WebUI, etc.), run these commands: and pull the latest changes from the repository, use the update script:

sudo bash ./scripts/update.sh

This script will:

  1. Pull the latest changes from the Git repository.
  2. Stop the currently running services using docker compose down.
  3. Pull the latest Docker images for all services using docker compose pull.
  4. Ask if you want to re-run the n8n workflow import (useful if new workflows were added).
  5. Restart the services using the scripts/04_run_services.sh script.

Troubleshooting

Here are solutions to common issues you might encounter:

Supabase Issues

  • Supabase Pooler Restarting: If the supabase-pooler container keeps restarting itself, follow the instructions in this GitHub issue.

  • Supabase Analytics Startup Failure: If the supabase-analytics container fails to start after changing your Postgres password, delete the folder supabase/docker/volumes/db/data.

  • If using Docker Desktop: Go into the Docker settings and make sure "Expose daemon on tcp://localhost:2375 without TLS" is turned on

  • Supabase Service Unavailable - Make sure you don't have an "@" character in your Postgres password! If the connection to the kong container is working (the container logs say it is receiving requests from n8n) but n8n says it cannot connect, this is generally the problem from what the community has shared. Other characters might not be allowed too, the @ symbol is just the one I know for sure!

n8n is full of useful content for getting started quickly with its AI concepts and nodes. If you run into an issue, go to support.

🎥 Video walkthrough

🛍️ More AI templates

For more AI workflow ideas, visit the official n8n AI template gallery. From each workflow, select the Use workflow button to automatically import the workflow into your local n8n instance.

Learn AI key concepts

Local AI templates

Example AI templates (May require external APIs or separate local model setup)

Tips & tricks

Accessing local files

The self-hosted AI starter kit will create a shared folder (by default, The installer will create a shared folder (by default, located in the same directory) which is mounted to the n8n container and allows n8n to access files on disk. This folder within the n8n container is located at /data/shared -- this is the path you'll need to use in nodes that interact with the local filesystem.

Nodes that interact with the local filesystem

📜 License

This project (originally created by the n8n team, link at the top of the README) is licensed under the Apache License 2.0 - see the LICENSE file for details.

Monitoring n8n with Prometheus and Grafana

Prometheus and Grafana are included for monitoring your n8n instance.

To add n8n metrics:

  • n8n exposes metrics at http://n8n:5678/metrics (if not, see n8n docs for enabling Prometheus metrics).
  • Prometheus is pre-configured to scrape n8n metrics.
  • Grafana can be configured to use Prometheus as a data source (default URL: http://prometheus:9090).

Default credentials for Grafana:

  • Username: admin
  • Password: (set in .env as GRAFANA_ADMIN_PASSWORD)

You can import community dashboards for n8n or create your own!