Creating a Simple HTTP Server

suggest change

To share files or host a simple static site on a trusted network, use Python's built-in http.server module. From the directory to serve, run:

python -m http.server 8000

If the port number is not given, 8000 is the default port. The startup line is:

Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...

By default, the server listens on all interfaces. To make a development server accessible only from the local machine, use python -m http.server 8000 --bind 127.0.0.1. Another machine uses this computer’s LAN address, which often looks like 192.168.x.x, not 0.0.0.0.

Stop the server with Ctrl+C. This server is intended for development and trusted local networks, not production use.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents