Creating a subdomain using virtualmin

Hi Folks. Is there a definitive tutorial/docs/guide for creating a sub domain in virtualmin?

webmin version - 2.001
virtualmin version - 7.3-1
Ubuntu Linux 22.04.1



Here is a very definitive and the very best tutorial:

Create a top level virtual server in Virtualmin and specify the subdomain in the field for domain name.

Then carry out all the remaining steps that you would to host a normal domain / top level domain on a Virtualmin server.

The end.

1 Like

And, to expand on calport’s correct response: There is no such thing as a cPanel-style “subdomain” in Virtualmin. A subdomain is a name.

If you want your subdomain-named website to be owned by an existing domain and live within the home directory of that existing domain, then make it a subserver. If you do not want your subdomain-named website to be owned by an existing domain, make it a virtual server (a top-level server or domain).

Sub-servers are about ownership and ownership only (they can have all the usual features of a top-level server), and they can be named anything, including a subdomain name (of an existing domain name or one not already hosted on the server, it does not matter, it’s just a name).

Thanks for the replies guys. I will mull through this.

I have the sub domain/server working, except for the lets encrypt SSL cert which displays the following when requesting a new cert for the subserver:-

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for and

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for - check that a DNS record exists for this domain

Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.

Some challenges have failed.
Ask for help or search for solutions at See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

I found this in the lets encrypt log file:-
Hint: The Certificate Authority failed to verify the DNS TXT records created by the --manual-auth-hook. Ensure that this hook is functioning correctly and that it waits a sufficient duration of time for DNS propagation. Refer to “certbot --help manual” and the Certbot User Guide.

I dont find any TXT records in the top level or subserver. Please excuse my ignorance. I decided to learn more about the Server setup side and believe this is the way to do it?

Have I set the sub server up incorrectly that the DNS records are not being found. The A record is there, but not the TXT.

You didn’t create a record for If you want to get a certificate for it, it needs to have an A record in your DNS.

Since Virtualmin is obviously not managing your DNS records, you definitely need web validation to work (all that stuff about DNS validation is irrelevant to you…don’t skip over the web validation errors and go straight to the DNS validation errors, the stuff about TXT records, because web validation is all that can ever work for you!).

Don’t request certificates for names that don’t exist is what I’m trying to say.

Also, please make new topics for new issues. This is not the same problem as the title of your topic, so it’s time for a new topic. If you want to follow up, please make a new topic about Let’s Encrypt errors, but I think if you search for the errors you’re seeing, you’ll find many people with the same problems, and there are only three reasons validation fails and the solutions are always the same and have been discussed at length.

Thanks Joe. Will do

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