How to Get a Public IP Address
Every device connected to the internet has a public IP address, but most home and office users share one with dozens or hundreds of other customers through their ISP. If you need a dedicated, reachable public IP to host a server, run email, accept game connections, or access your home network remotely, this guide covers what a public IP actually is and the four realistic ways to get one.
What is a public IP address?
A public IP address is the address that identifies your connection on the open internet. When you load a website, send an email, or join a video call, the remote server sees your public IP and sends its response back to it.
A private (local) IP address is what your devices use inside your home or office network, typically in the 192.168.x.x, 10.x.x.x, or 172.16-31.x.x ranges. Your router translates between your private addresses and your public address using Network Address Translation (NAT), so all your devices can share a single public IP for outbound traffic.
The problem starts when you want inbound traffic. If you're running a web server, email server, Minecraft server, or any service that other people need to connect to, they need to reach your public IP. But if your ISP shares that public IP with other customers via carrier-grade NAT (CGNAT), incoming connections have nowhere to go, your ISP's NAT equipment doesn't know which customer should receive them.
That's why getting a dedicated public IP matters: it's an address that belongs to you alone, where inbound connections are forwarded to your server and nobody else's.
Check your current public IP
Before doing anything else, find out what public IP you currently have:
curl https://api.getpublicip.com/ip
This prints your current public IP along with your ISP and approximate location. For more options (wget, dig, IPv6), see our full guide to finding your public IP on Linux.
What to look for: if your router's WAN IP doesn't match what the command above returns, your ISP is using CGNAT. If the router shows an address in the 100.64.0.0 to 100.127.255.255 range, that's the reserved CGNAT range, confirming your ISP shares your public IP with other customers.
Do you need a dedicated public IP?
If you just need to check what your IP is, the command above is all you need.
If you need a dedicated, reachable public IP so that people on the internet can connect to something you're hosting, you'll need one of the four methods below. Common reasons to get a dedicated public IP include:
- Self-hosting a website or web application at home or the office
- Running an email server (SMTP/IMAP require a dedicated IP with good reputation)
- Hosting a game server (Minecraft, Valheim, Factorio, etc.)
- Remote access to your home network (SSH, RDP, VPN endpoint)
- Home Assistant or similar smart-home dashboards accessible from outside the house
- Running a VoIP/SIP server or any other service that needs inbound connections
4 ways to get a dedicated public IP address
1. Request a static IP from your ISP
The most straightforward option: call your ISP and ask for a static public IP address.
Pros: a real, dedicated public IP directly on your line. Works for all protocols and all use cases.
Cons: many ISPs only offer static IPs on business plans ($5-$30/month extra). The IP is tied to your physical line, so moving house means losing it. Residential IP blocks often have poor email-sender reputation, which can break self-hosted email. There's no failover — if your connection goes down, the IP goes with it.
For a deeper look at how ISP-assigned static IPs work and what to expect, see our guide to getting a static IP address.
2. Use a VPN with a dedicated IP option
Some commercial VPN providers (NordVPN, Mullvad, etc.) offer a dedicated IP add-on alongside their standard shared-IP service.
Pros: portable — works from any connection. Encrypts your traffic.
Cons: most VPN dedicated IPs still have port restrictions and aren't designed for hosting. Latency is higher because traffic routes through the VPN provider's data centre. Protocol support varies. Not suitable for serious self-hosting.
3. Use Cloudflare Tunnel (free, HTTP/HTTPS only)
Cloudflare Tunnel (formerly Argo Tunnel) lets you expose a local web server to the internet without a public IP. It works by creating an outbound tunnel from your server to Cloudflare's edge.
Pros: free on the Zero Trust free tier. Bypasses CGNAT automatically. Easy to set up.
Cons: only works for HTTP and HTTPS traffic. No support for email, game servers, SSH on custom ports, VoIP, or raw TCP/UDP protocols. SSL/TLS is terminated at Cloudflare's servers, meaning Cloudflare can see your traffic in plaintext before re-encrypting it to the visitor.
For a detailed comparison, see GetPublicIP vs Cloudflare Tunnel vs Tailscale.
4. Use GetPublicIP (recommended)
GetPublicIP delivers a dedicated public IPv4 address to your server over an encrypted WireGuard VPN tunnel. Your server connects outbound to our edge infrastructure (which CGNAT allows), and we forward all inbound traffic for your IP through that tunnel.
What makes it different:
- Any protocol: HTTP, HTTPS, email (SMTP/IMAP), game servers, SSH, VoIP, raw TCP/UDP — all work.
- End-to-end encryption: SSL/TLS terminates at your server, not ours. We never see your plaintext traffic.
- Portable: move your server to a different ISP or location and keep the same public IP.
- Built-in failover: if your primary connection drops, traffic can route to a backup.
- No router configuration: the tunnel handles everything.
- $8.99 USD/month per IP. No contracts.
Create an account or start with the getting-started guide to have a dedicated public IP running in minutes.
What if you're behind CGNAT?
Many ISPs, especially on mobile networks and newer fibre connections, use carrier-grade NAT (CGNAT) to share a single public IP across hundreds of customers. If your router's WAN address is in the 100.64.0.0 to 100.127.255.255 range, you're on CGNAT.
CGNAT blocks all inbound connections, making self-hosting impossible without a workaround. Of the four methods above:
- ISP static IP (method 1) takes you off the CGNAT pool entirely — if your ISP offers it.
- GetPublicIP (method 4) bypasses CGNAT transparently because the tunnel is initiated as an outbound connection from your server.
- Cloudflare Tunnel (method 3) also bypasses CGNAT, but only for HTTP/HTTPS.
- VPN dedicated IP (method 2) may or may not work depending on the provider's port-forwarding support.
For a full technical explanation of CGNAT and how to detect it, see our complete CGNAT guide.
Public IP vs static IP — what's the difference?
These terms are related but not interchangeable:
- A public IP is any IP address visible on the open internet. Most home connections have one, but it may be dynamic (your ISP changes it periodically — sometimes daily, sometimes monthly) or shared (via CGNAT).
- A static IP is a public IP that never changes. It stays the same indefinitely, which is essential for hosting because your DNS records, firewall rules, and clients all depend on the address being stable.
Most home ISPs give you a dynamic public IP by default. If you're behind CGNAT, you don't even get your own public IP at all.
For hosting, you need a static public IP: one that belongs to you, doesn't change, and accepts inbound connections. That's what GetPublicIP provides. For more on how static IPs work and the options available, see our guide to static IP addresses.
Frequently Asked Questions
How do I get a public IP address?
Every internet connection already has a public IP, but it is usually shared (via CGNAT) or dynamic (changes periodically). To get a dedicated public IP you can either request a static IP from your ISP, use a tunneling service like Cloudflare Tunnel for HTTP traffic, or use a dedicated public IP service like GetPublicIP that delivers a real IPv4 address to your server over an encrypted WireGuard tunnel.
Is a public IP address free?
Checking your current public IP is free — just run curl https://api.getpublicip.com/ip from any terminal. Getting a dedicated public IP for hosting typically costs money. ISPs charge $5 to $30 per month for a static IP. GetPublicIP starts at $8.99 per month per IP. Cloudflare Tunnel is free but only supports HTTP and HTTPS traffic.
Where can I get a public IP?
Four main sources: your ISP (request a static IP add-on), a VPN provider that offers dedicated IPs, Cloudflare Tunnel (free, HTTP only), or a dedicated public IP service like GetPublicIP. The best choice depends on what you are hosting and whether you need full protocol support, email hosting, or end-to-end encryption.
What is the difference between a public and private IP address?
A private IP (like 192.168.1.x or 10.0.0.x) is used inside your local network and is not reachable from the internet. A public IP is the address the rest of the internet sees when your traffic leaves your router. Your router translates between the two using NAT. To host a server that anyone on the internet can reach, you need a dedicated public IP.
Do I need a public IP to host a server?
Yes, if you want the server to be reachable from the open internet. Without a dedicated public IP, inbound connections cannot reach your machine because your ISP's NAT or CGNAT does not know which customer to forward them to. Services like email servers, game servers, web servers, and remote desktop all require a reachable public IP.
Can I get a public IP if my ISP uses CGNAT?
Yes. CGNAT blocks inbound connections by sharing one public IP across many customers, but you can bypass it. GetPublicIP delivers a dedicated public IP over a WireGuard tunnel, which works even behind the strictest CGNAT because the tunnel is initiated as an outbound connection from your server. You can also ask your ISP for a static IP (if they offer it) to be taken off the CGNAT pool.
Is a public IP the same as a static IP?
Not exactly. A public IP can be dynamic (your ISP changes it periodically) or static (it never changes). Most home connections get a dynamic public IP. A static public IP is what you need for hosting because your DNS records, firewall rules, and clients all rely on the address staying the same. GetPublicIP provides static public IPs.
How much does a dedicated public IP cost?
It depends on the provider. ISPs typically charge $5 to $30 per month for a static IP add-on, often restricted to business plans. GetPublicIP offers dedicated public IPv4 addresses starting at $8.99 per month with no contract, full protocol support, and end-to-end encryption. Cloudflare Tunnel is free but limited to HTTP and HTTPS.
