Better error when cannot bind to port

The idea is:

I just spent an hour trying to figure out why a new N8N install wasn’t working. I entered ‘n8n’ at the command line, it ran for a few seconds, then exited silently.

Turned out that n8n couldn’t bind port 443 on my server because I had forgotten that step. As soon as I did, it ran fine.

I got lots of useful errors about postgres permissions not being set right and SSL certificate filesystem permisions not being not being set right which helped me clear those hurdles. It would be nice if n8n would print an error about not being able to bind to the configured port.

My use case:

I don’t set up new N8N servers very often, so there’s a lot of remembering what all the steps are.

For those of you who find this post later, the correct magic spell on Amazon Linux is:
linux> sudo setcap CAP_NET_BIND_SERVICE=+eip `which node`

I think it would be beneficial to add this because:

Setting up self-hosted N8N has a lot of steps. Good debugging messages make it go a lot more smoothly.

Any resources to support this?

Are you willing to work on this?

Nobody wants that :slight_smile:

Just wanted to bring attention to this. I updated nvm to the most recent node v22 this morning and then had to track this down again because n8n was mysteriously exiting after I started it. Good thing I remembered this.

It seems super easy to catch an error binding to the configured port and print that to the console. Hopefully that’ll get on the to-do list for a future version soon!

Lee

P.S. I’m on Amazon Linux 2023. Not sure if this also applies to Ubuntu, Red Hat, or other distros.