Skip to content

/errors/certbot/problem-binding-to-port-80

Certbot: Problem binding to port 80: Could not bind to IPv4 or IPv6

The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
tool
Certbot
exit code
1
versions
Certbot 1.x – 4.x
os
linux

certbot certonly --standalone starts a temporary web server on port 80 to answer the Let's Encrypt HTTP-01 challenge. If another program already listens on port 80, certbot stops with Problem binding to port 80: Could not bind to IPv4 or IPv6. Use a plugin that works with the running web server instead of fighting it for the port.

Find what holds port 80

bash
sudo ss -ltnp 'sport = :80'

Fix 1: webroot (server keeps running)

bash
sudo certbot certonly --webroot -w /var/www/html -d example.com -d www.example.com

The web server must serve http://example.com/.well-known/acme-challenge/ from that folder.

Fix 2: the nginx or Apache plugin

bash
sudo certbot --nginx -d example.com

Fix 3: keep standalone, stop the server during issuance

bash
sudo certbot certonly --standalone -d example.com \
  --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"

The hooks are saved in the renewal configuration, so automatic renewals stop and start the server too.

Sources