How to Install n8n Locally and on a Server (Part 2)

Install n8n on your computer with Docker and create the owner account — full steps with real screenshots, plus how to run n8n on a server or n8n Cloud.

This is Part 2 of the AI Automation Mastery with n8n series. In Part 1 we covered what n8n is. Now it’s hands-on: install n8n on your own computer step by step, then see how to move n8n to a server so it runs around the clock.

In short

  • n8n now runs in Docker — install Docker first.
  • Then run one command: curl -fsSL https://get.n8n.io | sh
  • Open http://localhost:5678, create the owner account, and n8n is ready.
  • To keep it running 24/7, use n8n Cloud or buy a VPS and run it on your own domain with HTTPS.

3 ways to run n8n

  • On your computer (local) — free and the best place to learn and test. But when your computer is off, your workflows are off too.
  • On your own server (self-hosted VPS) — on 24/7, your own domain with HTTPS, and your data stays with you. For real business automations.
  • n8n Cloud — n8n runs it for you, no server work, but it’s a monthly plan.

This post walks through the full local setup first, then covers servers briefly.

3 ways to run n8n: your computer, your own server or n8n Cloud
3 ways to run n8n: your computer, your own server or n8n Cloud

Step 1: Install Docker

n8n now runs inside Docker (from n8n 3.0, Docker is the only way to install it). Install Docker once and keep it running in the background — you don’t need to know Docker to use it.

  • Windows / macOS: download and install Docker Desktop from docker.com, then open it.
  • Linux (Ubuntu etc.): run in a terminal:
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER   # then log out and back in

Check it worked — if both commands print a version, Docker is ready:

docker --version
docker compose version
Step 1: install Docker and check the versions
Step 1: install Docker and check the versions

On Windows: turn on WSL

n8n’s install command is a Linux shell script, so it won’t run in plain PowerShell or CMD. On Windows, run it inside WSL (Windows Subsystem for Linux):

  1. Open PowerShell with Run as administrator and run wsl --install, then restart when asked. This installs Ubuntu.
  2. Docker Desktop → Settings → General: turn on “Use the WSL 2 based engine”.
  3. Settings → Resources → WSL integration: turn on Ubuntu.
  4. Open Ubuntu from the Start menu — run all the next commands there.
On Windows, turn on WSL and install n8n from the Ubuntu terminal
On Windows, turn on WSL and install n8n from the Ubuntu terminal

Step 2: Install n8n with one command

Open a terminal (Ubuntu/WSL on Windows), go to the folder where you want n8n to live, and run:

curl -fsSL https://get.n8n.io | sh

The command does everything for you: it checks Docker, creates an n8n folder with the config files, downloads n8n and starts it. The first run can take a few minutes. At the end you’ll see n8n is running at: http://localhost:5678.

Step 2: what curl -fsSL https://get.n8n.io | sh shows
Step 2: what curl -fsSL https://get.n8n.io | sh shows

Step 3: Open localhost:5678 and create your account

Open http://localhost:5678 in your browser. The first time, you’ll see Set up owner account — enter your email, name and a password (8+ characters with at least one number and one capital letter) and click Next. The first user becomes the owner (admin) of this n8n.

Step 3: the first time you open n8n, you create the owner account
Step 3: the first time you open n8n, you create the owner account

Step 4: Your n8n is ready

After signing in you land on n8n’s Overview page. At the top are your production executions, failure rate and average run time; below, the Workflows, Credentials and Executions tabs list all your workflows, connected accounts and run history. Click Create workflow at the top right to start a new one. (On a brand-new install you may first see “Let’s build your first automation” — clicking Build a workflow there opens the same editor.)

Step 4: the Overview page — all workflows, credentials and executions in one place
Step 4: the Overview page — all workflows, credentials and executions in one place

Everyday commands

Run these from the folder where you installed n8n (the one that contains the n8n folder):

# Stop n8n
docker compose -f ./n8n/compose.yml down

# Start it again
docker compose -f ./n8n/compose.yml up -d

# Upgrade to the latest version (your data stays)
curl -fsSL https://get.n8n.io | sh -s -- --upgrade

To remove n8n together with all its data, use down -v — this deletes every workflow, so be careful.

Commands to stop, start and upgrade n8n
Commands to stop, start and upgrade n8n

Alternative: plain docker run

If you don’t want the one-line command (for example from Windows PowerShell), you can run n8n with Docker directly:

docker volume create n8n_data

docker run -it --rm 
 --name n8n 
 -p 5678:5678 
 -e GENERIC_TIMEZONE="Asia/Dhaka" 
 -e TZ="Asia/Dhaka" 
 -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true 
 -v n8n_data:/home/node/.n8n 
 n8nio/n8n

The old npx n8n way still works on n8n 2.x (it needs Node.js), but it’s going away from n8n 3.0 — use Docker for new installs.

Running n8n on a server

Local n8n is great for learning, but real automations need to run 24/7 — and webhooks from Facebook, WhatsApp or payment providers have to reach your n8n from the internet. You have two options:

Option 1: n8n Cloud (no server)

Sign up at n8n.io, pick a plan and you get a running n8n — n8n handles installs, updates and backups. The easiest choice if you don’t want to run a server.

Option 2: Buy a VPS and self-host

  1. Buy a VPS: Ubuntu 22.04 or 24.04; 2 vCPU and 4 GB RAM is plenty for normal use (light use runs on 1–2 GB). Any good provider works — for example Hostinger (has a ready n8n template, one-click install), DigitalOcean (Docker image) or Hetzner.
  2. Point a domain at it: create an A record in your DNS — n8n.yourdomain.com → your server’s IP.
  3. Run n8n on the server: SSH in, install Docker (the Linux command from step 1), then use n8n’s official Docker + Caddy setup. Caddy adds free HTTPS (SSL) automatically.
git clone https://github.com/n8n-io/n8n-docker-caddy.git
cd n8n-docker-caddy
sudo docker volume create caddy_data
sudo docker volume create n8n_data
sudo ufw allow 80
sudo ufw allow 443

Put your domain, timezone and email in the .env file:

DATA_FOLDER=/home/<your-user>/n8n-docker-caddy
DOMAIN_NAME=yourdomain.com
SUBDOMAIN=n8n
GENERIC_TIMEZONE=Asia/Dhaka
SSL_EMAIL=you@yourdomain.com

Set your domain in caddy_config/Caddyfile:

n8n.yourdomain.com {
    reverse_proxy n8n:5678 {
      flush_interval -1
    }
}

Then start it:

sudo docker compose up -d

Now open https://n8n.yourdomain.com and you’ll get the same owner-account page as locally. With a ready n8n template (like Hostinger’s), the Docker and n8n part is already done — you only set the domain and the account.

n8n on a server: domain → VPS (Caddy HTTPS + Docker + n8n)
n8n on a server: domain → VPS (Caddy HTTPS + Docker + n8n)

Running a server also means security, updates and backups are on you. If you’d rather not, use n8n Cloud — or ask Lieusoft and we’ll set it up for you.

Frequently asked questions

What do I need to install n8n?

Just Docker (Docker Desktop on Windows/macOS, Docker Engine on Linux). Then run curl -fsSL https://get.n8n.io | sh. On Windows, run it from the Ubuntu terminal in WSL.

Which port does n8n use?

Port 5678 by default — open http://localhost:5678 in your browser.

Will my workflows run when my computer is off?

No. Local n8n only runs while your computer and Docker are on. To keep it running, use n8n Cloud or self-host it on a VPS.

Can I still install n8n with npx?

It still works on n8n 2.x, but npm/npx installs are being removed from n8n 3.0. Use Docker for new installs.

How much RAM does an n8n server need?

2 vCPU and 4 GB RAM is a good default. Light workflows run on 1–2 GB; AI agents or many workflows need more.

What’s next?

n8n is up and running — in the next part we build the first workflow and learn trigger and action nodes: Part 3: Auto-reply to Gmail with AI. To revisit the basics, see Part 1: What is n8n?

Need a Website or System for Your Business?

Tell us what you need — we'll build, host and support it for you.

Book Free Consultation