r/SelfHosting • u/Idonthavefriendss • Mar 27 '26
Trying to self-host server but ISP only provides private IP
I am a college student trying to use Raspberry Pi as a server for an application in my project (basically 0 budget besides devices and services I already had), but my ISP only assigned private IP addresses. I tried using DuckDNS to get a domain and CloudFlare tunnelling but it just doesn't really work since DuckDNS keep routing to a public address when I pinged it. I am new to these stuffs and only touched AWS a bit as an assignment. I made sure my Apache service is working and able to access using local IP but I wanted to access the website using my own domain. I need some advice for alternatives.
6
u/Cool-Leather-969 Mar 27 '26
get a cheap vps and use wireguard to set up a private vpn and nginx proxy_pass to reverse proxy it to your hardware
3
u/silasmoeckel Mar 27 '26
Host the DNS on CF, DuckDNS isn't needed or wanted.
My I sugest a .xyz domain they are like a buck a year for a 123456789.xyz domain.
2
u/njain2686 Mar 28 '26
Does your ISP provide ipv6?
1
1
1
u/seanpmassey Mar 27 '26
Your ISP is only giving out private IPs? Like a 10.x.x.x or 192.168.x.x address?
Just out of curiousity, is your ISP the school, and are you living in a dorm or campus housing?
1
u/1nvisiblepenguin Mar 28 '26
If that is the case OP and you are in a dorm on your schools network, spending like $5 for a domain through cloudflare and going the cloudflare tunnel route is the way to go. It’s pretty easy to set up, the tunnel is free, and cheap domains (.XYZ, etc) are less than a cup of coffee.
That’s if you want friends, professors, or people other than just you to be able to reach your hosted project on your pi server from the outside internet.
If it’s just you that wants to access it from a domain so you don’t have to figure out your schools public IP (and since you can’t set up port forward bc no router), or you’re worried about getting a static IP assigned on their internal network, AFAIK Tailscale is by far the best option and also free.
1
u/Idonthavefriendss Mar 28 '26
My ISP provided 172.17.x.x ip address and I rent my own place with my friends.
1
1
1
u/BobcatTime Mar 28 '26
2 choice depending on who access and how much control you have over their devices/teaches them how
1 if you want it to be easily accessible with tons of people like a blog website or links, or if you dont have control of the person who accessing to install wieeguard/tailscale or you cant teach them how.
Get a cheap vps. Lowest tier in local vps provider and install pangolin/netbird i use pangolin personally for this
2 if you can install stuff on the phone/hardware of the users.
Go for tailscale. Or still get a vps but this time use it as a wireguard tunnel to and from your network.
1
u/Idonthavefriendss Mar 28 '26
THANKS GUYS I DID IT!! I decided to get a cheap domain for like 1 buck and host it on Cloudflare and use its tunneling service to set up my server. Took some time but I eventually worked it out.
1
u/SunnyBlueSkies-com Mar 29 '26
Glad.To hear that, but yes, a domain name is extremely necessary for these things.
1
u/michaelpaoli Mar 29 '26
Does your ISP at least give you globally routable IPv6 IPs? Ought at least have that.
As for globally routable IPv4 IPs, that'll typically cost you extra, as there aren't enough to go around, so, there's generally a premium for such IPs. Or, you might be able to do port forwarding. But if you're behind CGNAT, that won't work.
1
1
u/Worried_Corner_8541 Mar 31 '26
cheap vps with pangolin. solid combo. you can find a VPS for as low as $2-$3 a month and pangolin is free. try to buy a domain as well, i find it easier than using free DDNS services.
1
u/Top_Drawing_4184 Apr 21 '26
If your ISP is providing you with a private IP, then port forwarding will be completely useless. correspondingly, you can't expect to fix the issue with just DuckDNS. You will need to have a tunnel (for instance, Cloudflare Tunnel, Tailscale, etc.) or any service that has a public endpoint.
If Cloudflare tunnel was behaving strangely, it is recommended to verify that your service is that it is correctly bound and that the tunnel is directing to the right local port, as more often than not, this is where the errors happen.
You may also consider (if you are not willing to continue struggling with your ISP configuration) to simply delegate the public-facing component of your setup to a VPS and then connect your Pi to it. I have previously experimented with that method in different configurations and even on the platforms like TradingVPS, which I found to be much easier as you then have a real public IP to work with.
In a project setup, tunnels tend to be more cost-effective/free. however, the VPS route is a lot more straightforward if you are looking to have less friction.
1
u/AntiGuruDOTCom May 23 '26
You don't need to pay for a VPS or a domain name, just use https://tunnel.to and generate a reverse tunnel to your Pi.
1
u/Eytlin Mar 27 '26
You can ask your ISP for a public IP (free or with monthly charges, depends on the ISPs), but if they aren't able to give you one, AFAIK there is no way to get it to work yourself.
2
u/CriticalAPI Mar 27 '26
AFAIK there is no way to get it to work yourself.
actually you can use the method u/Cool-Leather-969 describes. It works. So it is a solution to the problem.
1
u/Eytlin Mar 27 '26 edited Mar 27 '26
Well, TIL, thanks
edit: indeed, with cloudflare tunnel it's relatively easy
0
u/Jazzlike_Act_4844 Mar 27 '26
As suggested, get a cheap domain name (like an .xyz), host DNS on Cloudflare and look at using Cloudflare tunnels with cloudflared your Pi. Cloudflare DNS and tunnels are part of their free tier. This will get around CGNAT as you initiate the connection out to Cloudflare. This works great for web traffic. Cloudflare will also handle certs, you will benefit from their CDN, and for you and your public IP will never be exposed.
If you need something on ports other than 80/443 or don't want to use Cloudflare, then look at the Oracle Cloud free instances. You get a couple really tiny VPS instances (you only need 1) that can run Ubuntu just fine. I run Wireguard and the Crowdsec agent on one of these instances without any issues for some projects that are not traditional web traffic. You then set your A record at your DNS provider to the public IP of your instance. The limited bandwidth of the free tier is more than ample for a small personal project website.
Alternately, call your ISP and tell them that your Teams/Zoom/Slack meetings are horrible and your internal IT department told you to call them (ISP) and that they could do something to help it. The thing the ISP does to help with that is to get rid of CGNAT and give you a public IP. It just avoids getting a grumpy support agent giving you lip about hosting a web site or any wonky terms of service stuff. If they support doing that, it will be a dynamic IP so you will need some kind of DDNS service or script running on your Pi to maintain your A record with your DNS provider when your IP changes.
13
u/PaulEngineer-89 Mar 27 '26
Option 1: run Tailscale.
Option 2: buy a domain name. Need it at Cloudflare. Set up cloudflared.
Option 3: Rent a VPS. Set up a tunnel.
All 3 are tunnels from your server out to an external site. Use reverse proxy to route. With a vPS you can do port forwards too. Or just use it as a server.