← Blog

Self-hosted n8n: automations on your own VPS with HTTPS

Tutorial · · 6 min read

n8n is a tool for automating tasks between apps with a visual editor: when a form comes in, create a card; when a payment fails, ping Telegram; every Monday, build a report. It's the Zapier or Make alternative you can host on your own server.

Hosting it yourself has two clear advantages. First, you don't pay per execution: your workflows can run every minute without the bill going up. Second, the credentials for your services (API keys, tokens, passwords) stay encrypted on your server. n8n's Community edition is free for internal use under its license, the Sustainable Use License.


What you need

  1. A VPS with Docker and at least 1 GB of RAM. Plenty for simple workflows; if you'll process large files, go for 2 GB.
  2. The server connected to SecuryBlack with CromoForge, the agent that deploys your apps.
  3. A subdomain, for example n8n.yourdomain.com.
  4. Ports 80 and 443 free for the HTTPS proxy.

Step 1: point the subdomain at the server

Create an A record named n8n with your VPS's public IP (and AAAA if you have IPv6). It must resolve before you create the app, because the certificate is requested on startup:

dig +short n8n.yourdomain.com

Step 2: create the app from the template

In the panel, go to Apps → New app → Template, choose n8n and fill in name, server and domain. If you're signed in, this link opens the panel with the n8n template selected.


Step 3: what the template configures for you

Installing n8n with Docker is easy; getting it right behind a proxy is where people get stuck. The template takes care of:

  • The encryption key. n8n encrypts the credentials you save with N8N_ENCRYPTION_KEY. If that key is lost or changes, your saved credentials stop working. The template generates it when the app is created and stores it encrypted as an environment variable, so it's the same on every deployment.
  • The webhook URL. With WEBHOOK_URL pointing at https://n8n.yourdomain.com/, Webhook nodes show the correct public URL instead of a localhost:5678 that doesn't work outside the server.
  • The proxy. n8n knows it sits behind an HTTPS proxy (N8N_PROXY_HOPS=1), so session cookies and redirects work properly.
  • The data in a volume. n8n's SQLite database, with your workflows, executions and credentials, lives in a Docker volume that survives every deployment.
  • Automatic HTTPS with a Caddy proxy that requests and renews the certificate. n8n only listens on 127.0.0.1.

Step 4: create the owner account right away

Open https://n8n.yourdomain.com. The first screen asks you to create an account: the first one created becomes the instance owner. Do it as soon as the deployment finishes; until it exists, anyone who reaches the URL could claim it.


Step 5: your first workflow

Click Create workflow and try something simple:

  1. A Schedule Trigger node that runs every day at 9:00.
  2. An HTTP Request node that calls an API.
  3. A Telegram, Slack or Email node that sends you the result.

Turn the workflow on with the toggle at the top and it runs on your server by itself. If you use a Webhook node, copy its Production URL: it already has your domain with HTTPS, ready to paste into GitHub, Stripe or your form.


Updating and maintaining n8n

  • Update: click Deploy on the app. It pulls the latest stable n8n release and migrates its database on startup. Your workflows and credentials stay in the volume. Before updating, check the release notes for breaking changes.
  • Watch it: add an uptime monitor on https://n8n.yourdomain.com/healthz. If n8n goes down, your automations stop silently. For your most important scheduled workflows, a heartbeat at the end of the workflow alerts you if one day it doesn't run.
  • Delete it: from Settings → Danger zone. Deleting the app also deletes its volume, with all your workflows and credentials.

Conclusion

n8n on your own VPS gives you automations with no execution limits and your credentials at home. The delicate parts, the encryption key, the webhook URL and HTTPS, come configured by the template. Create your SecuryBlack account and you'll have n8n on your server in minutes.

Blog

Find out what's wrong with your server

Connect your first VPS and get the security audit. Free during the beta.