How can I whitelist my backend hosted on Railway, in my MongoDB Atlas cluster?

1k Views Asked by At

I'm hosting my backend code on Railway, and using MongoDB Atlas to store my data.

For development I had my local IP address whitelisted. But now when my backend has been deployed and I went to make it public, it can't connect to my Atlas cluster because it is making the request from a different IP address that isn't whitelisted. I can make my cluster be open to be accessed from any IP but I don't want that.

When it comes to Railway, I can't understand where do I find the IP address that I need to whitelist on Railway?

2

There are 2 best solutions below

2
On

Is this for https://railway.app ? I am not too familiar with it but based off the help page / common questions https://railway.app/help , it states the following:

Can I get my workload's IP Address?

We don't provide static IPs at this time. This on our roadmap.

Have you tried contacting Railway support or similar to find out the information regarding the IP addresses? Maybe they're on a particular range that you could add to your network access list in Atlas instead of allowing all IP addresses.

0
On

On 'Network Access' tab, select Add IP Address and click 'Allow from anywhere'.