Tài liệu tham khảo bạn có thể xem cụ thể tại Github.
1. Cấu hình firewall
Bạn cần mở port http trên firewall. Letsencrypt cần port http.

Trên centos:

firewall-cmd –zone=public –add-service=http –permanent
firewall-cmd –reload

Trên Ubuntu:

ufw allow 80/tcp
ufw allow 443/tcp

2. Cài đặt epel repo và git

Trên Centos:

#yum install epel-release git

Trên Ubuntu đã được cài đặt sẵn git.

3. Cài đặt certbot

Trên Centos, cài đặt từ epel repository.

# yum install certbot –enablerepo=epel

Trên Ubuntu, cài đặt sử dụng snap.

sudo snap install core; sudo snap refresh core

sudo snap install –classic certbot

sudo ln -s /snap/bin/certbot /usr/local/bin/certbot

4. Clone mã nguồn của letsencrypt-zimbra về
# git clone https://github.com/VojtechMyslivec/letsencrypt-zimbra.git /opt/letsencrypt-zimbra
5. Tạo file cấu hình và edit
#cp /opt/letsencrypt-zimbra/letsencrypt-zimbra.cfg{.example,}
Cấu hình email và tên common name trong /opt/letsencrypt-zimbra/letsencrypt-zimbra.cfg
email=zadmin@zimilab.com
common_names=( “mail.zimilab.com” “mail.zimbravn.com” )

#Thay đổi đường dẫn của certbot cho đúng với môi trường của bạn. Mặc định trong file cấu hình này là /usr/local/bin/certbot.

Bạn thay thế các thông số trên cho phù hợp với môi trường Zimbra cụ thể của bạn. Xem hướng dẫn trong file để biết thêm.
Letsencrypt không cấp wildcard cert nên bạn cần nhập từng common_names cụ thể.
6. Gán quyền sudo cho user zimbra để chạy lệnh
Copy file cấu hình sudo của zimbra
#cd /opt/letsencrypt-zimbra
#cp configs/sudoers.conf /etc/sudoers.d/zimbra_certbot

Edit file /etc/sudoers.d/zimbra_certbot, thay đổi đường dẫn certbot tương ứng với môi trường của bạn, mặc định trong script này là /usr/local/bin/certbot

Kiểm tra thử (sẽ không cần nhập password)
sudo -Hu zimbra sudo /usr/bin/certbot -h
7. Chạy script để lấy và cài cert.
Lần chạy đầu tiên, dùng option -t để test.
#sudo -Hiu zimbra /opt/letsencrypt-zimbra/obtain-and-deploy-letsencrypt-cert.sh -v -t
Letsencrypt có rate-limit nên ta dùng -t để test xem có lấy và cài cert ok không. Nếu ổn thì mới tiến hành cài.
Lần chạy thứ 2, bỏ option -t và thêm option –f (để cài đè lên cert đã tạo trong lần chạy trước).
#sudo -Hiu zimbra /opt/letsencrypt-zimbra/obtain-and-deploy-letsencrypt-cert.sh -v -f
8. Cấu hình cron job
#cp configs/cron.conf /etc/cron.d/letsencrypt-zimbra

Xem cấu hình file này để tùy chỉnh theo yêu cầu hệ thống nếu cần.