Hello.
I have a problem with obtaining a certificate. When executing the command: “certbot certonly --standalone -d mydomain.com”, the worm produces an error “Problem binding to port 80: Could not bind to IPv4 or IPv6.” Although the service on port 80 is open and you can go to the application server by the domain address. And the output of the command: “netstat -ln” indicates that the 80 port is occupied by the application.
The server is behind the router, there is no proxy or nginx.
Can you please stop the web server software and try run the server again? (Can't bind probably means there's already a web server software running, so stop your Apache or nginx or etc and try again)
That's your problem--if your application is listening on port 80, then certbot can't listen on that port, and therefore it can't run. You'll need to either stop that application (only while you're trying to obtain certs--so for a minute or so every couple of months), use DNS authentication, or set up a proxy in front of it so that /.well-known/acme-challenge is served by a web server.