FTP Node - Timeout while connecting to server. Selfhosted

Describe the problem/error/question

Hey, n8n is unable to connect to my ftp server. I am able to connect to the ftp server using filezilla. When I ssh into my docker container that is hosting n8n, I am able to ping my ftp server.

What is the error message (if any)?

Couldn’t connect with these settings

Timeout while connecting to server

Please share your workflow

Share the output returned by the last node

No output, only a error message in the creating credential popup.

Information on your n8n setup

  • n8n version: 2.33.3
  • Database (default: SQLite): Postgress
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Did not set so i assume own.
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker on Ugreen
  • Operating system: UGOS, based on Debian

Hey @SenAlasca, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@lvl99, @Mayank1024 - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

@SenAlasca Make sure in your env var N8N_RESTRICT_FILE_ACCESS_TO it has acsess to the ftp location, n8n may be getting blocked

Hey @SenAlasca

Which FTP server are you using and is it doing plain FTP or one of the FTPS variants? We don’t currently support FTPS so it could be that this is the issue, Generally I tend to prefer SFTP if it is an option it could be a quick solution to get you up and running.

Hi @SenAlasca

Ping only shows that the host is accessible, but it doesn’t test the FTP port. Try this from inside the box:

nc -zv your-ftp-host 21

If that works but the node times out, it’s passive mode. FTP opens a second connection on a random high port for data, and FileZilla handles that fine from your machine while the container often can’t, because the server hands back an IP address that the container can’t reach.

It’s also worth checking what achamm mentioned, isn’t it? N8N_RESTRICT_FILE_ACCESS_TO affects local file paths rather than outbound connections, so it wouldn’t cause a connection timeout.

Hi @SenAlasca
“Timeout while connecting to server” fires before the server’s 220 greeting arrives, so the socket opened and n8n’s FTP client hit its 10 second control-connection limit with nothing coming back. That 10 seconds is hardcoded in the credential test, which is why the popup keeps failing regardless of what you change in it.
Save the credential despite the banner, then on the FTP node set Options > Timeout to 60000. The option only applies to the node, not to the test.
If it connects there, the server is stalling on a reverse DNS and ident lookup of the container’s 172.x address, which has no PTR record. On ProFTPD:

UseReverseDNS off
IdentLookups off