What uses port 9418
The git:// protocol, served by git daemon, offers fast read-only access without authentication or encryption. GitHub turned it off in 2022, and most hosts now offer only HTTPS (443) and SSH (22). It is still used for some public mirrors.
Should port 9418 be open to the internet?
Meant to be public. This port is meant to be reachable by clients on the internet when you run this service publicly.
Check what is listening on port 9418
sudo ss -ltnp 'sport = :9418'
sudo lsof -nP -iTCP:9418 -sTCP:LISTEN
Get-NetTCPConnection -LocalPort 9418 -State Listen
netstat -ano | findstr :9418
No output means nothing is listening. If a service should be, check that it is running and which address it binds to: 127.0.0.1 only accepts local connections, 0.0.0.0 or :: accepts them on every interface.
Fix “address already in use” on port 9418
Another process already holds the port. Find it with the commands above, then stop that service properly, or end the process:
sudo kill $(sudo lsof -t -iTCP:9418 -sTCP:LISTEN)
Stop-Process -Id (Get-NetTCPConnection -LocalPort 9418 -State Listen).OwningProcess
Open port 9418 in the firewall
sudo ufw allow 9418/tcp
# Close it again:
sudo ufw delete allow 9418/tcp
sudo firewall-cmd --permanent --add-port=9418/tcp
sudo firewall-cmd --reload
New-NetFirewallRule -DisplayName "Git protocol 9418/TCP" -Direction Inbound -Protocol TCP -LocalPort 9418 -Action Allow
On AWS, Google Cloud and Azure, also allow the port in the security group or network firewall rules; host firewalls and cloud firewalls are separate.
Test port 9418 from another machine
nc -zv example.com 9418
Test-NetConnection example.com -Port 9418
Related ports
- Port 22 (SSH): used by SSH for secure remote logins, SFTP, SCP and Git over SSH.
- Port 443 (HTTPS): the default port for HTTPS, encrypted web traffic.
- Port 2222 (SSH (alternate)): a common alternate port for SSH.
More development servers ports
3000 (Development server / Grafana) , 4200 (Angular dev server) , 5000 (Flask / development servers) , 5173 (Vite dev server) , 8000 (Development server (Django, Python)) , 8888 (Jupyter) , 9000 (PHP-FPM / MinIO / SonarQube) . See all ports in the port lookup.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What is port 9418 used for?
Port 9418 is used by the native git:// protocol. The git:// protocol, served by git daemon, offers fast read-only access without authentication or encryption. GitHub turned it off in 2022, and most hosts now offer only HTTPS (443) and SSH (22). It is still used for some public mirrors.
Is it safe to open port 9418?
This port is meant to be reachable by clients on the internet when you run this service publicly. Keep the service behind it up to date and require authentication where it applies.
How do I check if port 9418 is open?
On the server, list listening sockets with "sudo ss -ltnp 'sport = :9418'" on Linux or "sudo lsof -nP -i :9418" on macOS. From another machine, run "nc -zv host 9418" or, on Windows, "Test-NetConnection host -Port 9418". Connection refused means nothing is listening; a timeout means a firewall is dropping the traffic.