Skip to main content

Command Palette

Search for a command to run...

๐Ÿš€ Deploy N8N with Docker Compose ๐Ÿš€

Published
โ€ข3 min read
๐Ÿš€ Deploy N8N with Docker Compose ๐Ÿš€
I

Hello! I'm a DevOps Engineer dedicated to continuous learning and contributing to the tech community. If you find value in what I share, feel free to spread the word to others who might benefit as well. Your support is greatly appreciated!

๐Ÿš€ AI Automation Tool | How To Host n8n For Free FOREVER ๐Ÿš€

๐Ÿค– What is n8n?

n8n (pronounced "n-eight-n") is a powerful, free and open-source workflow automation tool that helps you connect different apps and services together. Think of it as a self-hosted alternative to tools like Zapier or Make (formerly Integgy), but with:

  • โœ… No monthly fees - Host it yourself for free forever

  • โœ… Unlimited workflows - Create as many automations as you need

  • โœ… 300+ integrations - Connect to almost any service

  • โœ… Full control - Your data stays on your server

  • โœ… Visual workflow builder - Easy drag-and-drop interface


๐ŸŽฌ Video Demonstration

Watch on Youtube

๐Ÿ“‹ Prerequisites & Infrastructure Checklist

Before you begin, make sure you have the following installed on your system:

RequirementVersionCheck Command
๐Ÿณ Docker20.10+docker --version
๐Ÿ”ง Docker Compose2.0+docker-compose --version
๐Ÿ’ป Operating SystemLinux/macOS/Windows-

๐Ÿš€ Quick Start Guide

Deploy n8n in simple steps:

๐Ÿ“‚ Clone & Configure Repository

git clone https://github.com/meibraransari/N8N-Deploy-Using-Docker-Compose.git
cd N8N-Deploy-Using-Docker-Compose
cp -a env.sample .env && nano .env # Update the environment variables
docker compose up -d
docker compose logs -f
# Fix permission
Error: EACCES: permission denied, open '/home/node/.n8n/config'
docker compose down
# set permissions to path in env file like "DOCKER_VOLUME_STORAGE=/mnt/docker-volumes"
chmod -R 777 /mnt/docker-volumes/n8n/
docker compose up -d
docker compose logs -f

๐ŸŒ Network: DNS & SSL Configuration

๐Ÿ”— Local Network Access

http://192.168.1.100:5678

๐Ÿ“ก Technitium DNS Configuration

https://dns.devopsinaction.lab/
Point domain to IP address
192.168.1.222 n8n.devopsinaction.lab

๐Ÿ›ก๏ธ Nginx Proxy Manager Setup

https://npm.devopsinaction.lab/
Domain Names n8n.devopsinaction.lab
Forward Hostname/IP: 192.168.1.100
Forward Port: 5678
SSL Certificate: 
Force SSL: True

โš™๏ธ Manual Nginx Configuration (Optional) if you have your own nginx server.

server {
    listen 80;
    server_name n8n.devopsinaction.lab;
    return 301 https://$host$request_uri;
    if ($host = n8n.devopsinaction.lab) {
        return 301 https://$host$request_uri;
    } 
}
# HTTPS reverse proxy (Dont forget to add ssl file | letsencrypt | certbot)
server {
    listen 443 ssl;
    server_name n8n.devopsinaction.lab;
    ssl_certificate /etc/letsencrypt/live/n8n.devopsinaction.lab/fullchain.pem; 
    ssl_certificate_key /etc/letsencrypt/live/n8n.devopsinaction.lab/privkey.pem; 
    # Optional: secure SSL headers
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    # Global proxy timeouts (10 minutes)
    proxy_connect_timeout 600s;
    proxy_send_timeout    600s;
    proxy_read_timeout    600s;
    send_timeout          600s;
    location / {
        proxy_pass http://127.0.0.1:5678;
        proxy_http_version 1.1;
        proxy_hide_header X-Powered-By;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
    }
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
}

๐Ÿ”“ Accessing your n8n Instance

https://n8n.devopsinaction.lab/

Fill form to create account

Email *
First Name *
Last Name *
Password *

๐Ÿ’ก Implementation Blueprints

  • Very quick quickstart

  • First AI agent

๐Ÿ“š Resources & Documentation

๐Ÿ“– Official n8n Documentation

๐Ÿ—‚๏ธ Community Workflow Repositories

More from this blog

DevOps In Action

30 posts