Table of Contents

Digital Ocean DNS-01 challange

Brief notes on how to setup a lets encrypt cert bot using digital oscean as dns provider.

Configure DNS at domain registrar

Create an API Token

Setup the certbot

Install certbot

    sudo snap install --classic certbot
    sudo snap set certbot trust-plugin-with-root=ok

Install Digital Ocean Plugin

    sudo snap install certbot-dns-digitalocean

Create credentials file

    sudo nano /etc/letsencrypt/digitalocean.ini
    dns_digitalocean_token = PASTE_TOKEN_HERE

Secure credentials file

    sudo chown root:root /etc/letsencrypt/digitalocean.ini
    sudo chmod 600 /etc/letsencrypt/digitalocean.ini

Activate certbot

Request certificate

    sudo certbot certonly --dns-digitalocean \
      --dns-digitalocean-credentials /etc/letsencrypt/digitalocean.ini \
      -d example.com -d int.example.com \
      --agree-tos --email you@example.com --non-interactive

Test renewal

    sudo certbot renew --dry-run

Avoid renewing certificates without the dry run flag as Let's encrypt has a cap of renewals/day.

Reload nginx

    sudo nginx -t && sudo systemctl reload nginx