Port 8000 (Python and Django)
Key facts
- Port
- 8000
- Protocols
- TCP
- Range
- Registered port, 1024-49151
- IANA service name
- irdmi
- Unofficial use
- The use described on this page is not the IANA assignment for this port. Source (opens in a new tab) Checked on 30.11.2026
IANA assigns ports in this range to services on request, under RFC 6335.
About port 8000
Port 8000 is best known as the default port of Python development servers: the built-in http.server file server and the Django development server. It runs over TCP and serves HTTP without encryption. This is unofficial use: in the IANA registry, port 8000 is registered for the irdmi service.
According to the official documentation, the python -m http.server command listens on port 8000 by default, and Django's runserver command listens on 127.0.0.1 and port 8000.
What port 8000 is used for
- Temporary file sharing: the command
python3 -m http.serverserves the current folder on port 8000, and it's handy for a quick file transfer or for testing a static site. - Django development: the command
python3 manage.py runserverstarts a development server that reloads on every code change. - Applications behind a reverse proxy: Python application servers are sometimes set to listen on port 8000, and the web server passes requests to them.
Port 8000 in the firewall
In most cases, there's no need to open port 8000 to the internet. The Django development server listens only on 127.0.0.1 by default, so it isn't reachable from outside. http.server, on the other hand, listens on all of the server's addresses by default, so you limit it with --bind 127.0.0.1.
When you need direct access for testing, allow it only from specific addresses:
- UFW:
ufw allow from 203.0.113.10 to any port 8000 proto tcp - firewalld:
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port port="8000" protocol="tcp" accept'
With an application in production, visitors arrive through port 443, and the web server passes the requests to the application server.
Risks and security
Both servers are meant for development only. According to the documentation, http.server isn't recommended for production and implements only basic security checks, and Django warns not to use runserver in a production environment.
- Keep in mind that http.server serves the whole folder you started it from, including hidden files, so start it only in a folder that holds the files you want to share.
- Limit development servers to 127.0.0.1, and when you need remote access, use an SSH tunnel.
- In production, run the application with a suitable application server, behind a reverse proxy and with HTTPS.
- Stop development servers when you finish working, and don't leave them running in the background.
Commands to check and configure
-
python3 -m http.server 8000 --bind 127.0.0.1Serves the current folder on port 8000, only on the server's 127.0.0.1 address.
-
python3 manage.py runserverStarts the Django development server on 127.0.0.1 and port 8000.
-
python3 manage.py runserver 8080Starts the Django development server on a different port, when port 8000 is taken.
-
ss -tlnp | grep ':8000 'Shows which process is listening on port 8000 and on which address (requires root for the process details).
-
curl -I http://127.0.0.1:8000Checks from the server itself that the application on port 8000 responds, and shows the response headers.
-
ufw allow from 203.0.113.10 to any port 8000 proto tcpAllows access to port 8000 only from the given IP address (UFW).
-
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port port="8000" protocol="tcp" accept'Allows access to port 8000 in firewalld only from the given IP address. Then run firewall-cmd --reload.
Port 8000 in the IANA registry
| Port | Protocol | Service | IANA registry description |
|---|---|---|---|
| 8000 | TCP | irdmi | iRDMI |
| 8000 | UDP | irdmi | iRDMI |
Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)
Port 8000 FAQ
Can I run a Django site in production with runserver?
No. Django warns that the development server hasn't gone through security and performance audits. In production, you run the application with a suitable application server, behind a web server. The Python in production page explains the setup in full.
Why can't I reach the Django development server from my computer?
By default, runserver listens only on 127.0.0.1, that is, on the server itself. The safe way to reach it remotely is an SSH tunnel, for example ssh -L 8000:127.0.0.1:8000 user@server, and then open http://127.0.0.1:8000 in your browser.
How do I quickly share a file from the server?
Run the command python3 -m http.server 8000 in a folder that holds only that file, and download it from the server's address on port 8000. When you're done, stop the server with Ctrl+C. For access from outside, open the port temporarily to your own IP address only.
What do I do when port 8000 is already taken?
Run ss -tlnp | grep ':8000 ' to see which process holds the port. You can stop it, or start the server on a different port, for example python3 manage.py runserver 8080.