Mark Ku's Blog

Notes on Auto-Issuing Let's Encrypt SSL Certificates with Certbot on Windows

The Problem

Let's Encrypt is a well-established, free SSL certificate service, but each certificate is only valid for three months. That means re-issuing manually every three months — which is tedious. With Certbot you can drive Let's Encrypt issuance via commands and scheduled tasks, fully automated.

Issuing a Certificate

Download and install Certbot

[Certbot installer download]

Open Command Prompt (or PowerShell) as Administrator. Switch to the directory C:\Program Files (x86)\Certbot\bin, or add it to your system PATH. Test Certbot:

certbot –-version
certbot -h

Run from PowerShell with admin privileges

certbot certonly --manual -m [email protected] -d *.letgo.com.tw 
certbot certonly --manual -m [email protected] -d *.markkulab.net

Copy the DNS TXT record provided by Certbot

Certbot command line output showing DNS TXT record for SSL certificate
Certbot command line output showing DNS TXT record for SSL certificate

Go to your DNS host's admin panel, add a TXT record, and paste in the value Certbot just gave you

Dialog for adding a DNS TXT record for Certbot challenge
Dialog for adding a DNS TXT record for Certbot challenge

Press Enter to continue, and the certificate will be generated under C:\Certbot\live

Certbot output confirming certificate saved paths in PowerShell
Certbot output confirming certificate saved paths in PowerShell

From here you can copy the cert to wherever it's needed.

Renewing a Certificate

Renewal command — certificates can only be renewed within 30 days of expiry. A single command lets Certbot renew automatically, but it seems only Nginx and Apache support fully automated renewal.

certbot renew

P.S. If the cert was just issued, this command will usually report "Cert not yet due for renewal" since it doesn't need renewing yet.

Test whether renewal works

certbot renew --dry-run

Later I wrote a script to manually fetch the cert and copy it to my FRP server

certbot certonly --manual -m [email protected] -d *.letgo.com.tw 
certbot certonly --manual -m [email protected] -d *.markkulab.net
NET USE X: \\192.168.50.52\Container\data
robocopy C:\Certbot\live X:\frpc /E
NET USE X: /delete

References

Reference 1 Reference 2

Author

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。Read More

Found this useful?

The author's free tools, daily podcasts and newsletter are all here.

Mark Ku · This article is licensed under CC BY 4.0. Credit the author and link back to the original when reusing it.

Comments

Subscribe to Newsletter

Subscribe to get new posts delivered instantly — never miss a tech share.

By submitting, you agree to receive emails. You can anytime.

Popular Posts

View all
Mark Ku
··602

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution
Mark Ku
··492

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.
Mark Ku
··334

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki
Mark Ku
··268

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning
Mark Ku
··218

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1
Mark Ku
··217

Setting Up Samba on Ubuntu to Share Folders with Windows 11

Setting Up Samba on Ubuntu to Share Folders with Windows 11