Affected versions: Debian 13

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Web service fails to start because port 80 or 443 is already in use.

Environment & Reproduction

Common when multiple web stacks are installed or stale services linger.

cat /etc/os-release
systemctl status apache2 nginx --no-pager
ss -ltnp | grep -E ':80|:443'

Root Cause Analysis

Another process binds required listener ports before intended web server starts.

Quick Triage

Identify owning process and associated service unit.

sudo lsof -iTCP:80 -sTCP:LISTEN -n -P
sudo lsof -iTCP:443 -sTCP:LISTEN -n -P

Step-by-Step Diagnosis

Inspect virtual host and listener config for overlapping bindings.

grep -RE '^Listen|listen ' /etc/apache2 /etc/nginx
sudo apachectl -t
sudo nginx -t
Illustrative mockup for debian-13 — terminal_or_shell
Diagnostic output for web/port-conflict — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Disable conflicting service and restart the intended web daemon.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo systemctl disable --now nginx || true
sudo systemctl restart apache2
# or disable apache2 and restart nginx based on target stack
Illustrative mockup for debian-13 — log_or_console
Resolution output for web/port-conflict — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Move one service to alternate ports and front with reverse proxy.

sudoedit /etc/nginx/sites-available/default
# set listen 8080; then restart nginx

Verification & Acceptance Criteria

Target server owns required ports and serves expected responses.

ss -ltnp | grep -E ':80|:443'
curl -I http://localhost

Rollback Plan

Restore previous service enablement states if new routing fails.

sudo systemctl enable --now nginx apache2

Prevention & Hardening

Document service ownership for edge ports and enforce config checks in CI.

systemctl list-unit-files | grep -E 'apache2|nginx'

Related messages include address already in use and failed to bind socket.

Related tutorial: View the step-by-step tutorial for Debian 13.

View all Debian 13 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Debian Apache and Nginx administration documentation.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.