automatically create/add multiple sub-server

I would like to automatically create/add multiple sub-server from a list. Is this posible in the GPL version? Is there a module or maybe someone has written a script that can do this?

I want to add handful of domains as aliases to an already existing server, but I would like to save some time. I would like to be able to either have a script or a module read a text file containing the domains or maybe paste them in a text box in a module and then let it go to work. It will follow the exact same process for creating a single sub-servers, only difference is that instead stopping after the sub-server has been created, it will restart the process for the domain next on the list, until the end of the list.

Months ago I read something about being able to do this in Virtualmin, but I can’t remember if it was on the forums or somewhere else, and if it was a GPL, PRO or independent module feature. I have tried different searches here, but they haven’t been very productive.


I don’t know a way to do it within the Virtualmin web GUI (the Pro version does have a “batch import” option, however).

You may be able to do what you need from the command line. They recently began including all the command line tools in the GPL version, and there’s some things there that I think will help.

They’re all documented here:,command_line_api/

But specifically, this one creates Virtual Servers:,virtualmin_api_create_domain/

And from there, you could do some scripting on your own to read your data from a file, and pass it to the Virtualmin script.

Awesome. Thank you Eric.

Thinking about it, I might have read about this in the new release announcements.

Let say I want to create a sub-server of type alias, where maindom.tld is the main domain and aliassubdom.tld is the alias of maindom.tld. I also want the applicable server configuration template to be domaliasplan and the external IP address to be "Same as real address".

Would the following be the correct command line:

[code:1]virtualmin create-domain --alias aliassubdom.tld --paren maindom.tld --template domaliasplan --dns --web[/code:1]

I figured it out

The correct command would be:

[code:1]virtualmin create-domain --domain aliassubdom.tld --alias maindom.tld --template domaliasplan --dns --web[/code:1]

–domain being the domain I want to add and --alias is the target domain/the main/parent domain to be aliased by the domain I am adding.