Use certbot on different port

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: stream.country-radio.eu

I ran this command:

It produced this output:

My web server is (include version): no web server

The operating system my web server runs on is (include version): Debian13.4

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 4.0.0

I have installed icecast and want it to use for port 80 and 443!
So I guess I can't use certbot own web server for port 80 and 443, because it would be create a port conflict. At least I think so.

Can I run the certbot web server on a different port?
Or how I have to solve my problem?
That should be a solution that certbot automatically renew the certificate!
Thanks for your help!

The request to validate will come in port 80. You can configure certbot's standalone challenge solver to listen on a different port (with the --http-01-port option), but you'd still need to forward requests for validation there from whatever's listening on port 80.

Some options for this sort of thing include:

  • Using a --pre-hook and --post-hook in Certbot to shut down the conflicting server while running Certbot in standalone mode, and then have it automatically start back up again. This does mean some downtime while certificates get renewed.
  • I don't know anything about Icecast, but if you can configure it to serve plain files out of a folder on the /.well-known path, you may be able to use Certbot's webroot mode instead of standalone
  • Instead of having Icecast directly on port 80/443, run a reverse proxy in front of it that handles securing it (as well as handling any other paths you want handled by other programs). This is probably the route I would recommend, using something like Caddy that will automatically handle the certificates and encryption. That way you don't need to use Certbot at all.
  • Using a DNS-01 challenge instead. This involves scripting the ability to update your DNS records so that Certbot can automatically configure them, but there are plugins available for a lot of common DNS providers to handle all that for you.

Icecast is a streaming media service so proxying in front takes special care. I know nginx can proxy streaming services and caddy probably can too. Just beware.

No [not externally]; but you might be able to use DNS-01 authentication to obtain a cert that way.

I'd put a web proxy on port 80; and have it proxy for icecast and certbot [and anything else that may need port 80 in the future].

And you might want to do the same for port 443 - not sure; as you haven't said why you need a cert, nor how you intend on using it.

You can also use the <fileserve> setting (Icecast Docs — Config File) and the <paths><webroot> setting (Icecast Docs — Config File) to serve static files from a directory.

Certbot can use this to complete the HTTP-01 challenge through the webroot plugin (User Guide — Certbot 5.10.0 documentation).

If you can configure it like that and use webroot, that would be the best way. Thanks for digging into the docs, Max!

And Icecast wants the cert and key in one file for ssl-certificate. A deploy hook like cat fullchain.pem privkey.pem > /etc/icecast2/bundle.pem plus an icecast restart saves doing it by hand every renewal.