How do I connect to databases behind private VPN

Hi there,

We’re trying to setup n8n over https://app.n8n.cloud but I’m not able to connect to our database behind VPC. Here’s how our api/database is deployed on AWS

______________     ____________     ____________________________
| n8n servers | -> |Jump host| -> | EC2 instance/RDS instance |
______________      ___________     _____________________________

I’ve setup an ssh tunnel from Jump host to EC2 instance, whitelisted IPs at security groups as well as within the database configuration, but I’m not able to connect it via n8n servers.

Here’s the command I’ve used on Jump host to setup the SSH tunneling

autossh -M 0 -N -L 6333:10.0.3.15:5432 [email protected] -i key.pem

Can you please help me in establishing connection, otherwise we’d be forced to spin and maintain another EC2 instance for running n8n at our premises.

Any help would be appriciated.

TIA

Hi @Developer_Isprava,

Welcome to the community :tada:

How are you trying to make the connection to your jump host? At the moment our cloud instances don’t support VPNs or SSH tunnels from the instance but in theory if your jump host is listening on an address the cloud instance can read and is proxying the connections through the tunnel it should work.

It could be worth testing the jump host manually in a similar way from your desktop just to make sure that is working.

1 Like

Thank you for quick reply.

I’m able to connect to the server from my local but its not connecting via n8n and getting timed out (504 error). I’ve whitelisted following ips as shared in the doc.

  • 20.79.227.226
  • 20.79.72.36
  • 20.218.202.73

Got it working. There was some config issue with sshd and port mismatch at the secureity groups level, got it resolved.

Many thanks for prompt response

2 Likes

Hey @Developer_Isprava,

That is good to hear, Nice work on finding the issue :raised_hands:

1 Like

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