How to Install Ubuntu Server on a Windows 11 VM for n8n (Step-by-Step Hyper-V & SSH Guide)

October 19, 2026 | Umair Alam | 9 min read

If you want to run your business automations on n8n without paying $20 to $50 every month for cloud subscription tiers, self-hosting is the obvious choice. However, running n8n directly on Windows using WSL2 or Docker Desktop often leads to frustrating memory ballooning, unexpected background shutdowns, and sleep-mode disconnects. The most stable, production-grade way to run a free 24/7 local n8n automation server is inside a dedicated Ubuntu Server virtual machine on Windows 11 Hyper-V.

In this complete step-by-step tutorial, you will learn how to download Ubuntu Server LTS, mount the ISO onto a Windows 11 Hyper-V virtual machine, configure optimal boot and network settings, navigate the installer, bypass the infamous “An error occurred during installation” archive mirror crash, and connect to your headless server directly from Windows 11 PowerShell via SSH.

Hosting Environment Stability (24/7) RAM Footprint Background Isolation Cost
n8n Cloud High Managed Isolated Cloud $240–$600 / year
Windows WSL2 Moderate Heavy (RAM Ballooning) Shared with Windows Free
Docker Desktop on Windows Moderate Heavy (High CPU/RAM) Shared with Windows Free / License Limit
Ubuntu Server on Hyper-V Extremely High Ultra Lightweight (<1GB) 100% Dedicated VM 100% Free Forever

Why Ubuntu Server Is the Best Foundation for n8n

When setting up a local automation pipeline, choosing the right operating system matters. Here is why Ubuntu Server outclasses standard desktop Linux and Windows environments for running automation workflows:

  • No GUI Overhead: Desktop operating systems waste 2GB to 4GB of RAM rendering taskbars, window effects, and desktop animations. Ubuntu Server runs completely headless (command-line only), consuming less than 500MB of RAM at idle. This leaves virtually all your system memory available for n8n workflows, databases, and heavy AI model executions.
  • Rock-Solid 24/7 Uptime: Unlike Windows desktop which often restarts automatically for weekly updates, an isolated Hyper-V VM runs continuously in the background as a true local server.
  • Native Docker Performance: Docker containers run natively on the Linux kernel without the translation layers, filesystem lag, or memory throttling common with Docker Desktop on Windows.
  • Headless Remote Control: Once installed, you never need to open the Hyper-V graphical console again. You can control, update, and deploy workflows directly through native Windows 11 PowerShell using SSH.

Note: If you have not created your Hyper-V Virtual Machine shell yet, make sure you have Hyper-V enabled on Windows 11 Pro/Enterprise. We will use a Generation 2 VM with at least 2 vCPUs, 4GB of RAM, and 30GB of virtual disk space.


Prerequisites Before You Begin

Ensure you have the following ready before starting the installation:

  1. Windows 11 with Hyper-V Enabled: Hyper-V Manager accessible via the Windows Start Menu.
  2. An Existing Generation 2 Virtual Machine: Created in Hyper-V with a Virtual Hard Disk attached.
  3. Ubuntu Server LTS ISO: Download the latest stable Long Term Support ISO (such as Ubuntu Server 24.04 LTS or 22.04 LTS) from the official Ubuntu Server Download page.
  4. Internet Access: A Hyper-V Virtual Switch connected to your active Wi-Fi or Ethernet adapter so the VM can pull packages.

Step 1: Mount the Ubuntu Server ISO in Hyper-V

Before turning on your virtual machine, attach the downloaded Ubuntu Server ISO file to your VM’s virtual optical drive:

  1. Open Hyper-V Manager on your Windows 11 PC.
  2. Right-click your virtual machine and select Settings….
  3. Under the Hardware tree on the left, locate the SCSI Controller.
  4. Select DVD Drive and click Add.
  5. Choose Image file, click Browse…, and select your downloaded ubuntu-server-lts.iso file.
  6. Click Apply.

Step 2: Configure Firmware Boot Order & Secure Boot

Hyper-V Generation 2 VMs use UEFI firmware. To ensure the VM boots from your ISO instead of trying to boot an empty virtual hard drive, adjust the firmware priority:

  1. In the VM Settings window, click Firmware under the Hardware menu.
  2. Select DVD Drive in the Boot Order list and click Move Up until it is at the very top.
  3. Next, click Security in the left pane.
  4. Ensure Enable Secure Boot is checked, but change the Template dropdown from “Microsoft Windows” to “Microsoft UEFI Certificate Authority”. This allows modern Linux kernels to boot cleanly under UEFI Secure Boot.
  5. An alternative to step 4 is to disable secure boot by unchecking the Enable Secure Boot checkbox.
  6. Click OK to save your settings.

Step 3: Boot and Launch the Ubuntu Subiquity Installer

  1. Back in Hyper-V Manager, right-click your VM and select Connect… to open the Virtual Machine Connection window.
  2. Click the green Start button.
  3. When the GRUB menu appears, select “Try or Install Ubuntu Server” and press Enter.
  4. Language Selection: Choose your preferred language (default is English) and press Enter.
  5. Installer Update: If prompted to update to the new installer version, select “Update to the new installer” or “Continue without updating” (either works smoothly).
  6. Keyboard Configuration: Verify your keyboard layout (English US) and select Done.
  7. Installation Type: Choose Ubuntu Server (the default base installation). Do not select the minimized version if you want standard networking and administration utilities pre-configured.

Step 4: Network Configuration & Proxy

  1. Network Connections: The installer will detect your virtual network adapter (typically eth0). It will attempt to request an IP address from your local router or Hyper-V Default Switch via DHCP. Once an IPv4 address is assigned, note down the IPv4 address because you will need it to connect remotely to the VM later, then select Done and press Enter.
  2. Configure Proxy: Unless your corporate network requires an upstream HTTP proxy to reach the web, leave this field completely blank and select Done.

Step 5: The Critical Fix for the “An Error Occurred During Installation” Crash

During the Ubuntu Archive Mirror Configuration stage, many users experience a fatal installation failure where the subiquity installer crashes with the message: “An error occurred during installation”.

Why Does This Happen?

By default, Ubuntu attempts to auto-detect a regional geolocated mirror (e.g., pk.archive.ubuntu.com or local ISP mirrors). If that regional mirror is under maintenance, throttling connections, or slow to respond to the installer’s ping, the installer times out, curtin fails, and the entire setup halts.

How to Fix It:

  1. When you arrive at the Ubuntu Archive Mirror Configuration screen, do not blindly accept the default geo-mirror.
  2. Delete the auto-filled address and enter the canonical official Ubuntu primary archive mirror:
    http://archive.ubuntu.com/ubuntu

  3. Or choose a verified official mirror from Launchpad Ubuntu Archive Mirrors.
  4. Select Done. The installer will test the mirror connection, verify repository package availability, and proceed smoothly without crashing!

Step 6: Storage Partitioning & Profile Setup

  1. Guided Storage Configuration: Choose “Use an entire disk”. Check the box to “Set up this disk as an LVM group” (Logical Volume Manager). LVM allows you to easily expand your virtual disk size in the future without reinstalling. Select Done, then confirm the destructive action by selecting Continue.
  2. Profile Setup:
    • Your Name: Enter your full name.
    • Your Server’s Name: Enter a recognizable hostname (e.g., n8n-server or ubuntu-vm).
    • Pick a Username: Choose your administrative username (e.g., umair or admin). Avoid using generic root.
    • Choose a Password: Create a strong password and confirm it.
  3. Select Done.

Step 7: Enable OpenSSH Server (Crucial Step!)

This is one of the most important screens during installation. Enabling SSH allows you to interact with your server completely from Windows 11 PowerShell without opening the clumsy Hyper-V GUI console:

  1. On the SSH Setup screen, press the spacebar to check “Install OpenSSH server”.
  2. Leave “Import SSH identity” unchecked for now (you can add SSH keys later).
  3. Select Done.
  4. On the Featured Server Snaps screen, do not select any snaps. We will install Docker natively via official repositories rather than snap packages for better performance and daemon control. Select Done.

The installer will now partition the drive, unpack the Linux kernel, install the base system, and apply security updates. Once finished, select Reboot Now and press Enter.


Step 8: First Login and Finding Your Server IP

  1. Once rebooted, the VM will display the Ubuntu login prompt:
    n8n-server login:
  2. Type your username and password to log in.
  3. Find your VM’s local IP address by running:
    ip a

    (Or run: hostname -I)

  4. Look for your primary interface (e.g., eth0) and note the IPv4 address (e.g., 192.168.1.150 or 172.x.x.x).

Step 9: Connect via Windows 11 PowerShell (Headless Remote Management)

Now you can minimize Hyper-V Manager completely! Open PowerShell or Windows Terminal on your Windows 11 host and run:

ssh username@YOUR_VM_IP

For example, if your username is umair and your VM IP is 192.168.1.150:

ssh umair@192.168.1.150
  1. The first time you connect, type yes to verify the host authenticity fingerprint.
  2. Enter your VM password.
  3. You are now logged directly into your Ubuntu Server terminal right from Windows PowerShell with full copy-paste, clipboard support, and clean terminal rendering!

Step 10: Preparing the VM for n8n (Fast Docker Setup)

To prepare your new virtual server for running n8n, run these quick commands in your SSH terminal to update packages and install Docker with Docker Compose:

# Update system repositories
sudo apt update && sudo apt upgrade -y

# Install Docker engine and Compose plugin
sudo apt install -y docker.io docker-compose-v2
OR
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Enable and start Docker service
sudo systemctl enable --now docker

# Add your user to the docker group (avoids needing sudo for docker commands)
sudo usermod -aG docker $USER

Log out of SSH and log back in for the group permissions to take effect:

exit
ssh umair@YOUR_VM_IP
docker --version

Your Ubuntu Server is now fully optimized, secured, and ready to host self-hosted n8n workflows with zero licensing costs!


Troubleshooting Common Hyper-V & Ubuntu Issues

1. VM Cannot Access the Internet

If your VM fails to get an IP address or cannot resolve domain names during installation, open Hyper-V Manager > Virtual Switch Manager. Ensure your VM is attached to an External Virtual Switch bound to your physical network adapter, rather than an isolated Internal switch.

2. Dynamic Memory Ballooning

By default, Hyper-V enables Dynamic Memory, which can occasionally cause Linux kernels to stutter under sudden load spikes. For an automation server running n8n, navigate to VM Settings > Memory, uncheck Enable Dynamic Memory, and assign a static 4096 MB (4GB) of dedicated RAM.

3. IP Address Changes on Every Reboot

Because Hyper-V uses DHCP, your VM’s IP address might change after your router restarts. You can assign a static IP inside Ubuntu by editing the Netplan configuration (sudo nano /etc/netplan/50-cloud-init.yaml), or set up a DHCP reservation for your VM’s MAC address in your router admin panel.


Where to Go From Here

With Ubuntu Server running quietly in the background on your Windows 11 machine, you now possess an enterprise-grade automation lab capable of processing thousands of tasks without monthly SaaS fees.

Umair Alam

Written by

Umair Alam

Business Automation Specialist & Technical Developer with 17+ years of experience in enterprise IT, database development, and modern web technologies. I specialize in bridging the gap between complex organizational workflows and automated digital systems.