Hello Team,
I am experiencing an issue with the Certbot Apache plugin and would like to confirm whether this is a known limitation or an unintended bug.
My domain is:
domain1.example.com
domain2.example.com
domain3.example.com
I ran this command:
certbot --apache -d domain1.example.com
certbot --apache -d domain2.example.com
It produced this output:
Certificate successfully received.
Certificate is saved at:
/etc/letsencrypt/live/domain1.example.com/fullchain.pem
Deploying Certificate to VirtualHost /etc/apache2/sites-enabled/domain1-le-ssl.conf
Congratulations! You have successfully enabled HTTPS.
The command completes successfully with no errors.
My web server is (include version):
Apache/2.4.x
The operating system my web server runs on is (include version):
Ubuntu 22.04 LTS
My hosting provider, if applicable, is:
Self-managed VPS / Cloud VM
I can login to a root shell on my machine:
Yes
I'm using a control panel to manage my site:
No (manual Apache configuration)
The version of my client is:
certbot 5.x.x (installed via snap)
Apache Configuration (HTTP only)
I have multiple HTTP VirtualHosts defined in a single file:
File:
/etc/apache2/sites-available/multi-vhost.conf
<VirtualHost *:80>
ServerName domain1.example.com
DocumentRoot /var/www/domain1
<Directory /var/www/domain1>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain1-error.log
CustomLog ${APACHE_LOG_DIR}/domain1-access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName domain2.example.com
DocumentRoot /var/www/domain2
<Directory /var/www/domain2>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain2-error.log
CustomLog ${APACHE_LOG_DIR}/domain2-access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName domain3.example.com
DocumentRoot /var/www/domain3
<Directory /var/www/domain3>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain3-error.log
CustomLog ${APACHE_LOG_DIR}/domain3-access.log combined
</VirtualHost>
All domains work correctly over HTTP (port 80).
Unexpected Behavior with Certbot
Step 1 – First certificate
certbot --apache -d domain1.example.com
Certbot creates a new SSL VirtualHost correctly
SSL works for domain1.example.com
Step 2 – Second certificate
certbot --apache -d domain2.example.com
Certbot does not create a new SSL VirtualHost
It modifies or overwrites the existing SSL config for domain1
Port 80 vhosts are merged or moved into the same SSL file
Certificates are overwritten or shared unintentionally
Result
- SSL VirtualHosts are not isolated per domain
- Re-running Certbot affects previously installed certificates
- Apache configuration becomes inconsistent
Questions
- Is this a known limitation of the Certbot Apache plugin when multiple HTTP VirtualHosts are defined in one file?
- Is there any supported Certbot version or configuration that avoids this behavior?

