How to create certification on where is not web server


Now, I’m trying to create certification on my mail server. I have gotten certifications on my web server already, but I want to have this on mail server as well. I mean, I want to enabled SSL connection for postfix mail server. However, I have gotten following error when I executed the command like ./certbot-auto certonly --standalone -d -m --agree-tos. *There are 2 servers like this.

  1. Web server ->Apache server is running and certbot-auto has been installed and there are certification files.
  2. mail server ->No web server is running, but certbot-auto has been installed. New certification is going to be installed, but I have gotten error.

The error messages are as follows.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for
Waiting for verification…
Challenge failed for domain
http-01 challenge for
Cleaning up challenges
Some challenges have failed.


My domain is:

Well, I need to run web server like apache on this host also? I just want to get commercial certification.

The version of my client is certbot 0.32.0.


Hi @bravo

there is a running webserver with a good http status 404 ( ):

Domainname Http-Status redirect Sec. G 301 0.547 A 200 8.017 N
Certificate error: RemoteCertificateNameMismatch 301 0.560 A
Visible Content: Moved Permanently The document has moved here . 404 7.376 N
Not Found
Certificate error: RemoteCertificateNameMismatch

So try to find the DocumentRoot / webroot of that vHost and use that:

certbot run certonly -a webroot -w yourDocumentRoot -d

You have a redirect http -> https, your https works. The certificate is wrong, but Letsencrypt ignores this error.

You don’t need two seperate certificates just because it’s two different services, you can make and use one certificate valid for both and

But in any case: yes, you need a webserver listening to, but it seems you already have (the two names seems resolve to the same IP, so it’s likely to be the same server) - alternatively you’ll have to use one of the other challenges, but as it looks like you have a webserver running at, configuring that seems like the easiest solution.

Hi, grove,
Thank you for your reply. You mean, I should take following steps?

  1. Since there are certifications on Web server (, I can use .pem files for mail server ( In this case, just copy them from web server to mail server.

Is this correct? Or I appreciate if you let me know how to do (procedure)


You have to create a new certificate with the correct domain name. Later, you can use the idea of @grove to create one certificate with both domain names.

But now there is no certificate with mail. - so you need a new certificate.

No, the certificate you have for the web server is only valid for, you can’t use that on a mail server adressed as I suppose you could change DNS for the domain to say that mail is handled by and then make sure it still ends up with the same software, then I guess it would work with the certificate you already have. But it’s likely easier (and more standard) to make a new certificate that include both names.

As an example you can look at the certificate I have on my main domain, that has six names on it (and I’ve considered adding another one when I have to renew it soon), one of which is the name ( that DNS says handles mail for the domain.

Hi, grove and JuergenAuer,

Thank you so much for your quick response. So it would be better to change the DNS record right? Do you have any clues how to change the records? I have added mail server and web sever IN A record separately.

Thank you!

No, it would not be better to change DNS. It would be better to configure your webserver/certbot to get a certificate for the name the mailserver currently has.

No, you don’t need to change your dns record.

Host T IP-Address is auth. ∑ Queries ∑ Timeout A yes 2 0
AAAA yes
Host T IP-Address is auth. ∑ Queries ∑ Timeout A yes 2 0
AAAA yes A yes 2 0
AAAA yes

Your www and your mail have the same ip address. So you can use the running webserver to create a certificate with mail … or (step later) one certificate with both domain names (www + mail).

Standalone creates an own webserver, so this is an interruption of your running webserver. You can use the webserver direct.

Hi Both.

Oh I see. So I will need to create certification for mail server on my Web server.
The command is the same as I did like certbot-auto certonly --standalone -d -m --agree-tos -n ?
After this, I need to copy certification files from web server to mail server correct?
This is because I need to indicate the directory of certification in postfix configuration files.


As written: Standalone stops your running webserver. And your first post says, that this command didn’t work. So switch to --webroot as authenticator.


I executed the command and now I can see the directory of There are .pem files are exist. I think it should be OK now… So the next step will be to copy all files to mail server right? In this case, I will need to copy the files whenever I renew the certifications.


  • Congratulations! Your certificate and chain have been saved at:
    Your key file has been saved at:
    Your cert will expire on 2019-06-07. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot-auto
    again. To non-interactively renew all of your certificates, run
    “certbot-auto renew”

  • If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let’s Encrypt:
    Donating to EFF:


1 Like

Happy to read that you have created a new certificate :wink:

Yep, you have to do that.

But you can create a deploy-hook script, that is executed after creating a new certificate.


Thank you so much for your support. I have setup postfix with SSL, but I still get the warning message like “internet security warning” when I start outlook up every time. I installed certification once, but I still get this pop-up window. I can confirm that the certification is provided letsencrypt. I have copied fullchan1.pem and privkey1.pem from “archive” directory.


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