50% off your first hosting order, applied in your cart, on our upgraded infrastructure! Ends in: View Plans →
Türkiye · France · Northern Cyprus05372609483
Cloud VDS

Installing n8n on a VDS: Your Own Automation Server with Docker Compose

  • 22 November 2026
  • 4 min read
Contents
    Share this post

    n8n is a source-available automation tool for building workflows between applications: writing a website form submission to your CRM, sending a Slack or Telegram notification on a new order, emailing a report every morning, all connected in a visual editor without writing code. The cloud version is billed by usage; when you install it on your own server there is no limit on workflows or executions, and your data stays with you. This guide installs n8n on a VDS with Docker Compose, publishes it over HTTPS and keeps it secure.

    Which VDS is enough?

    n8n is a light application. For a few dozen workflows, 2 vCPU, 2 GB RAM and 35 GB of disk run comfortably; the Türkiye VDS 2 plan matches these figures. Move to 4 GB RAM for setups that process large files, send many requests to AI models or run hundreds of workflows. For workflows triggered from outside by webhooks, a server close to your users and the services you connect to lowers latency; see the VDS rental guide for choosing a location.

    1. Prepare the server and the domain

    • On a VDS running Ubuntu 24.04, install Docker and Docker Compose from the official repository. The steps are in the Docker on a VDS guide.
    • Choose a subdomain for n8n (for example n8n.yourcompany.com) and point its A record to your VDS IP address.
    • In the firewall, open only ports 22 (SSH), 80 and 443.

    2. Create the Compose file

    Create a file named compose.yaml in /opt/n8n:

    services:
      caddy:
        image: caddy:2
        restart: unless-stopped
        ports: ["80:80", "443:443"]
        volumes:
          - ./Caddyfile:/etc/caddy/Caddyfile
          - caddy_data:/data
      n8n:
        image: docker.n8n.io/n8nio/n8n
        restart: unless-stopped
        environment:
          - N8N_HOST=n8n.yourcompany.com
          - N8N_PROTOCOL=https
          - WEBHOOK_URL=https://n8n.yourcompany.com/
          - GENERIC_TIMEZONE=Europe/Istanbul
          - TZ=Europe/Istanbul
        volumes:
          - n8n_data:/home/node/.n8n
    volumes:
      caddy_data:
      n8n_data:

    The Caddyfile in the same folder has two lines:

    n8n.yourcompany.com {
      reverse_proxy n8n:5678
    }

    n8n's port 5678 is not exposed; all traffic comes through Caddy, which obtains and renews the Let's Encrypt certificate itself. Set the time zone to your own.

    3. Start it and create the owner account

    cd /opt/n8n
    docker compose up -d
    docker compose logs -f n8n

    When the log shows that n8n is ready, open https://n8n.yourcompany.com. The first screen creates the owner account. Do this right after installation: until the owner account exists, anyone who knows the address can reach that screen.

    4. Security

    • Two-factor authentication: turn it on for the owner account in the user settings.
    • Credentials: n8n stores the API keys and passwords of connected services encrypted. The encryption key lives in the n8n_data volume; if that volume is lost, the stored credentials cannot be read either.
    • Docker and UFW: if you later add a service to the Compose file and publish it with ports:, Docker opens that port to the internet, bypassing UFW rules. Details are in the "UFW trap" section of the Docker guide.
    • Webhook URLs: webhook URLs are public; validate incoming data in the triggered workflow or use header-based authentication.

    5. Updates and backups

    To update:

    docker compose pull
    docker compose up -d

    Read n8n's release notes before major version upgrades. You can export workflows from the interface, but what really needs backing up is the n8n_data volume: workflows, execution history, credentials and the encryption key are all there. Copy the volume off the server regularly; we explain why a snapshot alone is not enough in the 3-2-1 backup rule article.

    A note on the licence

    n8n is distributed under a "fair-code" licence: you can install and use it for free for your own business, but selling n8n to others as a hosted service is subject to the licence. If you plan commercial use, read the current licence text.

    Ideas for a first workflow

    • Website contact form, by webhook to n8n, then to email and a Google Sheets row
    • New WooCommerce order, Telegram notification
    • A server status or sales summary email every morning
    • Classifying support emails with an AI model and routing them to the right person

    If you need a server for n8n, see our Türkiye VDS plans; traffic is unlimited and you can reinstall the operating system from the FiberVM panel at any time.

    Comments0

    No Comments Yet

    Be the first to share your thoughts.

    Join the Discussion

    Please sign in or sign up to leave a comment.

    Never Miss a Post

    Get our latest tutorials, guides and product news in your inbox.

    You're subscribed to our newsletter.