N8n continuous running on the server

Hi,

I have plan to install n8n on our prod server with linux OS, may I know if what are the options do we have to make n8n run continuously even closing the SSH?

Hey @rodskie123,

You can use Docker which is the recommended solution or if you want to use NPM you can use PM2 to run it as a service.

There are other ways depending on your knowledge of Linux to keep something in the background like setting up a systemd service or even using something like nohup.

Hi Jon,

I tried to install and start the n8n in PM2, may I know what is the next step I need to do for me to access the n8n application?

I already tried to access it using serverIP:5678 but not accessible anymore…

Hey @rodskie123,

That is strange in my testing with PM2 it just worked, is it listening on port 5678

you should allow the 5678 port on your server, or disable firewalld.

I already access the n8n in PM2 service Thank you for your help @jon @sultan

In addition, may I know what is the safest deployment for prod server that runs multiple application is it docker or npm with PM2 deployment?

Hey @rodskie123,

There is no magic answer to that one it depends on what you are already doing and what your current policies are. Both options are valid, Personally I run n8n in Docker which keeps the Execute Command node sandboxed to that container rather than the entire OS but you can exclude it if you don’t plan to use it or restrict the user account to have limited permissions on the OS.