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:Jump to 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...
18 Replies
Project ID:
N/A
8065ac36-479d-4e82-93e6-4d70f3be69ea
is the basic test i got
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
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
that should be fine I'm pretty sure
as long as you don't break ToS or fair use over than VPN
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
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
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
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:
^ 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
aye my homeserver is static
oh that's awesome!
Warning: Cloudflare tunnel is likely better than this way
but this setup works perfectly fine for me
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
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
alrighty!
Best of luck π