LOW-SPEC PC LAB

Verification machine: Core i5-7260U / RAM 8GB / SSD 256GB|Current OS: Ubuntu 24.04.5

EN

Weekly update / 2026.11

Test a local website from your phone: Python http.server on an 8GB mini PC

Serve a folder with Python http.server, find the PC LAN address, and open the page from a phone on the same Wi-Fi. Includes the firewall, port, and security checks that usually block the first attempt.

When you are building a static page, checking it on a phone is often the slow part. Uploading to a host for every small CSS change adds a minute or two each time. Python's built-in http.server avoids that: it serves a folder over your local network, and your phone opens the PC's address directly.

Bottom line: On the 8GB test machine (Core i5-7260U / Ubuntu 24.04.5 / Python 3.12.3), a one-page folder was served with one command and returned HTTP 200 from another device on the same LAN. No install was needed — Python already includes the module.

What you need

  • Python 3 on the PC (check with python3 --version)
  • A folder with an index.html
  • The phone and the PC on the same Wi-Fi network

This is a test server, not a hosting service. It has no login, no HTTPS, and no protection against other devices on the network reading the folder. Use it only on a network you trust, and stop it when you are done.

1. Create a test folder

mkdir -p ~/localsite
cd ~/localsite
printf '<!doctype html><title>Local test</title><h1>It works</h1>' > index.html

2. Start the server on all interfaces

cd ~/localsite
python3 -m http.server 8000 --bind 0.0.0.0

--bind 0.0.0.0 is the important part. Without it, the server listens only on 127.0.0.1, which the phone cannot reach. On Python 3.7 and later you can also point at another folder with --directory:

python3 -m http.server 8000 --bind 0.0.0.0 --directory ~/localsite

Leave the terminal open while you test. Ctrl+C stops the server.

3. Find the PC's LAN address

On Ubuntu:

ip -4 addr show | grep "inet "

Look for an address like 192.168.68.64 on the interface connected to your Wi-Fi or Ethernet. Ignore 127.0.0.1. On Windows, run ipconfig and read IPv4 Address from the active adapter.

4. Open the page from the phone

In the phone browser, enter the PC address and the port:

http://192.168.68.64:8000/

You should see the test page. If you see the directory listing instead, there is no index.html in the folder — that still means the connection works.

When the phone cannot connect

Firewall on the PC

On Ubuntu, ufw may be active. Check it with sudo ufw status. For a temporary test on a trusted LAN, allow the port, then remove the rule afterwards:

sudo ufw allow 8000/tcp
# test from the phone
sudo ufw delete allow 8000/tcp

On Windows, the first run usually shows a firewall prompt. Allow access on private networks only, not public networks.

Port already in use

If Python prints Address already in use, another process has port 8000. Pick another port, for example 8081, and use that number in the phone URL. Ports below 1024 need administrator rights, so stay above 1024.

Same network, still no answer

  • Guest Wi-Fi: guest networks often isolate devices from each other. Use the main network.
  • AP isolation: some routers block device-to-device traffic even on the main network. Check the router setting.
  • VPN: a VPN on the phone or PC can send traffic outside the LAN. Disable it for the test.
  • Wrong address: the PC may have two addresses (Wi-Fi and Ethernet). Try the one on the same network as the phone.

Security checks before you use this on a real project

  • http.server serves the whole folder, including files you did not link. Do not run it from your home directory or a folder with private documents.
  • There is no password. Anyone on the same network who knows the address can read the files.
  • Do not forward the port on your router. This is for local testing only, not for publishing to the internet.
  • Stop the server with Ctrl+C when you finish. A server left running is easy to forget.
  • For a real deployment, use HTTPS and a host designed for static files. The local server is only a preview.

What we verified

On the test machine, the server started in under a second and served the test page with HTTP 200 to another device on the LAN. The page itself was tiny; a larger site will still load quickly because the bottleneck is the LAN, not the CPU. The 8GB of PC RAM was not a constraint for this task.

Related articles