R
Railwayβ€’9mo ago
LordMerc

Host VPN for home server service

I'd like to expose a home server service, primarily mongo but I want to test with homepage, and attach it to my domain. I have successfully attached a basic test from railway to my domain, but would like to look at possibly doing a sub domain (i.e homepage.lordmerc.dev) and point it to my home server. I just don't know how to get started if there's any suggestions?
Solution:
VPNs on Railway are in a gray area, you can have a VPN as long as everything you do over that VPN falls under fair use and doesn't break ToS, otherwise you could get banned if you're trying to expose a certain port to a domain though then I'd recommend using your provider's API ( or if it doesn't have one, use cloudflare nameserver and use Cloudflare API ) to change the IP it points to dynamically I do this for my PaaS and it works perfectly...
Jump to solution
18 Replies
Percy
Percyβ€’9mo ago
Project ID: N/A
LordMerc
LordMercβ€’9mo ago
8065ac36-479d-4e82-93e6-4d70f3be69ea is the basic test i got
Solution
Fragly
Fraglyβ€’9mo ago
VPNs on Railway are in a gray area, you can have a VPN as long as everything you do over that VPN falls under fair use and doesn't break ToS, otherwise you could get banned if you're trying to expose a certain port to a domain though then I'd recommend using your provider's API ( or if it doesn't have one, use cloudflare nameserver and use Cloudflare API ) to change the IP it points to dynamically I do this for my PaaS and it works perfectly
LordMerc
LordMercβ€’9mo ago
i use cloudflare for hosting my domain and I did get started with cloudflared for tunneling but i have had no luck with it so far I only intend to use the VPS to proxy my mongodb so I can use my homeservers storage
Fragly
Fraglyβ€’9mo ago
that should be fine I'm pretty sure as long as you don't break ToS or fair use over than VPN
LordMerc
LordMercβ€’9mo ago
is there any tutorial that's similar to doing this? because I was recommended to just vps proxy back to home server's vpn since im not sure how I would get the IP off the vpn to proxy back and such
Fragly
Fraglyβ€’9mo ago
oh true, deployments on Railway have dynamic IPs πŸ€” tbh I think the solution I suggested is still better, VPN seems like a roundabout way of doing this it's going to impact speed and will be more costly than just routing the domain to your local IP
LordMerc
LordMercβ€’9mo ago
any tutorial on that? because I thought I did it correctly, but im trying to expose the ip + port but my IP is dynamic thats why i went with the cloudflare tunnel but i dont think im doing it right
Fragly
Fraglyβ€’9mo ago
Cloudflare tunnel might be better, I've never set one up myself so I can't help much there what I have is a cron job that just sends an API request to cloudflare to change my A record target to my current IP Docs: https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record You'll also want to make sure you port forward to the correct local IP you can do this in your router admin page, but this differs between routers For example, my router:
No description
Fragly
Fraglyβ€’9mo ago
^ make sure your local IP is static, this is pretty easy to do though just search up a tutorial if you don't know how to do this
LordMerc
LordMercβ€’9mo ago
aye my homeserver is static
Fragly
Fraglyβ€’9mo ago
oh that's awesome!
LordMerc
LordMercβ€’9mo ago
No description
Fragly
Fraglyβ€’9mo ago
Warning: Cloudflare tunnel is likely better than this way but this setup works perfectly fine for me
LordMerc
LordMercβ€’9mo ago
so i got this so far with the internal ip being the 192 that was my first attempt but i thought routes was the way to go i dont know if i did it right tho idk if its supposed to be public or private
Fragly
Fraglyβ€’9mo ago
yea I have no idea, I've never deployed a cloudflare tunnel in my life I'd recommend reaching out to cloudflare about this and if you want to use my alternative then feel free to just dm me since it's not really related to Railway and if you end up wanting to use the VPN way, feel free to open a new help thread
LordMerc
LordMercβ€’9mo ago
alrighty!
Fragly
Fraglyβ€’9mo ago
Best of luck πŸ™‚
Want results from more Discord servers?
Add your server