Summary

In this guide, we'll walk you through the process of setting up the new N8N AI Starter Kit on your local Windows system. You'll learn how to install Windows Subsystem for Linux (WSL), Docker Desktop, and Visual Studio Code. By the end, you'll have N8N running locally, ready to deploy AI models and leverage your GPU for accelerated processing. This setup is perfect for beginners and experienced developers alike who want to experiment with self-hosted AI models and create custom AI workflows.

Introduction

N8N is a powerful workflow automation tool, and with the new AI Starter Kit, you can now integrate local AI models into your workflows. This tutorial will guide you through each step of the setup process, allowing you to run N8N on your Windows machine using WSL, Docker, and Visual Studio Code.

What You'll Learn

  1. Installing Windows Subsystem for Linux (WSL)
  2. Setting up Docker Desktop
  3. Configuring Visual Studio Code
  4. Cloning and deploying the N8N AI Starter Template

Why This Setup?

This setup offers several advantages:

  • Run local AI models directly in N8N
  • Utilise your system's hardware (like GPU) for enhanced performance
  • Develop and test custom AI workflows in an isolated local environment
  • Experiment with self-hosted AI models without relying on cloud services

Prerequisites

  • A Windows 10 or 11 computer
  • Administrator access to your system
  • An internet connection

Step-by-Step Guide

Watch the video guide on YouTube:


1. Installing Windows Subsystem for Linux (WSL)

WSL allows you to run a Linux environment directly on Windows.

  1. Press the Windows key, type "terminal", and open the Command Prompt or PowerShell.
  2. Follow any prompts that appear and restart your computer when asked.
  3. After restarting, WSL will finish the Ubuntu installation. You'll be prompted to create a username and password for your Ubuntu system.

Run the following command to install WSL and Ubuntu 24.04:

wsl --install -d Ubuntu-24.04

2. Installing and Configuring Docker Desktop

Docker Desktop allows you to run containerised applications like N8N.

  1. Visit docker.com and download Docker Desktop for Windows.
  2. Run the installer. Ensure "Use WSL 2 instead of Hyper-V" is selected during installation.
  3. Restart your computer after the installation completes.
  4. Open Docker Desktop and accept the service agreement.
  5. Configure Docker to work with WSL:
    • Click the gear icon to open Settings
    • Go to Resources > WSL Integration
    • Toggle on Ubuntu-24.04
    • Click "Apply & Restart"

To verify the installation:

  1. Open a new terminal (Windows key + type "terminal")

Run these commands:

docker
docker compose

If these commands display a list of options, Docker is successfully installed and connected to WSL.

3. Setting Up Visual Studio Code

Visual Studio Code (VS Code) is a powerful code editor that integrates well with WSL and Docker.

  1. Download VS Code from code.visualstudio.com
  2. Run the installer and follow the prompts to complete the installation.
  3. Open VS Code and navigate to the Extensions tab (icon on the left sidebar that looks like four squares).
  4. Search for and install these extensions:
    • Remote Development
    • Docker
  5. After installation, click on the Remote Explorer icon in the left sidebar (it looks like a computer monitor).
  6. In the dropdown at the top of the Remote Explorer pane, select "WSL Targets".
  7. You should see your Ubuntu system listed. Click on it to open a new VS Code window connected to WSL.

4. Cloning and Deploying the N8N AI Starter Template

In this section, we’ll clone the N8N template and deploy it using Docker Compose.

Steps

  1. Open VS Code (connected to WSL):
    • In the left sidebar, click on the Explorer icon (top icon).
  2. Open Folder:
    • Click "Open Folder" and navigate to the home directory (/home/yourusername).
    • Create a new folder named www and open it.
  3. Open a New Terminal:
    • In VS Code, go to, right-click the new folder and select open in integrated terminal

Clone the N8N AI Starter Template:

git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git

Navigate into the Cloned Repository:

cd self-hosted-ai-starter-kit

Review the docker-compose.yml File:

    • Before deploying, take a moment to review the docker-compose.yml file. This file defines the services that will be run.
    • Open it in VS Code to check the configuration.

Deploy N8N using Docker Compose:

docker compose up -d
  1. Verify the Deployment:
    • Open Docker Desktop.
    • Go to the Containers section.
    • You should see a stack running for N8N with multiple containers.

5. Accessing N8N

After successful deployment, you can access the N8N interface:

  1. Open your web browser
  2. Navigate to http://localhost:5678

You're now ready to start experimenting with N8N and building automations!

Troubleshooting

  • If you encounter any issues with WSL, try running wsl --update in a terminal to ensure you have the latest version.
  • If Docker isn't connecting to WSL, try restarting Docker Desktop and your computer.
  • If N8N doesn't start, check the Docker Desktop logs for the N8N container to identify any potential issues.
  • If a container stops unexpectedly, you can try restarting it from Docker Desktop or by running docker compose up -d again in the project directory.

Conclusion

Congratulations! You've successfully set up the N8N AI Starter Kit on your local Windows system. This powerful setup allows you to:

  • Experiment with local AI models directly within N8N workflows
  • Develop and test AI-powered automations in a secure, isolated environment
  • Leverage your system's full capabilities, including GPU acceleration if available

Next steps could include exploring N8N's workflow capabilities, integrating AI models into your workflows, or diving deeper into Docker and WSL for more advanced configurations.

Additional Resources

n8n.io - a powerful workflow automation tool
n8n is a free and source-available workflow automation tool

Remember, this setup is just the beginning. N8N offers a world of possibilities for workflow automation and AI integration. Don't hesitate to explore, experiment, and create amazing automations!