n8n is a leading visual editor for rapid iteration, letting you build automation workflows and see results right away. It’s perfect for everyday automations and complex AI agent workflows.
n8n offers over 1,367 integrations, including Google Sheets, Telegram, MySQL, Slack, Discord, and Postgres. When self-hosted, n8n runs on your own server: your workflows, credentials, and executions stay with you, and you choose the version, resources, and settings yourself.
In this guide, we’ll show you two ways to get started: the easy way, using the One-Click App to make n8n available over HTTPS in just a few clicks, and a manual installation with Docker Compose via the console. Afterward, you’ll build your first workflow and learn how webhooks and credentials work in n8n.
n8n can be used in many everyday scenarios, from automating small tasks and AI agents to CRM workflows, IT and security operations, and backend prototyping. A VPS of your own is especially worthwhile if:
- You want workflows to run around the clock. Scheduled workflows and webhooks need a server that’s always available. Your own PC can’t run continuously for this.
- External services need to send you data. Webhooks from online stores, forms, GitHub, or messaging apps need a public HTTPS address. Your VPS has one with its own domain.
- You want to connect services, such as HubSpot and Salesforce, Twilio and WhatsApp, or GitHub and Jira, without writing a separate script for each connection.
- You want to keep your data under your control. API keys, customer data, and execution logs stay on your server instead of with a cloud provider.
- You don’t want per-execution limits. The number of workflows and executions you can run depends only on your server’s resources.
A VPS is less suitable if n8n only needs to access devices or services on your home network that aren’t reachable from the internet, or if you want to run local AI models directly in n8n. A VPS doesn’t have a graphics card for that. However, AI workflows that use provider APIs such as OpenAI or Anthropic work without any issues.
The app catalog offers n8n in three variants. They differ in where n8n stores its data and what runs the workflows:
| Catalog entry | Database | Execution | Suitable for |
|---|---|---|---|
| n8n | SQLite | In the n8n container | Getting started and most personal automations |
| n8n with PostgreSQL | PostgreSQL | In the n8n container | Many workflows and executions, continuous team use |
| n8n with Postgres and Worker | PostgreSQL and Redis | In a dedicated worker container | Many simultaneous executions handled by a worker |
- n8n stores everything in an SQLite file in the data directory. This is the lightest option.
- n8n with PostgreSQL also starts a PostgreSQL database. n8n recommends PostgreSQL for production use and for multiple users.
- n8n with Postgres and Worker runs in what’s known as queue mode: the main n8n container receives webhooks and schedules and adds executions to a queue in Redis. A dedicated worker container processes them, including test runs from the editor. Queue mode only works with PostgreSQL, not SQLite.
The PostgreSQL options start additional containers and therefore require more memory. Switching to a different option later won’t transfer your data automatically. You’ll need to install the new option and transfer your workflows and credentials using export and import. So choose the right option from the start.
The fastest way to get your own n8n is through your VPS’s One-Click Apps. The app is directly accessible over HTTPS with a domain, webhook URLs already point to your domain, and all you need to do is create your account in a browser. There’s no need for Docker commands or custom proxy configuration.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Setting Up One-Click Apps for instructions.
- At least 512 MB of RAM for n8n; 1 GB is recommended. You’ll need more for numerous or data-intensive workflows and for the PostgreSQL options.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search the app catalog for n8n, choose the option you want, and click Install app.
- Use a custom subdomain or zap.cloud is already selected, with a random name. Leave this option enabled or enter a custom name: n8n uses the domain for HTTPS and your webhook URLs.
- You don’t need to enter anything under App configuration. However, change the time zone: enter your time zone in
GENERIC_TIMEZONEandTZ, for example,Europe/Berlin. The default isUTC. Scheduled workflows will then run according to UTC, which means they’ll run one or two hours later than planned in Germany. Leave the other fields at their default values. - Click Queue installation. On the first startup, n8n takes one to two minutes to be ready.
Open the app’s Access link. The first time you visit, n8n will ask you to create the owner account, which is the main account for your installation: enter an email address, first name, last name, and a password with at least 8 characters, one number, and one uppercase letter. After that, you can answer a few questions about how you plan to use n8n and request a free license key by email. It unlocks additional features, such as workflow folders and execution search.
Until the owner account has been created, anyone who knows the address can create it themselves. Set it up as soon as you install the app.
You’ll then land on the overview page, where you can build your first workflow as described below under Create Your First Workflow. Your workflows’ webhook URLs will automatically start with your domain because the app sets WEBHOOK_URL to the HTTPS address.
By default, n8n doesn’t send emails. You’ll need to share an invitation link yourself to invite new users. However, this means a forgotten password can’t be reset; n8n will simply display “n8n isn’t set up to send email right now.”
To enable email sending, open the app settings (gear icon) and add custom variables under App environment with your email provider’s SMTP details:
| Variable | Value |
|---|---|
N8N_SMTP_HOST | Your email provider’s SMTP server address |
N8N_SMTP_PORT | Port, usually 587 |
N8N_SMTP_USER | Mailbox username |
N8N_SMTP_PASS | Mailbox password |
N8N_SMTP_SENDER | Sender address, for example, n8n@your-domain.com |
N8N_SMTP_SSL | false for port 587, true for port 465 |
After you save the settings, the app restarts and applies the values.
To update n8n, open the app settings (gear icon) and go to App update. Click Check for updates, then install a new version using Apply update. Your workflows, credentials, and executions are stored in a dedicated volume and remain intact.
Before a new major version, n8n shows which of your workflows need changes under Settings > Migration Report. Check it before updating.
To back up your workflows and credentials, use n8n’s export feature as described under Back Up Data. You can also use your VPS backups in the ZapX dashboard.
The rest of this guide covers the manual installation of n8n with Docker Compose via the console, for example, if you want to integrate n8n into an existing server environment or control every step yourself.
- A Linux VPS running Debian or Ubuntu, with SSH access. See First Access via SSH.
- Docker and Docker Compose. See Install Docker. Verify the installation with
docker --versionanddocker compose version. - A domain or subdomain whose A record points to your VPS’s IP address (e.g.,
n8n.example.com). n8n only works over HTTPS, and an SSL certificate is only available for a domain, not a plain IP address.
Although n8n is lightweight, resource usage can increase with the number of workflows, API calls, and data-intensive nodes. We recommend the following VPS hardware:
| Hardware | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU core | 2 vCPU cores |
| RAM | 2 GB | 4 GB |
| Storage | 20 GB | 50 GB |
You only need SSH and the HTTP and HTTPS ports open to the internet. With ufw, it looks like this:
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Don’t open n8n’s port 5678. In the Compose file below, n8n only listens on 127.0.0.1 and is accessible exclusively through the reverse proxy. This is important because Docker exposes published ports outside of ufw. Learn more in Managing the Firewall on Linux.
Create a directory for n8n and navigate to it:
mkdir -p /opt/n8n
cd /opt/n8n
Create a file with your settings using nano .env:
# Version of n8n and task runner, current number: https://github.com/n8n-io/n8n/releases
N8N_VERSION=2.47.7
# Domain where n8n is accessible
N8N_DOMAIN=n8n.example.com
# Time zone for schedules and cron
TIMEZONE=Europe/Berlin
# Shared secret for n8n and task runner
RUNNERS_AUTH_TOKEN=CHANGE_ME
Replace CHANGE_ME with a long random string, for example, one generated with openssl rand -hex 32. Then create the Compose file with nano compose.yaml:
services:
n8n:
image: n8nio/n8n:${N8N_VERSION}
restart: unless-stopped
ports:
- "127.0.0.1:5678:5678"
environment:
- N8N_HOST=${N8N_DOMAIN}
- N8N_PROTOCOL=https
- N8N_EDITOR_BASE_URL=https://${N8N_DOMAIN}/
- N8N_WEBHOOK_URL=https://${N8N_DOMAIN}/
- N8N_PROXY_HOPS=1
- GENERIC_TIMEZONE=${TIMEZONE}
- TZ=${TIMEZONE}
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
- N8N_RUNNERS_AUTH_TOKEN=${RUNNERS_AUTH_TOKEN}
- N8N_NATIVE_PYTHON_RUNNER=true
volumes:
- n8n_data:/home/node/.n8n
task-runners:
image: n8nio/runners:${N8N_VERSION}
restart: unless-stopped
environment:
- N8N_RUNNERS_TASK_BROKER_URI=http://n8n:5679
- N8N_RUNNERS_AUTH_TOKEN=${RUNNERS_AUTH_TOKEN}
depends_on:
- n8n
volumes:
n8n_data:
Here’s what the important entries mean:
127.0.0.1:5678:5678: n8n is only accessible on the server itself, not directly from the internet.N8N_WEBHOOK_URLandN8N_EDITOR_BASE_URL: the public HTTPS address. Without them, n8n displays webhook URLs with port5678, which won’t work from the internet.N8N_PROXY_HOPS=1: n8n trusts the reverse proxy’s information about the actual address and protocol.GENERIC_TIMEZONEandTZ: the time zone for scheduled workflows.task-runners: a dedicated container runs the code in your Code nodes (JavaScript and Python) separately from n8n. This is what n8n recommends for production use. The version needs to match n8n’s, so both useN8N_VERSION.n8n_data: the volume contains the SQLite database and the key n8n uses to encrypt your credentials.
Start n8n:
docker compose up -d
Check whether everything is running with docker compose ps, and view the logs with docker compose logs -f n8n. When n8n is ready, the log displays Editor is now accessible via: followed by your domain, and the task runner reports Registered runner.
For many users or workflows running continuously, n8n recommends PostgreSQL. Add a postgres service and the variables DB_TYPE=postgresdb, DB_POSTGRESDB_HOST, DB_POSTGRESDB_DATABASE, DB_POSTGRESDB_USER, and DB_POSTGRESDB_PASSWORD to n8n. You can find a template in n8n’s withPostgres example. n8n won’t automatically migrate data from SQLite.
Make n8n available through a reverse proxy with an SSL certificate. For the basics, see Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt).
For n8n, the proxy must pass through WebSockets, or the editor will lose its connection to the server. n8n also needs forwarding headers so webhooks know the correct address. Here’s a server block for nginx:
server {
listen 80;
server_name n8n.example.com;
client_max_body_size 16m;
location / {
proxy_pass http://127.0.0.1:5678;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
client_max_body_size 16m allows requests up to n8n’s default limit for webhooks. Without this line, nginx rejects requests larger than 1 MB. Then obtain the certificate with certbot --nginx -d n8n.example.com. Certbot adds HTTPS and HTTP redirection to the block.
Caddy makes this easier: it obtains the certificate itself, automatically passes through WebSockets, and sets the forwarding headers. Just add n8n.example.com { reverse_proxy 127.0.0.1:5678 } to the Caddyfile.
Now open https://n8n.example.com in your browser. n8n will ask you to create the owner account: enter an email address, first name, last name, and a password with at least 8 characters, one number, and one uppercase letter. Create it right away, because until then, anyone who visits the address could create it.
A short survey about how you plan to use n8n will appear afterward. You can optionally request a free license key by email to unlock some additional features. Enter it in the settings under Usage and plan.
Everything that makes up your installation is stored in the n8n_data volume: the SQLite database with workflows, credentials, users, and executions, as well as the config file containing the encryption key. Without this key, backed-up credentials can no longer be decrypted.
To create a full backup, briefly stop n8n first, as an SQLite file shouldn’t be copied while it’s in use:
cd /opt/n8n
docker compose stop
docker run --rm -v n8n_n8n_data:/data -v /root/backups:/backup alpine tar czf /backup/n8n-data-$(date +%F).tar.gz -C /data .
docker compose start
Docker prefixes the volume name with the directory name, so for /opt/n8n the volume is called n8n_n8n_data. Use docker volume ls to see the exact name. Download the archives from your server regularly.
You can also export workflows and credentials as separate JSON files while n8n is running, for example, to move them to another server:
docker compose exec n8n n8n export:workflow --backup --output=/home/node/.n8n/backups/workflows/
docker compose exec n8n n8n export:credentials --backup --output=/home/node/.n8n/backups/credentials/
Credentials remain encrypted in the export. Users, executions, and settings aren’t included, so this doesn’t replace a full backup. If you’re using PostgreSQL, back up the database as well, for example, with pg_dump.
Before updating, back up your data as described above. For a new major version, read the release notes and check the Migration Report under Settings. Then enter the new version number for N8N_VERSION in .env and restart the containers:
cd /opt/n8n
docker compose pull
docker compose up -d
n8n updates the database on startup. Since n8n and the task runner use the same variable, their versions stay in sync. Switching back to the old version number won’t undo these changes. To return to the old version, restore your backup.
On the overview page, start with a blank canvas or a ready-made template from the community. Every workflow starts with a trigger, such as a schedule, a webhook, or an event in an app. Then connect the nodes that retrieve, transform, or send data to other services. Click Execute workflow to test the workflow and see each step’s data right in the editor.
Once the workflow works as expected, publish it using Publish. Only then will it respond to its trigger, even when the editor is closed. You can find past runs in the workflow’s Executions tab.
The Webhook node lets n8n receive data from other services. Each webhook has two URLs:
- The Test URL with
/webhook-test/only works while you’ve selected Listen for test event in the editor. You can see incoming data directly in the workflow. - The Production URL with
/webhook/works once the workflow is published. Enter this URL in the service that needs to call n8n.
If the URLs include port 5678, N8N_WEBHOOK_URL is missing from your manual installation. By default, a webhook accepts up to 16 MB per request.
Store logins and API keys for other services in n8n as Credentials. Add them once, then select them in any node where you need them. n8n stores them encrypted in the database. n8n generates the encryption key on first startup and saves it in the data directory, so always include that directory in your backups.
Services such as Google and Microsoft authenticate you with OAuth. n8n displays the required redirect URL in the credential. It starts with your domain if the webhook URL is set correctly.
- No access to your home network: n8n on a VPS can only reach services accessible from the internet. Devices and servers at home need a VPN or a separate access rule.
- No graphics card: AI models run slowly when hosted locally on a VPS. For AI workflows, use the providers’ APIs, which charge according to their own terms.
- Code nodes have limitations: Code in Code nodes runs in isolation in the task runner. Additional libraries aren’t available by default and must be enabled in the runner image.
You’ve set up n8n on your VPS, made it accessible over HTTPS, and learned the basics of workflows, webhooks, and credentials. Manual installation with Docker Compose gives you full control over the version, database, and proxy. For more information, visit the official n8n documentation.
Prefer not to manage Docker yourself? Take the easy route with the One-Click App, as described above under “Easy Option: n8n as a One-Click App.” HTTPS, webhook URLs, and one-click updates are already set up.
Have a specific question that isn’t answered here? For more help or support, you can reach our team every day—we’re here for you! 🙂
