4. Get SSL certificate using certbot

Install certbot

In home server terminal, install using brew.

brew install certbot

Install certbot AWS Route 53 plugin

The plugin can't be installed by brew. Use python.

$(brew --prefix certbot)/libexec/bin/python -mpip install certbot-dns-route53
circle-info

I found the install command in a following issue.

https://github.com/certbot/certbot/issues/5680arrow-up-right

Check AWS profile

The plugin use boto3, and it use aws profile in the mac server.

cd ~/.aws
cat config
cat credentials

Check if it shows [default] profile.

circle-info

At first, I didn't have default profile. I tried AWS_PROFILE, AWS_DEFAULT_PROFILE, etc. But they seemed not working. In the end, I put default profile then it worked.

The default profile credential have to have route53 related permissions.

Request certificate

I have hosted zone of ourcompanylunch.com.

After answering some question, I can get the certificate.

circle-info

I tried to do it without sudo. I had to manually add --config-dir, --work-dir, --logs-dir options. The command worked but I decided to go with sudo because it seems more recommended. I need to manually config options in renewal too.

Show certificate information

This shows certificate path and private key path. These will be used in nginx configuration.

Expire date is after 3 month. Renew is needed.

Last updated