Self-hosting n8n: what you need to know before you start

What's involved in running the n8n automation platform on your own infrastructure, including hosting, security, backups, scaling, updates and licence considerations.

By the UK Technology Hub teamPublished 4 minute read

The short answer

Self-hosting n8n gives you control over data, costs and customisation, but makes you responsible for hosting, security, updates, backups and uptime. Run it with a production database rather than the default, secure it behind HTTPS and authentication, protect the encryption key for stored credentials, back up regularly, update carefully and monitor workflows. Check n8n's licence terms for your intended use.

n8n is a popular workflow automation tool that can run in n8n's cloud or on your own infrastructure. Self-hosting appeals to teams that want data control and predictable costs. It's powerful, but it's also a production system that needs care. Our comparison of Zapier, Make and n8n covers when n8n is a good fit.

Why self-host

  • Data control: workflow data and credentials stay in your environment.
  • Cost: potentially lower costs for high volumes.
  • Customisation: custom nodes, code and integrations with internal systems.
  • Network access: reach systems on private networks.

Check the licence

n8n is distributed under a "fair-code" licence with specific terms about how it can be used, especially for offering it as a service to others. Read the current licence and terms for your use case, and consider enterprise licensing if you need advanced features or support.

Hosting options

  • A virtual server with Docker.
  • Container platforms on cloud providers.
  • Kubernetes for larger, scaled deployments.

Docker-based setups are the most common starting point.

Production setup essentials

Use a proper database

n8n can use a simple file-based database by default, but production setups typically use PostgreSQL for reliability and scale.

HTTPS and domain

Run n8n behind a reverse proxy with HTTPS. Webhooks need a public URL if external services call them. Our guide to webhooks explains why reliability and security matter for incoming events.

Authentication and access

  • Enable user management and strong passwords.
  • Use single sign-on where available.
  • Restrict access by network if possible.
  • Give users only the permissions they need.

Protect the encryption key

n8n encrypts stored credentials with an encryption key. Back it up securely. If it's lost, stored credentials can't be decrypted; if it leaks, credentials are at risk.

Environment variables and secrets

Configure settings and secrets through environment variables or a secrets manager, never in shared files or repositories.

Backups

Back up:

  • The database, which includes workflows, credentials and execution data.
  • The encryption key.
  • Configuration files.

Test restores regularly.

Updates

n8n releases updates frequently. Read release notes, test updates in a staging environment, back up first and update during quiet periods. Pin versions rather than always pulling the latest automatically.

Scaling

For higher volumes, n8n supports queue mode, separating the main instance from worker processes using a message queue such as Redis. This spreads workflow executions across workers.

Monitoring

  • Uptime of the n8n instance and webhook endpoints.
  • Failed executions, with error workflows that send alerts.
  • Server resources: CPU, memory and disk.
  • Execution data growth, with pruning settings to manage database size.

Security considerations

  • Keep the server and Docker images updated.
  • Limit who can create workflows that run code.
  • Review community nodes before installing.
  • Audit credentials and remove unused ones.
  • Log access and changes.

When to choose n8n Cloud instead

If you don't have the skills or time to manage infrastructure, the hosted version removes operational work while keeping n8n's flexibility.

Hosting costs and sizing

A small n8n setup with modest workflow volumes can run on a modest virtual server. As workflows, executions and AI steps increase, you'll need more memory and CPU, a managed PostgreSQL database and possibly queue mode with workers. Monitor resource use and scale before performance suffers.

Organising workflows

As the number of workflows grows, organisation matters:

  • Use clear naming conventions that describe the trigger and purpose.
  • Tag workflows by team or system.
  • Document what each workflow does and who owns it.
  • Separate test and production workflows.

Error workflows

n8n lets you define error workflows that run when another workflow fails. Use them to send alerts to chat or email with details of the failure, so problems are spotted quickly. Combine this with uptime monitoring of the n8n instance itself.

Disaster recovery

Plan how you'd restore n8n if the server failed: where backups live, how to redeploy the container, how to restore the database and encryption key, and how long it would take. Test the plan at least once.

How we help

Our AI solutions team designs and builds n8n workflows, including AI automations. Our web app developers integrate n8n with your systems, and our maintenance plans handle hosting, updates, backups and monitoring for self-hosted instances.

Frequently asked questions

Is self-hosted n8n free?

Self-hosting can avoid subscription fees for many uses under n8n's licence, but you pay for infrastructure and maintenance. Check licence terms.

What database should I use for n8n?

PostgreSQL is commonly recommended for production self-hosted setups.

What happens if I lose the n8n encryption key?

Stored credentials can't be decrypted and must be re-entered. Back up the key securely.

This guide is general information, not legal, tax or financial advice, and details such as prices, features and rules can change. Product and company names mentioned are trademarks of their respective owners and are used only to identify those products; UK Technology Hub is not affiliated with or endorsed by them.

Related guides

How to automate invoice processing, step by step

How businesses automate supplier invoice handling, from capture and data extraction to approvals and accounting entries, with sensible controls against errors and fraud.

All automation & integrations guides