Connection between two projects & environments with Tailscale

rjbathgate
PRO

11 days ago

Hey,

I'm trying to get my head around how I can use Tailscale for this to work:

A n8n deployment in one project (Project A)...

...to have MySQL access to a MySQL deployment in another project (Project B).

Goal: to allow the MySQL node in n8n to have a connection with the MySQL deployment, without needing the MySQL deployment open to the public.

I can deploy Tailscale into Project B using either:
https://railway.com/deploy/tailscale-forwarder
or
https://railway.com/deploy/tailscale (and https://docs.railway.com/tutorials/set-up-a-tailscale-subnet-router)

This allows any device on my Tailscale network to connect to the MySQL deployment.

However, the n8n deployment is not on my tailnet.

Am I right in thinking I would need to install Tailscale INSIDE the n8n container/deployment, rather than just as another service in the Railway project? If so, I'd need a custom Dockerfile rather than the prebuilt n8n templates Railway has?

Or, is there a way to have n8n connect to a Tailscale deployment within its project, and then that connects over my Tailnet to the one aligned with my MySQL project?

Thanks

Solved

3 Replies

Railway
BOT

11 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


11 days ago

Hello,

You would want Railtail deployed into the project with N8N.

https://railway.com/deploy/railtail

And Tailscale Forwarder deployed into the project with MySQL.

https://railway.com/deploy/tailscale-forwarder

And then configure the Tailscale forwarder to point towards MySQL, and configure Railtail to point towards the Tailscale forwarder machine, then N8N connects to Railtail.

But keep in mind this will have a good degree of latency. The ideal solution here is to deploy N8N into the same project as MySQL.

Best,
Brody


Status changed to Awaiting User Response Railway 11 days ago


rjbathgate
PRO

8 days ago

Got this all set up and currently in 'testing' (i.e. going to check my Tailscale key set up survives the expiry period and redeployment).

Just a note, if anyone else is reading this, set up your Tailscale Forwarder first, as you need its Tailscale hostname for TARGET_ADDR in Railtail.

Thanks again Brody


Status changed to Awaiting Railway Response Railway 8 days ago


Status changed to Solved rjbathgate 8 days ago