🎬

Video tutorial coming soon.

⚙️ Setup n8n — Self-Hosted Workflow Automation

Deploy n8n on Ubuntu with Docker — a powerful self-hosted workflow automation platform with 500+ integrations, a visual node editor, JavaScript code nodes, and built-in AI agent capabilities. Replace Zapier and Make at a fraction of the cost with full data ownership.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install — n8n with persistent storage and queue mode ready in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/automation/n8n/n8n-ubuntu.sh
chmod +x n8n-ubuntu.sh
sudo bash n8n-ubuntu.sh

Tutorial Steps

1 Download & Run the Script

The script installs Docker and deploys n8n with a persistent data volume. Your workflows, credentials, and execution history are stored safely.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/automation/n8n/n8n-ubuntu.sh
chmod +x n8n-ubuntu.sh
sudo bash n8n-ubuntu.sh

2 Access the n8n Editor

Open your browser and navigate to the n8n workflow editor. Create your owner account on the first visit:

http://<your-server-ip>:5678

3 Add Your Credentials

Go to Credentials in the left sidebar and add credentials for the services you want to connect — Gmail, Slack, GitHub, Telegram, or any of the 500+ supported integrations.

4 Build Your First Workflow

Click "New Workflow", drag a trigger node onto the canvas, add action nodes, connect them, and click "Activate". Your automation runs on schedule or in response to events — 24/7 without any manual intervention.

Ports Used

PortPurpose
5678n8n Web UI & Webhook Receiver

Overview

n8n (pronounced 'nodemation') is an open-source, self-hostable workflow automation platform that lets you connect virtually any service, API, or database using a visual node-based editor. Unlike cloud automation tools such as Zapier or Make, n8n runs entirely on your own server — giving you full data ownership, no per-execution pricing caps, and the ability to add custom code nodes in JavaScript or Python. It ships with 400+ built-in integrations covering everything from webhooks and databases to AI models, CRMs, and DevOps tools.

Why Use It

n8n combines the approachability of a no-code tool with the power of full custom code — you can drag-and-drop 90 % of a workflow and drop into a Code node for the remaining 10 %. Self-hosting means zero per-execution fees and complete data privacy, which matters when automations touch customer records, financial data, or internal credentials. The AI agent framework (LangChain-based) is built-in, so you can build tool-using agents, RAG pipelines, and multi-step reasoning chains without a separate orchestration layer.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              n8n uses port 5678 for both the web editor and webhook receiver. Only expose this port through a reverse proxy with TLS — never directly. For public webhook integrations (Stripe, GitHub, Slack), add a DNS record and proxy the /webhook/ path exclusively. Keep the /n8n-internal/ and editor paths behind authentication or IP allowlisting.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    Zapier and Make (formerly Integromat) are the dominant cloud alternatives — easier to start but expensive at scale and no data ownership. ActivePieces is a newer open-source competitor with a similar visual editor. Node-RED is the other major self-hosted option — more code-centric, popular in IoT, but fewer SaaS integrations out of the box. Temporal is a developer-grade workflow orchestration engine for engineering teams who want code-first durability guarantees. Windmill is another open-source option aimed at developers who prefer writing scripts over visual nodes.

                    When Not to Use It

                    If your automations are extremely simple (send one email on a form submit) a lighter tool like ntfy or a single cron script avoids the overhead of maintaining an n8n instance. If your team is non-technical and needs a purely no-code experience with guaranteed uptime SLAs, the managed n8n Cloud or Zapier may be more appropriate. For high-throughput, mission-critical event streaming (millions of events/hour), a dedicated message broker like Kafka with purpose-built consumers is a better fit than n8n's workflow engine.

                    Need Help Setting Up n8n?

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      Is n8n really free to self-host?

                      Yes — n8n is open-source under a Sustainable Use License, which allows free self-hosting for internal use without execution limits. The paid n8n Cloud plan adds managed hosting and premium support. The only restriction is that you cannot resell n8n itself as a hosted service to customers without a commercial license. For internal automation, self-hosting is completely free.

                      How do I connect n8n to an external service like Slack or Google Sheets?

                      Go to Credentials → Add Credential, search for the service (e.g., 'Slack'), and follow the OAuth or API key setup. n8n guides you through each step. Once saved, the credential appears in the dropdown of any compatible node. Credentials are encrypted at rest with your N8N_ENCRYPTION_KEY and never transmitted to n8n's servers.

                      Can n8n run AI agents?

                      Yes — n8n has a native AI Agent node built on LangChain. You connect it to an LLM (OpenAI, Anthropic, Ollama, etc.), give it tools (HTTP requests, database queries, custom functions), and it autonomously decides which tools to call to complete a task. You can chain multiple agents, pass memory between them, and trigger agent workflows from webhooks, schedules, or other automations.

                      What is the difference between basic mode and queue mode?

                      Basic mode runs everything in a single process — simple to set up, fine for low-volume automation. Queue mode adds Redis as a message broker and separates the main process (webhook receiver, editor) from worker processes (execution). This allows horizontal scaling, prevents long-running jobs from blocking new webhook responses, and improves reliability under load. Enable queue mode by setting EXECUTIONS_MODE=queue and providing Redis credentials in your environment.

                      How do I expose n8n webhooks publicly without exposing the editor?

                      In your reverse proxy (e.g., Nginx Proxy Manager), create two location blocks on the same domain: proxy `/webhook/` and `/webhook-test/` to n8n, and restrict `/` (the editor) to an IP allowlist or basic auth. This lets external services like Stripe or GitHub reach your webhook endpoints while the workflow editor stays private.

                      How do I back up and restore n8n workflows?

                      Export workflows from Settings → Import/Export → Export all workflows. This downloads a JSON file you can commit to git. For a full backup including execution history and credentials, back up the n8n Docker volume directory. Restore by importing the JSON via the same menu. For credentials, you'll need to re-enter secrets after a fresh install since the encryption key changes.

                      Can I run n8n on a small VPS?

                      Yes — n8n runs comfortably on a 1 vCPU / 1 GB RAM VPS for light workloads (a few hundred executions per day). For heavier automation or AI agent workflows with large context windows, 2 GB+ RAM is recommended. If you run Ollama on the same server for local LLM inference, allocate at least 8 GB RAM. Use queue mode and limit concurrent executions to match your server's capacity.

                      What happens to my data if n8n crashes or restarts?

                      Workflows and credentials are persisted in the SQLite database (or PostgreSQL if configured) inside the Docker volume — a restart does not lose them. Executions that were actively running when the crash occurred are marked as 'crashed' in the execution log. In queue mode, queued jobs that hadn't started are safe in Redis and will be picked up when workers restart. Enable EXECUTIONS_DATA_SAVE_ON_ERROR=all to ensure failed execution data is always written to disk for debugging.