Skip to main content

Prerequisites

Before you begin, ensure you have the following installed on your system:

Node.js

Node.js version 24 or newer is required for development.

pnpm Package Manager

n8n uses pnpm version 10.22 or newer as its package manager. We recommend installing it with corepack for automatic version management.
pnpm workspaces automatically manage file-links between modules that depend on each other in the monorepo.

Corepack

Enable Node.js corepack to manage pnpm automatically:
macOS (Homebrew users): If you installed Node.js via Homebrew, you need to install corepack separately:
Homebrew explicitly removes npm and corepack from the Node.js formula.
Windows users: Run the corepack commands in a terminal with administrator privileges:

Build Tools

Some n8n dependencies require native compilation. Install the appropriate build tools for your operating system:

actionlint (Optional)

If you plan to modify GitHub Actions workflow files, install actionlint:
actionlint is only required when modifying .github/workflows/*.yml files. It runs automatically via git hooks when workflow files change.

Development Container (Optional)

If you use VS Code with Docker, you can use n8n’s Dev Container for a pre-configured environment:
  1. Install VS Code and Docker
  2. Click here to automatically clone and open n8n in a Dev Container
The Dev Container includes all required tools and dependencies.

Initial Setup

For External Contributors

1

Fork the repository

Go to n8n-io/n8n and click the “Fork” button in the top-right corner.
2

Clone your fork

3

Add upstream remote

This allows you to sync with the original repository:
4

Install dependencies

This installs all dependencies for all packages and automatically links them together using pnpm workspaces.
5

Build all packages

Performance tip: Redirect build output to a file to avoid overwhelming your terminal:

For n8n Team Members

1

Clone the repository

2

Install dependencies

3

Build all packages

Starting n8n

After the initial setup, start n8n in production mode:
n8n will be available at http://localhost:5678

Development Mode

For active development with hot-reload, use development mode:

Full Stack Development

This starts all packages in watch mode with automatic rebuilding and hot-reload.
Performance impact: Full development mode runs multiple processes in parallel:
  • TypeScript compilation for each package
  • File watchers monitoring source files
  • Nodemon restarting the backend
  • Vite dev server with HMR for frontend
  • Build processes for various packages
This can consume significant CPU and memory. See Selective Development for optimized workflows.

Selective Development

Run only the packages you’re actively working on for better performance:
Excludes frontend packages like editor-ui and design-system.
Runs editor-ui and design-system development servers.
Runs only essential packages for AI node development.

Most Common Development Workflow

Many n8n developers use this two-terminal setup:
If you modify code outside packages/cli or packages/frontend/editor-ui, run pnpm build to rebuild those packages.

Custom Node Development

For developing custom nodes with hot-reload:
Performance considerations:The N8N_DEV_RELOAD feature watches potentially thousands of files. On resource-constrained systems, consider developing without hot reload and manually restarting when needed.

Testing with Different Configurations

n8n uses Testcontainers to quickly spin up local instances with different configurations:
1

Build a Docker image

Build from your branch:
Or use an existing image:
2

Run a stack

3

Customize or scale (optional)

Customize with environment variables:
Scale up workers:
Each instance gets its own port. Multi-main stacks use a load balancer by default. See packages/testing/containers/README.md for more details.

Testing with Clean Database

To test features with a fresh n8n instance without losing your existing setup, use a different user folder:
Each folder maintains its own database, settings, and workflows.

Troubleshooting

  1. Clear node_modules and reinstall:
  2. Ensure you’re using the correct Node.js and pnpm versions:
Change the port with an environment variable:
Ensure you’re using N8N_DEV_RELOAD=true and that the relevant packages are running in watch mode:
Testcontainers requires additional configuration for Docker alternatives:
  • Podman: Follow this guide
  • Colima: Set environment variables as described here

Next Steps