Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Certificate Rotation

If you have set up the Expose Immich to the internet optional extra, you will need to periodically renew the TLS server certificate. Tailscale Let’s Encrypt certificates expire every 90 days. An expired certificate will cause browsers and the Immich app to report an insecure connection.

Renew the server certificate

Run the following commands on the Raspberry Pi to fetch a fresh certificate from Tailscale and restart Caddy.

export CERT_DIR="/var/lib/certs"
sudo tailscale cert \
  --cert-file $CERT_DIR/cert.pem \
  --key-file $CERT_DIR/key.pem \
  $(tailscale status --json | jq -r '.Self.DNSName' | sed 's/\.$//')
sudo chown -R caddy:caddy $CERT_DIR
sudo systemctl restart caddy

Tip

If you are unsure whether the certificate has expired, you can check the expiry date with:

openssl x509 -enddate -noout -in /var/lib/certs/cert.pem

Renew a client mTLS certificate

mTLS client certificates generated by gen-mtls-certs are valid for 365 days. If a trusted device loses access after roughly a year, regenerate its certificate and reinstall it.

sudo gen-mtls-certs --client-name <client-name>

Then reinstall the new .p12 bundle on the device by following the steps in Install mTLS certs on your devices.