前提
-
Let’s Encrypt で証明書取得済み
-
Route53 + AWSアクセスキー(certbot certonly --dns-route53)方式で取得している
この状況で証明書の自動更新をしたい
AWS 認証情報をセットする
sudo mkdir -p /root/.aws
sudo nano /root/.aws/credentials
ファイルの作成
[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY
region = ap-northeast-1
中身を記述
sudo chmod 600 /root/.aws/credentials
権限を強めておきましょう
sudo certbot renew --dry-run
上記を実行することで自動更新が完了します
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/[各ドメイン].conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Account registered.
Simulating renewal of an existing certificate for [各ドメイン]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/[各ドメイン]/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
このようなlogで成功です
systemctl list-timers | grep cert
ちゃんと進んでいるか時間を確認することが出来ます
Sun 2025-11-02 00:17:27 JST 6h Sat 2025-11-01 17:09:29 JST 52min ago certbot.timer certbot.service
読み方
| 表示 | 意味 |
|---|---|
Sun 2025-11-02 00:17:27 JST |
次に実行される日時 |
6h |
次の実行までの残り時間 |
Sat 2025-11-01 17:09:29 JST |
前回実行された日時 |
52min ago |
前回実行からの経過時間 |
certbot.timer |
実行スケジュールを司る systemd タイマー |
certbot.service |
実際に動く certbot の処理(更新コマンド) |