# n8n Installation Tutorial: Docker & npm Methods Explained

This tutorial covers two ways to run n8n locally: Docker and Node.js (npm). I’ll show the installation commands and how to open the workflow editor.

Author: Vladislav Guzey
Published: 2025-07-22
Canonical: https://proflead.dev/posts/local-n8n-setup-with-npm-and-docker/


<div class="videoWrapper">
  <iframe width="100%" src="https://www.youtube.com/embed/nAIU7_Hwy6M?si=jznEwRij-ZkICaI5" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>

This tutorial covers two ways to run n8n locally: Docker and Node.js (npm). I’ll show the installation commands and how to open the workflow editor.

![n8n Local Install Tutorial (CLI + Docker)](https://miro.medium.com/v2/resize:fit:700/0*JkhVBzQ-_ulPtF6M.png)



## How to Set Up n8n Locally

There are two main ways to install and run n8n locally: using Docker or using Node.js with npm.

After installation, follow the [first n8n workflow tutorial](/posts/learn-n8n-in-10-minutes/) to start connecting apps in the editor.

### Method 1: Installing n8n with Docker

This method utilizes Docker to run n8n in an isolated environment known as a container. It is often the recommended approach, as it bundles all dependencies together.

First, visit [https://www.docker.com/products/docker-desktop/](https://www.docker.com/products/docker-desktop/), download Docker Desktop for Mac, Windows, or Linux, and install it on your computer.

![Docker Website](https://miro.medium.com/v2/resize:fit:700/0*0W_vCspk3YXeCu7A.png)



Then open Docker Desktop or your terminal window and create a dedicated volume for n8n. This ensures that your workflow data is saved persistently, even if you stop or remove the n8n container. Open your terminal (or Command Prompt/PowerShell on Windows) and run the following command:

```bash
docker volume create n8n_data
```

**Note for Linux Users:** If you receive a “permission denied” error, you may need to run the command with administrator privileges by adding **sudo** at the beginning: **_sudo docker volume create n8n_data_**_._

Next, run the command that will download the official n8n image and start the container. This command maps your local port 5678 to the container’s port and links the volume you just created.

```bash
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n
```

**Note for Linux Users:** As before, if you encounter a permission error, prepend the command with sudo.

Once the command finishes, the terminal will indicate that the n8n is now accessible. You can open your web browser and navigate to: **http://localhost:5678**

The first time you access this URL, you will see a “Set up owner account” screen. Fill in your details to create your main administrator account. Once completed, you will be taken to the n8n dashboard, ready to build your first workflow.

![n8n Dashboard](https://miro.medium.com/v2/resize:fit:700/0*mnb8kNO2ebL7807y.png)

### Method 2: Installing n8n with Node.js (npm)

This method uses the Node Package Manager (npm), which comes with Node.js. It’s a straightforward alternative if you prefer not to use Docker.

You must have Node.js and npm installed. It is essential to use a version of Node.js that is supported by n8n. The tool currently supports Node.js versions 18.x, 20.x, and 22.x. You can download Node.js from the [official website,](https://nodejs.org/en/download) which is available for Mac, Windows, and Linux users.

![Installing Node.js (npm)](https://miro.medium.com/v2/resize:fit:700/0*-zY5AOfNNzATVkw_.png)


Then, open your terminal (or Command Prompt/PowerShell on Windows) and run the following command to install n8n.

```bash
npm install n8n -g
```

The -g flag ensures it’s installed globally, making the n8n command accessible from anywhere in your terminal.

**Note for Linux/Mac Users:** For global installations, you may need to use sudo: sudo npm install n8n -g.

After the installation is complete, you can start the n8n application with a simple command:

```bash
n8n start
```

The terminal will show that the process has been initialized and is running on port 5678. You can now open your web browser and go to the following address:**http://localhost:5678**

![n8n](https://miro.medium.com/v2/resize:fit:700/0*Ye7UimldL1d9eZe_.png)

Just like with the Docker method, you will be prompted to create an owner account. After setting it up, you can begin creating and managing your workflows locally.

## Video Tutorial: How to Install n8n on Your Computer

If you prefer a video tutorial, please watch my step-by-step video:

_Watch on YouTube:_ [_n8n locally_](https://youtu.be/nAIU7_Hwy6M)

## Conclusion

Both methods result in the same result: n8n running on your local machine. You can pick the one that best fits your experience and system preferences. Give it a shot and share with me your comments below!

Cheers! ;)
