localhost:8000
Port 8000 is the most contested port in web development. At least four major frameworks and tools default to it, which means if you're running more than one backend project simultaneously, you're going to hit a port conflict. Here's who claims 8000 and how to deal with the inevitable collision:
| Tool | Command | Language |
|---|---|---|
| Django | python manage.py runserver | Python |
| Laravel | php artisan serve | PHP |
| PHP built-in server | php -S localhost:8000 | PHP |
| Python http.server | python -m http.server | Python |
| Ruby (WEBrick) | ruby -run -e httpd . -p 8000 | Ruby |
Django on Port 8000
Django is probably the most common occupant of 8000. The development server starts with:
# Default — starts on 127.0.0.1:8000
python manage.py runserver
# Different port
python manage.py runserver 9000
# Accessible from other devices on your network
python manage.py runserver 0.0.0.0:8000
Django's dev server is for development only — it's single-threaded, auto-reloads on file changes, and has no security features. For production, use Gunicorn or uWSGI behind Nginx.
One thing Django developers learn quickly: the dev server serves static files (CSS, JS, images) automatically in development but not in production. If your styles disappear when deploying, you need to run python manage.py collectstatic and configure your web server to serve the static files directory.
Laravel on Port 8000
# Default — starts on 127.0.0.1:8000
php artisan serve
# Different port
php artisan serve --port=9000
# Accept connections from other devices
php artisan serve --host=0.0.0.0
Like Django's runserver, artisan serve is development-only. It uses PHP's built-in server under the hood. For a more full-featured local setup with MySQL and proper virtual hosts, use Laragon, XAMPP, or Docker instead.
If you're getting a blank page or 500 error, check storage/logs/laravel.log. The most common cause on first run: missing .env file (copy .env.example) or no app key (run php artisan key:generate).
PHP Built-in Server
PHP has had a built-in development server since version 5.4. No Apache, no Nginx, no XAMPP — just PHP itself:
# Serve current directory on port 8000
php -S localhost:8000
# Serve a specific directory
php -S localhost:8000 -t public/
# Use a custom router script (like Laravel's server.php)
php -S localhost:8000 server.php
This is handy for quick previews of PHP files without setting up a full web server. It's single-threaded though — don't use it for anything with concurrent users.
Python's Quick HTTP Server
The fastest way to serve static files from any directory. No installation needed — it ships with Python:
# Python 3 — serves current directory
python -m http.server 8000
# Serve a specific directory
python -m http.server 8000 --directory ./build
# Bind to all interfaces (accessible from other devices)
python -m http.server 8000 --bind 0.0.0.0
Developers use this for previewing static HTML sites, serving build output locally, or quickly sharing files across a local network. It doesn't execute any server-side code — pure static file serving.
Port 8000 Already in Use
When you get "Address already in use" or "Port 8000 is already bound":
# Find what's using 8000
# macOS/Linux
lsof -i :8000
# Windows
netstat -ano | findstr "8000"
# Kill it (use the PID from above)
kill -9 <PID> # macOS/Linux
taskkill /PID <PID> /F # Windows
Or just use a different port — all the tools above accept a port argument. Common alternatives when 8000 is taken: 8001, 8888, 9000.
Related Ports
| Port | Common Use |
|---|---|
| 80 | HTTP (Apache, Nginx in production) |
| 3000 | Node.js / Express / Next.js |
| 5173 | Vite (React, Vue, Svelte) |
| 8080 | Tomcat, Vue CLI, Spring Boot |
| 9090 | Prometheus, Cockpit |