🇩🇪 DE 🇬🇧 EN
NexoraHost / Docs home
Popular searches:Minecraft won't startCreate Minecraft serverFiveM txAdminInstall WordPressSet up subdomainVPS GermanySSL errorOpen port 25565Discord bot hostingDNS troubleshooting

n8n – Installation and Setup

n8n is a free, open-source workflow automation tool with a visual interface. It connects apps and services with each other – similar to Zapier or Make, but on your own server. With n8n on your NexoraHost VPS or root server, you save expensive subscription fees and retain full control over your data.

Note: Detailed subpages on first workflows and complex automations can be found in the left navigation.

Why self-host n8n?

Requirements

Step 1: Install Docker

Docker is the cleanest method, as all dependencies are isolated in the container:

# Install Docker (Ubuntu/Debian)
sudo apt update
sudo apt install docker.io docker-compose -y

# Enable Docker on system startup
sudo systemctl enable --now docker

# Add current user to the Docker group (saves sudo on every command)
sudo usermod -aG docker $USER

After adding to the group, log out and log back in for the change to take effect.

Step 2: Prepare folder structure

# Main directory for n8n
mkdir -p ~/n8n && cd ~/n8n

# Subfolders for data and backups
mkdir -p {n8n_data,backup}

Step 3: Start n8n with Docker-Compose

Create the docker-compose.yml:

nano ~/n8n/docker-compose.yml

Add the following content:

version: '3.8'
services:
  n8n:
    image: n8nio/n8n:latest
    container_name: n8n
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=your-secure-password
      - NODE_ENV=production
      - N8N_HOST=n8n.your-domain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.your-domain.com
      - N8N_ENCRYPTION_KEY=your-random-generated-key
      - N8N_USER_MANAGEMENT_DISABLED=false
      - N8N_DIAGNOSTICS_ENABLED=false
      - GENERIC_TIMEZONE=Europe/Berlin
      - TZ=Europe/Berlin
    ports:
      - 5678:5678
    volumes:
      - ./n8n_data:/home/node/.n8n
    restart: unless-stopped

Important environment variables explained:

Start the container:

cd ~/n8n
docker-compose up -d

Step 4: Set up n8n in the browser

  1. Open http://your-server-ip:5678 in your browser
  2. Log in with the credentials set in docker-compose.yml (admin / your-secure-password)
  3. The setup wizard guides you through the first steps:
    • Confirm your email address (optional, but recommended for notifications)
    • Choose whether to share diagnostic data (recommended: No)

Step 5: Create your first workflow

A workflow is a chain of actions. Here's a simple example – an email notification when a webhook is called:

  1. Click New Workflow
  2. Add a Webhook Node (from the "Trigger" list)
  3. Configure the webhook:
    • HTTP Method: POST
    • Path: /my-first-webhook
    • Response Mode: Last Node
  4. Add an Email Node (from "Communication")
  5. Configure the email:
    • To: [email protected]
    • Subject: New Webhook Call!
    • Text: The webhook was called at {{ $json.timestamp }}
  6. Connect the nodes via drag-and-drop
  7. Click Execute Workflow to test
  8. After successful test: Toggle the Active switch in the top right

Step 6: Secure external access with SSL

To securely access n8n from outside and for webhooks to work, you need a reverse proxy with SSL:

# Install Nginx
sudo apt install nginx certbot python3-certbot-nginx -y

# Create Nginx configuration
sudo nano /etc/nginx/sites-available/n8n
server {
    listen 80;
    server_name n8n.your-domain.com;

    location / {
        proxy_pass http://localhost:5678;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 120s;
    }
}
# Enable the site
sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

# Get SSL certificate
sudo certbot --nginx -d n8n.your-domain.com

Step 7: Update n8n

n8n regularly receives updates with new nodes and features. Here's how to update safely:

# Create backup
cd ~/n8n
tar -czf backup/n8n_$(date +%Y%m%d_%H%M).tar.gz n8n_data

# Pull latest version and restart container
docker-compose pull
docker-compose up -d

# Clean up old Docker images
docker image prune -f

Step 8: Important settings for production

Configure email for notifications

  1. Go to Settings → Email
  2. Enter your SMTP details (e.g. from your NexoraHost webspace)
  3. Test the connection with "Send Test Email"

Backup your workflows

In addition to automatic file backups, you can also export workflows manually:

  1. Open a workflow
  2. Click the three dots in the top right → Download
  3. The JSON file contains the complete workflow and can be imported at any time

User management

If N8N_USER_MANAGEMENT_DISABLED=false is set, you can invite additional users:

  1. Go to Settings → Users
  2. Click Invite User
  3. Enter an email address and select the role (Member or Admin)
  4. The user receives an invitation email

Common problems and solutions

Webhooks not working from outside:

n8n won't start or crashes:

Workflow runs slowly:

Useful tips for getting started

Detailed guides on individual nodes, API integrations and complex automations can be found in the articles in the left navigation.

NexoraHost

Need hosting?

Game servers, VPS & webspace at Maincubes FRA01 – 1 Tbit/s DDoS, 99.9% uptime SLA.

nexorahost.com · Maincubes FRA01 · 1 Tbit/s DDoS · 99,9 % Uptime