Using non-standard ports with SSL

Nextcloud version: 27.1.7snap1
Operating system and version: Ubuntu 22.04

The issue you are facing:

I am running nextcloud and jellyfin on the same computer, and I am having some issues with the SSL certs. Jellyfin is running on ports 80 and 443, and uses lets encrypt to obtain a cert. Nextcloud is running on 81 and 444, but lets encrypt does not generate a cert because it non-standard ports.
Is there a way to have it use the same cert as jellyfin, or get it’s own cert?

Certificates are based only on the FQDN and not a used port. You can use a certificate on any port as long as the FQDN matches.

technically there is no difference which port your application use… but practically often only ports 80 and 443 are useable… additionally for letsencrypt (or other CA using ACME HTTP-01) you need make port 80 available… it doesn’t work with custom ports per definition. You could copy/share the cert aquired by Jellyfin and use it on another application… or better you do it right and install reverseproxy like traefik/caddy/apache /nginx in front of both applications. This way you can access both application through standard ports, reverse proxy can automatically gather letsencrypt tls certificates and you don’t need any special handling for your applications. see this very basic drawing for the general mechanics