๐Ÿš€ Full Setup Guide for n8n on Windows using Docker

Athuluri AkhilAthuluri Akhil
2 min read

Want to automate tasks and build workflows with n8n on your Windows machine? This guide walks you through installing and configuring n8n using Docker Desktop on Windows โ€” no domain required.


๐Ÿ“ฆ Prerequisites

  1. Install Docker Desktop for Windows
    ๐Ÿ‘‰ Download Docker Desktop

    • Enable WSL 2 during the installation.

    • Restart your system once done.

  2. Enable Docker volumes and file sharing for your drive (C:)

    • Go to Docker Desktop > Settings > Resources > File Sharing

    • Make sure C:\Users\YourUsername\ is listed.


โš™๏ธ Step-by-Step Installation


โœ… Step 1: Create Project Folder

Open PowerShell or Command Prompt and run:

mkdir C:\n8n-docker
cd C:\n8n-docker


โœ… Step 2: Create .env File

Create a file named .env inside C:\n8n-docker with the following contents:

# Timezone
GENERIC_TIMEZONE=Asia/Kolkata

# Port
N8N_PORT=5678

# Authentication
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=yourStrongPassword123

# Host and webhook
N8N_HOST=localhost
WEBHOOK_URL=http://localhost:5678/

# Encryption key
N8N_ENCRYPTION_KEY=a_secure_random_string

# Database
DB_TYPE=sqlite

โœ… Step 3: Create docker-compose.yml

Create a file named docker-compose.yml in the same folder with the following content:

version: "3.8"

services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "${N8N_PORT}:5678"
    environment:
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE}
      - N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER}
      - N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD}
      - WEBHOOK_URL=${WEBHOOK_URL}
      - N8N_HOST=${N8N_HOST}
      - N8N_PORT=${N8N_PORT}
      - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
      - DB_TYPE=${DB_TYPE}
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

โœ… Step 4: Start n8n with Docker

From inside the C:\n8n-docker folder, run:

docker-compose up -d

โœ… Step 5: Access the n8n App

Open your browser and visit:

http://localhost:5678

Youโ€™ll see the login screen. Use the credentials from your .env file:

  • Username: admin

  • Password: yourStrongPassword123


๐Ÿ” Restart or Stop

  • Restart:

      docker-compose restart
    
  • Stop:

      docker-compose down
    

๐Ÿง  Optional: Enable Webhook Access from Other Devices

Want to access your n8n instance from another device on your network?

  1. Run ipconfig in PowerShell and note your IPv4 Address, e.g., 192.168.1.42

  2. Update your .env file:

N8N_HOST=192.168.1.42
WEBHOOK_URL=http://192.168.1.42:5678/
  1. Restart Docker:
docker-compose down
docker-compose up -d

You can now access n8n from any device on the same network using the new IP.


โœ… Done!

You now have a fully working n8n automation server running on Windows using Docker, without needing a domain. Happy automating! ๐Ÿค–โœจ

0
Subscribe to my newsletter

Read articles from Athuluri Akhil directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Athuluri Akhil
Athuluri Akhil