How can I build n8n from source to run directly on a Linux server with Node.js?

Hi everyone,

I’m trying to build n8n directly from source code, and my goal is to get a production-ready bundle that I can run on a Linux server using Node.js, without needing Docker.

I want to understand:
:one: What is the proper way to build n8n from source so that I get all the compiled files needed to run ./n8n directly?
:two: After building, which files or directories do I need to copy to my target server?
:three: Are there any best practices for running the compiled version (for example, where to put .env, config files, etc.)?
:four: Is there any official or recommended script for packaging the build output for deployment?

I have already cloned the repo and run pnpm install and pnpm build, but I’m not 100% sure which output directories are required to run n8n successfully.

If anyone has done this before or can share a simple step-by-step, I’d really appreciate it!

Thank you so much in advance for your help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.