How to Host a Website From Your Phone Using IPv6

web server on mobile phone using ipv6

I have always liked the idea of running a server from whatever device I have in my pocket. With IPv4 that is basically impossible on mobile data because your phone is behind carrier grade NAT. IPv6 changes the game. If your carrier gives you a real IPv6 address, your phone can be on the public internet without any special tricks.

I tried it on my own phone and it works.

Finding Your IPv6 Address

First, check if your phone has IPv6 and whether it is a global address. On Android you can find it in Settings → About Phone → Status → IP address, or in Termux by running:

ip -6 addr show

Look for something that starts with 2001: or 2400:. If it starts with fe80: that is a link local address and will not work for this. On iOS it is in Settings → Wi-Fi → tap your connected network → IPv6 Address.

Running a Server

On Android, the easiest way is with Termux. Install Python and start a simple HTTP server:

pkg install python
python -m http.server 8080 --bind ::

The bind option with :: makes it listen on all IPv6 interfaces. You can use a dedicated web server app too, but this is the quickest way to test. On iOS you can use Pythonista, iSH or any app with a built in web server.

Testing It

On your phone, open a browser and go to:

http://[your_ipv6_address]:8080

You need the square brackets for IPv6. If it works locally, try from another IPv6 capable device on the internet:

curl -6 http://[your_ipv6_address]:8080

If the page loads you have a public website running from your phone.

Things That Might Get in the Way

Some mobile ISPs block inbound IPv6 traffic. If that happens nothing will load from outside. Your IPv6 address might also change when you reconnect to the network. Running a server will also keep the radio active which drains battery faster. There is no HTTPS by default so traffic is not encrypted.

Making It Easier to Reach

Typing a long IPv6 address is inconvenient. You can use a free dynamic DNS service that supports IPv6 such as Dynv6 or DuckDNS. Once set up you can visit your server at an address like:

http://myname.dynv6.net:8080

Why Bother

For me it is about the novelty of hosting something directly from a phone with no cloud in between. It is handy for quick file sharing, testing apps from real external clients, or just playing with IPv6 in a practical way. It is not a production setup but it is a fun reminder that with IPv6 the internet can be end to end again.

Post Comment

You May Have Missed