How to create individual certificates for subdomains (generic or a mix of Ngnix/Apache)


I´m quite new using Let´s Encrypt and I wonder how I can create individual certificates for each subdomains I´m using.

I do have a main domain name (I will name it “” in the sample) and multiples subdomains according my needs.

Main :
Sub1 :
Sub2 :
Sub3 :

I tried to create them but I made some mistake then I´ve been stuck and I had to wait until all the certificates expires. I would like to avoid such testing as you can imagine.

I tried searching but did not found something clear enough for me.

Is anyone able to help me ?

Each certificates will be loaded by NGNIX (used as pure reverse-proxy) and Apache (for majority of subdomains).

Thanks in advance for you help and advices.

With the vast majority of Let's Encrypt client software, including the recommended certbot client, you call the program once for each different certificate you want.

For instance, these three commands will obtain and install three certificates covering four different domain names:

# get one certificate for AND and install to nginx
sudo certbot -a webroot -i nginx -w /var/www/ -d,
# get a certificate for and install to Apache
sudo certbot -a webroot -i apache -w /var/www/ -d
# get a certificate for and install to Nginx
sudo certbot -a webroot -i nginx -w /var/www/ -d

While Let's Encrypt does have some rate limits you may have run into, the longest these last is one week, so you shouldn't have to wait months to try again.

When testing, pass the --dry-run option to certbot or the equivalent for the client you are using. This uses a special testing server known as the staging server which issues test certificates that are not trusted by browsers and has higher rate limits. This way you can test everything without running into limits, and when you have everything perfect you can remove --dry-run and get a real, trusted certificate.


Sorry for the double post, I missed this part and somehow got out of edit mode when I tried to quote you.

If you are running Apache and Nginx on the same server and reverse-proxying to Apache via Nginx, then you would only need to install a certificate into nginx.

If you are running Apache and Nginx on different servers, but still reverse-proxying to Apache via Nginx, you would still need to install a certificate into nginx. You may want to install a certificate into Apache as well if you do not trust the network that connects the two servers, so even the communication between Apache and Nginx is encrypted.

Of course, if Apache is running on a different server and listening directly and not proxied via Nginx then definitely install the certificate to it. :grinning:


Thanks you so much for your help.
I gonna try this and let you know !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.