Question

LetsEncrypt SSL cert for subdomain only

Posted March 10, 2021 1k views
Let's Encrypt

The nameserver for my base domain is Google, which I’d like to keep to handle my product website & email. I’ve added the DigitalOcean NS entries for my subdomain app. This all resolves fine.

However, I’m trying to create an SSL cert in the DO panel, and it fails to recognize my subdomain (app.domain.com) for the cert without using the primary domain (domain.com) which won’t work because it’s on Google.

Is there a way to create a cert in DO panel for just a subdomain or will I need to create one manually?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @kdumont,

If you are using a standard Droplet, you should be able to install certbot from inside of it.

How does it work?

  • Point the subdomain’s A record to your Droplet
  • SSH to your Droplet
  • Make sure you have a WebService like Nginx or Apache

Nginx
To install certbot and it’s Nginx plugin you can execute the following command on your Droplet:

sudo apt install certbot python3-certbot-nginx

Apache

To install certbot and it’s Apache plugin you can execute the following command on your Droplet:

sudo apt install certbot python3-certbot-apache
  • Obtaining an SSL Certificate

Certbot provides a variety of ways to obtain SSL certificates through plugins. The Nginx plugin will take care of reconfiguring Nginx and reloading the config whenever necessary. To use this plugin, type the following:

Nginx

sudo certbot --nginx -d example.com -d www.example.com

Apache

certbot --apache

That should be it.

Regards,
KFSys