AIO Update to Nextcloud AIO v13.1.0 downgrades Let's Encrypt certificates to one week

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 26 Winter (33.0.3)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • None
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • Today
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Nextcloud AIO v13.1.0
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

After updating Nextcloud AIO containers, the cert is only 7 days valid.

Active Containers:

Is it possible to get the old Let’s encrypt certificate runtime back?
I know that they will reduce the runtime later. But cert troubles every week is bad.

Thanks

Thomas

Works as designed:

You automatically should renew the certificate weekly.

But six day certs are optional for now.

Can i change the request somewhere?

If automatic renewal is working properly, there shouldn’t be any issues with the certificate every week, right? Is this just a concern of yours, or are you actually having problems with automatic renewal? If the latter is the case, wouldn’t it be better trying to fix the root cause?

It’s set here: all-in-one/Containers/apache/Caddyfile at 32a0b97ce395bfae87a4778fe9e44e7a3fdd49f9 · nextcloud/all-in-one · GitHub

However, if you change this in the container, it will most likely be overwritten during the next update, so it would be better to use your own reverse proxy in front of AIO and manage the certificates with that. all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub

But again, the best solution is to ensure that automatic renewal works properly, because then it won’t matter how long or short the validity period of the certificates actually is. :wink:

I never read all all possible solutions on Letsencrypt-site. It surely might be possible to retrieve a certificate with a longer renewal range.

As @bb77 mentioned above, you might get into trouble, if you do manual settings, which might be overwritten at next upgrade.

The background is, that Letsencrypt changes the period of validity step by step due to more security generally. So, we should follow that guideline.

I somewhere read at the beginning of this year, that Google will force to decrase the validity range of SSL certificates down to one week in the future.

Yes, but not because of Let’s Encrypt or Caddy. Both still have a default validity period of 90 days and an automatic renewal period of 60 days. This has been explicitly configured this way in AIO. However, if you remove the relevant line from the Caddyfile, it will be re-added when you recreate the container.

I guess in theory, @szaimen could add a variable for this, which could then be passed to the container as an environment variable when it is started. However, I don’t think that it would be worth the effort, because if automatic renewal works properly, short lived certs aren’t an issue, and i you need different settings for whatever reason, or different challenge methods, or want to use a different certificate authority to Let’s Encrypt etc, you would need to use your own reverse proxy anyway.

Yes, absolutely. Automation will be inevitable sooner or later, because manual renewal, regardless of the CA, will no longer be feasible. So it’s better to make sure now that you have proper automation in place. :wink:

But somehow i don’t understand that such a change is not even mentioned in the release notes … at least i could not find anything to it …

It’s mentioned here: Release v13.0.3 · nextcloud/all-in-one · GitHub
(second bullet point under “New features and other improvements”

But what I’m curious about is why this is even an issue in the first place?

Well, if for example one has GeoIP blocking activated or does not want to keep open port 80 all the time … Opening the port and GeoIP once every 2-3 months is not the same as opening them every 6 days. With 6 days one is “forced” to deactivate such firewall rules.

The “fix” for another problem is interfering with the Let’s Encrypt policy.
Some very small Nextcloud installations are under permanent attack. The simple solution is a geo-filter in the firewall.
If we disable the filter, the attacks will start again soon. Nextcloud is just busy delivering the login page ten times per second. We use scheduled firewall rules to allow cert update after nextcloud backup. But timing is difficult and it works not very well.

Sure, lets wrap another virtual machine around the nextcloud, waste another gigabyte of ram.
Or just add some script lines like “if folder contains pfx file, use this, and skip Let’s encrypt”.
But i am just a user. Don’t know if this is possible at all.

Letsencrypt allows renewal without usage of port 80 but by using a txt-entry in DNS of your provider/DynDNS-provider. You will find more information about that in the Letsencrypt documentation.

That means you serve the login page on port 80? I guess one simple way would be to just allow /.well-known/acme-challenge/ and block anything else?

There’s also (again) one for TLS on 443 and one permanent dns one.

If i change the challenge in nextcloud AIO, it will overwrite my change at next update?

DNS-PERSIST-01 sounds like a cool solution. Is it possible to use this in AIO?

As far as I know, AIO itself only supports the TLS ALPN-01 challenge via port 443, and there, there are no user-configurable options for TLS.

As I said earlier, if you want to use other challenge methods or customise anything related to TLS, you need to add a separate reverse proxy: https://github.com/nextcloud/all-in-one/blob/main/local-instance.md.

By the way, the reverse proxy can run on the same machine as AIO, so there is no need for another virtual machine or even separate hardware: all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub

A few more thoughts on using a separate reverse proxy: all things considered, this is the most flexible approach. In theory, you could even use a Certbot HTTP challenge on port 80 without having to disable GeoBlocking for AIO.

For example:

  • The reverse proxy listens only on port 443 and is protected by GeoBlocking.
  • Certbot uses an HTTP challenge on port 80, which is not GeoBlocked.

In that setup, requests to port 80 would normally go nowhere, because Certbot only spins up a small temporary web server when requesting or renewing a certificate and shuts it down again afterward.

That’s just one option among many. If you don’t want to expose anything to the internet at all, you can use one of the DNS challenge methods instead.

Alternatively, you could open a feature request on the AIO GitHub and ask for these capabilities to be integrated directly into AIO and/or for the “short-lived” certificate option to become configurable. Whether that would actually get implemented is another question.

That said, as I mentioned before, the latter only makes limited sense. By 2029, even “long-lived” certificates will only be valid for a maximum of 47 days. In practice, this means renewing certificates every 30 days, which, in my opinion, is not really suitable for building manual processes around it anymore.

And let’s be honest: manually maintaining certificates was never a good solution, not even back when certificates could be valid for three years. People forget, certificates expire, services go down, and everyone has a bad day. Automation is simply the better approach, and once you have implemented it, you may as well use short-lived certificates and benefit from the increased security they provide.

Hi, just FYI: we are going to adjust things with caddy: re-introduce lets encrypt profiles by szaimen · Pull Request #8237 · nextcloud/all-in-one · GitHub

Also connected calendars like on a mobile phone no need to be accepted every 6 days … Not really what people want to be busy with …

No, why?

Provided the certificate is automatically renewed and the domain name doesn’t change, there’s no need to reconfirm anything. My calendars on my phone have been synced with Nextcloud for years and I’ve never had to confirm anything after the certificates on the server were renewed.

Just for clarification regarding port 80, since my previous post may have been a bit confusing:

In its default configuration, Nextcloud AIO only requires port 443 to be reachable from the internet. Simply forward port 443, and AIO will automatically obtain and renew certificates using the TLS-ALPN-01 challenge. You don’t need to do anything manually, either on the server or on the clients. In practice, you won’t notice any difference whether certificates are renewed every 60 days, every week, or every day. It just works.

If you’re using a reverse proxy in front of AIO because you’re exposing additional services, then it depends on the reverse proxy and which ACME challenge method it uses. For example, Caddy uses the HTTP challenge by default and therefore requires port 80.

However, that’s generally not a problem, and you don’t really gain any additional security by keeping port 80 closed and only opening it temporarily for certificate renewals. By default, port 80 is simply configured to redirect HTTP traffic to HTTPS. Here’s an example from my Caddy instance with the default configuration:

curl -I http://cloud.domain.tld

HTTP/1.1 308 Permanent Redirect
Connection: close
Location: https://cloud.domain.tld/
Server: Caddy
Date: Thu, 04 Jun 2026 08:17:24 GMT

So, in practice, you gain virtually nothing by manually opening and closing port 80 just for certificate renewals. What you do gain is the risk of forgetting to do it in time, causing your certificates to expire and your services to stop working. :wink: