IntegrationsAdvanced★ 4.9 (34 reviews)
n8n Self-Hosted Automation Setup Guide
Complete guide to setting up n8n, the open-source automation platform, on your own server.
By WorkFreeWork Team•412 downloads•Added 12/20/2024
Overview
Take control of your automation with n8n, a powerful open-source alternative to Zapier and Make.com. This guide walks you through setting up n8n on your own server, creating workflows, and integrating with 300+ apps.
Own your data, avoid subscription fees, and build unlimited workflows with this self-hosted solution.
Get This Resource
Tags
#n8n#self-hosted#open-source#automation#docker
Prerequisites
- VPS or dedicated server (2GB RAM minimum)
- Domain name with DNS access
- Basic Linux command line knowledge
- Docker and Docker Compose installed
Dependencies
docker@^24.0.0docker-compose@^2.20.0nginx (for reverse proxy)certbot (for SSL certificates)Installation
- SSH into your server
- Clone the setup repository: git clone https://github.com/workfreework/n8n-setup-scripts
- Navigate to directory: cd n8n-setup-scripts
- Copy environment file: cp .env.example .env
- Edit .env with your domain and credentials
- Run setup script: ./setup.sh
- Configure DNS A record to point to your server IP
- Access n8n at https://your-domain.com
- Complete initial setup wizard
Usage Examples
Docker Compose Configuration
yaml
version: '3.8'
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=${N8N_USER}
- N8N_BASIC_AUTH_PASSWORD=${N8N_PASSWORD}
- N8N_HOST=${N8N_HOST}
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${N8N_HOST}/
- GENERIC_TIMEZONE=America/New_York
volumes:
- n8n_data:/home/node/.n8n
- ./workflows:/workflows
volumes:
n8n_data:Example Workflow: Email to Slack
json
// This is a simplified representation of an n8n workflow
{
"nodes": [
{
"name": "Email Trigger",
"type": "n8n-nodes-base.emailReadImap",
"parameters": {
"mailbox": "INBOX",
"options": {
"filter": {
"from": "important@example.com"
}
}
}
},
{
"name": "Extract Data",
"type": "n8n-nodes-base.function",
"parameters": {
"functionCode": "return items.map(item => ({
subject: item.json.subject,
from: item.json.from,
body: item.json.textPlain
}));"
}
},
{
"name": "Send to Slack",
"type": "n8n-nodes-base.slack",
"parameters": {
"channel": "#alerts",
"text": "New important email: {{$json.subject}}"
}
}
]
}Ready to Automate Everything?
Join our community and get access to premium resources, coaching, and support.
Become a Member