2 months ago
I need an IP Addreess to allow my backend on railway to communicate with mongodb before I deploy the full system because I need to have a database connected to the backend to save data on my webapp
Pinned Solution
2 months ago
Sorry I'm confused. Is your backend on Railway or is your database on Railway?
Unfortunately, static outbound IPs are only available on the Pro plan on Railway. Free plan users do not have access to static IPs for services in Railway.
There isn't a way for you to get the IP address of your backend service.
(If I understand your thread correctly)
12 Replies
2 months ago
You'll want to use the static IP feature, which is available to users on the Pro plan.
Status changed to Awaiting User Response Railway • 2 months ago
2 months ago
I don't have money currently and can only run off free plans and also cant do any advanced stuff that requires me to not use my web browser because I'm on an HP Chromebook
Status changed to Awaiting Railway Response Railway • 2 months ago
2 months ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 2 months ago
2 months ago
Railway doesn't provide IP addresses to connect to services.
You can access the MongoDB database through the public URL from the variables tab, although I'd recommend moving your service to Railway to avoid egress costs, as they can rack up quite quickly.
2 months ago
So do I just use the prebuilt variable to save a headache of networking everything to get them to play nice
2 months ago
Yes. Though keep in mind using the public URL will incur egress costs, which may increase quickly.
2 months ago
so do I add it as a database service
2 months ago
Sorry I'm confused. Is your backend on Railway or is your database on Railway?
Unfortunately, static outbound IPs are only available on the Pro plan on Railway. Free plan users do not have access to static IPs for services in Railway.
There isn't a way for you to get the IP address of your backend service.
(If I understand your thread correctly)
2 months ago
backend is on railway but I am trying to connect a database to it because my code in GitHub is setup weird and uses 2 other platforms to run the app
2 months ago
You need to migrate your db to railway.
- In your project canvas, Click New -> Database -> Add MongoDB.
- Once deployed, click on the newly created MongoDB service, navigate to the Variables tab, and copy the MONGO_URL
- Paste the url into the backend service's Variables tab.
2 months ago
OP can just get a connection string to their MongoDB Atlas instance through their MongoDB Atlas dashboard and use that to connect their Railway backend service to the db.
I wouldn't migrate the database to Railway since OP is on the Free plan.
0x5b62656e5d
OP can just get a connection string to their MongoDB Atlas instance through their MongoDB Atlas dashboard and use that to connect their Railway backend service to the db. I wouldn't migrate the database to Railway since OP is on the Free plan.
2 months ago
On free plan, he must follow your recommendation to keep the database on MongoDB Atlas due to the constraints of Railway's Free plan
2 months ago
ok I just did the allow all IP addresses ip
Status changed to Solved 0x5b62656e5d • about 2 months ago

