What you end up with
computer ~/Pictures/trip the folder you're sharing
python -m http.server a server on port 8000 while the window is open
phone http://192.168.1.23:8000 the file list; tap one and it downloads
The server runs while the terminal is open: Ctrl+C and the folder is closed. There’s no password, so share only on
your own network and only for the duration of the transfer.
Step by step
Install Python
Where How Command Windows the Python install manager: Microsoft Store or python.org/downloads (it’s the same installer) pythonUbuntu 24.04 already installed, Python 3.12 python3macOS the installer from python.org, or brew install pythonpython3On Windows, the old
.exeinstaller with the “Add python.exe to PATH” checkbox is deprecated since 3.14, and there won’t be one for 3.16. The install manager puts thepythonandpycommands on the path itself — no checkboxes. After installing, open a new terminal window: the old one doesn’t know about the new commands.python --version # Python 3.15.1From here on, type
python; on Ubuntu and macOS,python3.Go to the folder you’re sharing
cd ~/Pictures/trip~is your home folder; paths with/work in PowerShell and in Linux and macOS terminals alike. The server shares the folder it’s started in, with everything inside. Don’t share your whole home folder: it holds.sshkeys, browser files and documents. Instead ofcdyou can use the-doption with a full path:python -m http.server -d D:\photos\trip.~won’t do here: Windows PowerShell 5.1 doesn’t expand it in program arguments, and Python gets it literally.Start the server
python -m http.server # Serving HTTP on :: port 8000 (http://[::]:8000/) ...-m http.serverruns thehttp.servermodule from the standard library as a program. A module is a file of Python code; the standard library is the modules that come with Python, so there’s nothing to download.::in the output means the server listens on all the computer’s addresses, IPv4 included; the default port is 8000.On Windows, the firewall asks on first launch whether to let Python onto the network. Tick “Private networks”; public ones aren’t needed.
Find the computer’s network address
Where Command What to look for Windows ipconfigthe IPv4line in the Wi-Fi or Ethernet blockUbuntu hostname -Ithe first address macOS ipconfig getifaddr en0the Wi-Fi address Home addresses start with
192.168.,10.or172.16.–172.31.. Addresses from the WSL, Hyper-V and VirtualBox blocks aren’t visible to the phone.Open it from the phone
The phone is on the same Wi-Fi as the computer. In the browser type
http://192.168.1.23:8000: your own address,httprather thanhttps, and the port after a colon. The “Directory listing for /” page shows the files and folders. Tap a file and the browser offers to download it. Images, PDFs and text (.txt,.md) it opens itself; text with non-ASCII characters may show up garbled — download such a file with a long press, “Download link”.The terminal prints a line for each request:
192.168.1.57 - - [21/Oct/2026 23:05:30] "GET / HTTP/1.1" 200 -First comes the phone’s address;
200means the file was served.Close it
Ctrl+Cin the server window printsKeyboard interrupt received, exiting., and the folder is no longer available.
What’s new here
- Running
python. Python is an interpreter program: it reads code and executes it.python --versionasks it for its version, andpython file.pyruns your own script — details in Running Python. - A module and
python -m.http.serveris a standard library module, and-mruns it by name without knowing where the file lives.python -m pipandpython -m venvrun the same way.
Limits
- One direction only.
http.serverserves files but can’t receive them: you can’t send from the phone to the computer this way. - No password and no encryption. Any device on the network sees the whole folder, hidden files included. The documentation marks the module as unsuitable for production: it has only basic security checks.
- It listens on every address. To limit it to one, use
-b:python -m http.server -b 192.168.1.23.
If it doesn’t work
You type python, and the Microsoft Store opens
- Cause
- Python isn’t installed, and Windows substitutes a stub — an app alias that leads to the store.
- Fix
- Install the Python install manager (step 1) and open a new terminal window. If that doesn’t help — “App execution aliases” in Start: the toggle for “Python (default)” should be on.
Command 'python' not found, did you mean: command 'python3'
- Cause
- Ubuntu has Python 3, but the command is called
python3; there’s nopythonwithout the digit by default. - Fix
- Type
python3 -m http.server. If you wantpython,sudo apt install python-is-python3.
The phone loads for a long time and says the page can’t be opened
- Cause
- The computer’s firewall blocks incoming connections on port 8000, or the phone is on another network: guest Wi-Fi, mobile data.
- Fix
- On Windows, allow Python on “Private networks” (the prompt on first launch, or “Allow an app through Windows Firewall”); the Wi-Fi network must be set to “Private”. Put the phone on the same network as the computer, not the guest one.
The address is typed in, but a foreign page or nothing opens
- Cause
- You took the address of the wrong adapter: WSL, Hyper-V and VirtualBox have their own addresses, which the phone can’t see.
- Fix
- In
ipconfig, take the address from the Wi-Fi or Ethernet block the computer uses on the home network — usually192.168.x.x.
Started it in another folder, but the phone shows the old one
- Cause
- The first server is still running in another window. On Windows a second start on the same port gives no error — two processes share the port.
- Fix
- Stop the old one with
Ctrl+Cin its window, or start the new one on another port:python -m http.server 8080.
Tapped a .md or .txt, and instead of a download you get text with garbled characters
- Cause
- The browser opens files it can display by itself.
http.serverserves them without an encoding (Content-Type: text/markdown, nocharset=utf-8), and the browser reads non-ASCII text — accents, other alphabets — in the wrong encoding. - Fix
- Long-press the file in the list and choose “Download link”: the file is saved as is, in UTF-8.
How to check
From the phone, open http://<computer address>:8000 — you see “Directory listing for /” and your files, and a line
with the phone’s address and 200 appears in the terminal. After Ctrl+C the same page doesn’t open on the phone.