Automates provisioning of an Ubuntu WSL distribution and deploys an n8n automation instance running in Docker.
- Windows 11 with WSL installed (
wsl --install) - PowerShell 7 or Windows PowerShell running as Administrator
- Internet access to download Ubuntu and Docker packages
- WSL version 0.67 or newer to support systemd
- Clone or download this repository.
- Open an elevated PowerShell session in the repository root.
- Run:
powershell -ExecutionPolicy Bypass -File .\build-n8nWSL.ps1
- Clone or download this repository.
- Run the helper script with root privileges:
The script installs Docker when missing (apt-based systems only), creates
sudo ./build-n8nLinux.sh
/opt/n8n_lab/n8n_data, and launches the same n8n container configuration.
The script performs these steps:
- Creates
C:\wsl\n8n_labfor artifacts and persistent data. - Detects the latest Ubuntu LTS release and downloads the matching rootfs.
- Imports a WSL distribution named
Ubuntu-n8n-server. - Enables systemd and restarts WSL so the setting takes effect.
- Installs Docker inside the distribution and launches the
n8nio/n8ncontainer bound to port5678. - Mounts persistent workflow data at
C:\wsl\n8n_lab\n8n_data(available inside WSL as/home/node/.n8n).
- Connect to the distro with
wsl -d Ubuntu-n8n-server - Verify persistence via
ls -la /mnt/c/wsl/n8n_lab/n8n_datainside WSL - Access the automation UI at http://localhost:5678/
- Register your account and request a free Community Edition license key from n8n.io
- Apply the license key and activate it
Re-run the appropriate script (build-n8nWSL.ps1 or build-n8nLinux.sh) to relaunch the container with the latest n8nio/n8n image. The bind-mounted n8n_data directory preserves workflows and credentials across upgrades.
To remove the environment:
- Stop and unregister the WSL instance:
wsl --shutdown wsl --unregister Ubuntu-n8n-server
- Optionally delete
C:\wsl\n8n_lab.
For Linux workstations, stop and remove the Docker container with docker rm -f n8n, delete the persistent directory at /opt/n8n_lab, and optionally remove Docker if it was installed exclusively for this setup.
- If the script reports
failed to bind host port 0.0.0.0:5678, stop or remove any existingn8ncontainer (including one launched by Docker Desktop) so the host port is free, then rerun the script. - When rerunning after a failed attempt, remove the existing container inside the server distro with
sudo docker rm -f n8nto avoid name conflicts.