Skip to content
Melinhost

Workflow automation with n8n: installing and running it safely on a VPS

Connect forms, email, spreadsheets and APIs with visual workflows: n8n with Docker Compose, webhooks and HTTPS.

Tutorials · 3 min read

n8n-automation-vps

n8n is an automation tool that lets you connect applications visually and build automatic workflows: send an email when a form is submitted, write a new order to a spreadsheet, pull data from an API and send a notification. Run on your own server, you have no cap on executions and your data stays with you.

Requirements

  • Docker and Compose (see Installing Docker).
  • A domain (for example automation.yourdomain.com) and HTTPS with Caddy. n8n’s webhooks and secure cookies need HTTPS.
  • 2 vCPU and 2–4 GB RAM are enough for most workflows.

1. The Compose file

mkdir -p ~/n8n && cd ~/n8n
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_HOST=automation.yourdomain.com
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://automation.yourdomain.com/
      - GENERIC_TIMEZONE=Europe/Istanbul
      - TZ=Europe/Istanbul
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

What matters is WEBHOOK_URL: enter your real HTTPS address so the webhook addresses n8n gives to the outside world are correct. Data is kept in the n8n_data volume, which is not deleted.

2. Start it and create the account

docker compose up -d
docker compose logs -f n8n

After pointing automation.yourdomain.com at 127.0.0.1:5678 in Caddy, open it in the browser; create the owner account on first sign-in.

3. A first workflow: form → email

  1. Create a new workflow and add the Webhook node as the trigger.
  2. Make the webhook’s production URL the submit target of the form on your website.
  3. Add a Send Email (SMTP) node, or a chat/notification node, and place the form fields with expressions.
  4. Activate the workflow; the production URL is used, not the test one.

Security

  • Keep webhook URLs secret; where possible use authentication on the webhook node (header/basic auth).
  • Store credentials (API keys, SMTP password) only in n8n’s Credentials section; don’t write them in plain text in workflows.
  • If you leave the admin interface open to the internet, use a strong password and, where possible, extra protection (VPN or IP restriction). Even safer: run it open only to you via WireGuard.
  • Updates: docker compose pull && docker compose up -d.

Backups

Workflows and credentials live in the n8n_data volume. Export them regularly:

docker compose exec n8n n8n export:workflow --all --output=/home/node/.n8n/workflows.json
docker compose exec n8n n8n export:credentials --all --output=/home/node/.n8n/credentials.json

The exported credentials file is sensitive; keep it encrypted off the server. Also take snapshots.

Start with Melinhost

n8n runs smoothly even on a small cloud server; upgrade the plan easily as your workflows and execution counts grow.

Related posts

err-ssl-version-or-cipher-mismatch

· Tutorials

ERR_SSL_VERSION_OR_CIPHER_MISMATCH: causes and fixes

The browser can’t establish a secure connection: how to find and fix old TLS versions, incompatible ciphers, a missing certificate and wrong virtual-host settings.

Read more →

Cookie preferences

We use cookies required for the site to work. Analytics and marketing cookies are enabled only with your consent. Cookie Policy