PORT 25 / TCPEmail & MessagingExposure Risk: High
Port 25: SMTP — Simple Mail Transfer Protocol (Server-to-Server Relay)
Standard port for relaying email between mail servers (MTAs). Often blocked by cloud providers (AWS, GCP, DigitalOcean) to prevent spam.
Default Service
SMTP
Process: postfix / exim
Transport Protocol
TCP
IANA Registered Port 25
Docker Port Flag
-p 25:25
Container to Host Mapping
How to Check & Kill Process on Port 25 (EADDRINUSE Fix)
macOS & Linux (lsof / kill)
# Find process using port 25 sudo lsof -i :25 # Instantly kill process on port 25 lsof -ti:25 | xargs kill -9
Windows (PowerShell & CMD)
# Find PID listening on port 25 netstat -ano | findstr :25 # Force kill by PID taskkill /PID <PID_NUMBER> /F
Cross-Platform Node.js One-Liner
# Kill port 25 via npx npx kill-port 25 # Or diagnose via Castov CLI npx castov fix "EADDRINUSE :::25"
Linux Firewall (UFW) & Connectivity Test
# Test if port 25 is reachable nc -zv localhost 25 # Allow or deny port 25 in UFW sudo ufw allow 25/tcp
Frequently Asked Questions about Port 25
What is Port 25 used for?
Port 25 is the standard network port for SMTP (Simple Mail Transfer Protocol (Server-to-Server Relay)) operating over TCP. The typical system daemon or process is postfix / exim.
How do I kill a process running on Port 25 (EADDRINUSE)?
On macOS and Linux, run: lsof -ti:25 | xargs kill -9 (or npx kill-port 25). On Windows PowerShell/CMD, run: netstat -ano | findstr :25 and then taskkill /PID <PID> /F.
Is it safe to expose Port 25 to the internet?
Port 25 has a High security risk profile. Standard port for relaying email between mail servers (MTAs). Often blocked by cloud providers (AWS, GCP, DigitalOcean) to prevent spam.