There is more to it than just port 80 access, you also want the fullchain in the right place, restart services after renewal, and so on.
Unit-file:
[Unit]
Description=Certbot/Letsencrypt certificate renewal
ConditionPathExists=/usr/bin/certbot
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --pre-hook "service nginx stop" --deploy-hook /usr/share/grommunio-setup/grommunio-certbot-renew-hook --post-hook "service nginx start"
deploy-hook:
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2021 grommunio GmbH
openssl x509 -in "$RENEWED_LINEAGE/chain.pem" -out "$RENEWED_LINEAGE/chain-first.pem"
cat "$RENEWED_LINEAGE/cert.pem" "$RENEWED_LINEAGE/chain-first.pem" > "/etc/grommunio-common/ssl/server-bundle.pem"
cp "$RENEWED_LINEAGE/privkey.pem" "/etc/grommunio-common/ssl/server.key"
find /etc/grommunio-common/ssl/ -type f -exec chown -h gromox:gromox {} +
systemctl restart postfix gromox-http gromox-imap gromox-pop3 gromox-delivery-queue