Articles in this section

How to create a domain / subdomain / alias in Plesk

Plesk for Windows kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

  • How to add a domain / subdomain / alias using different methods?
  • How to create a website?

Answer

In Plesk interface

Note: Some resellers / customers may not see these options in their control panel due to permission limitations defined in service plan / subscription settings. Visit this KB article for details.

  • In Power User view:
    • Go to Websites & Domains and click Add Domain / Add Subdomain / Add Domain Alias.
  • In Service Provider view:

    Note: To create a domain for a customer / reseller, go to Customers or Resellers > <customer / reseller_name> > Add Domain.

    • Domain

      Go to Domains and click Add Domain.
      In this way, creating a domain will also create a new subscription. This domain will be the main domain of this subscription.

      Go to Subscriptions > example.com and click Add Domain.
      In this way, a new domain will be created inside an existing subscription as an additional domain.

    • Subdomain

      Go to Domains and click Add Subdomain.

    • Domain Alias

      Go to Domains and click Add Domain Alias.


    Screenshot_2019-02-08_Domains_-_Plesk_Onyx_17_8_11.png
     

In a command-line interface
  • Domain
    • To create a domain with a new subscription, use the plesk bin subscription utility. To learn more about this utility and its options, go to its documentation page - subscription for Linux / subscription.exe for Windows Server.

      Run the following command to show the help page:

      # plesk bin subscription --help

      Example
      The following command creates the domain example.com and a subscription of the same name for the Plesk customer John Doe whose login is john_doe, associated with the service plan Default Domain, assigned to the IP address 203.0.113.2, with the system user john and the password password:

      # plesk bin subscription --create example.com -owner john_doe -service-plan "Default Domain" -ip 203.0.113.2 -login john_doe -passwd "password"

    • To create an additional domain within a subscription, use the plesk bin site utility. To learn more about this utility and its options, go to its documentation page - site for Linux / site.exe for Windows Server.

      Run the following command to show the help page:

      # plesk bin site --help

      Example
      The following command creates the additional domain example.net under the subscription example.com with document root directory /example.net (Full path /var/www/vhosts/example.com/example.net):

      # plesk bin site --create example.net -webspace-name example.com -www-root /example.net

 

  • Subdomain

    To create a subdomain, use the plesk bin subdomain utility. To learn more about this utility and its options, go to its documentation page - subdomain for Linux / subdomain.exe for Windows Server.

    Run the following command to show the help page:

    # plesk bin subdomain --help

    Example
    The following command creates the new subdomain subdomain.example.com for the main domain example.com with document root directory /subdomain.example.com (Full path /var/www/vhosts/example.com/subdomain.example.com):

    # plesk bin subdomain --create sub -domain example.com -www-root /subdomain.example.com

 

  • Domain alias

    To create a domain alias, use the plesk bin domalias utility. To learn more about this utility and its options, go to its documentation page - domalias for Linux / domalias.exe for Windows Server.

    Run the following command to show the help page:

    # plesk bin domalias --help

    Example
    The following command creates the domain alias example.net for the domain example.com with default settings:

    # plesk bin domalias --create example.net -domain example.com

Using Plesk XML API
  • Domain

    To learn how to create to create domains with a new subscription using Plesk XML API, visit this documentation page:

    Example
    The following command creates the domain example.com and a subscription of the same name, assigned to the IP address 203.0.113.2, with the system user john and the password password:

    CONFIG_TEXT: <packet>
      <webspace>
        <add>
          <gen_setup>
            <name>sample.com</name>
            <ip_address>203.0.113.2</ip_address>
          </gen_setup>
          <hosting>
            <vrt_hst>
              <property>
                <name>ftp_login</name>
                <value>john_doe</value>
              </property>
              <property>
                <name>ftp_password</name>
                <value>password</value>
              </property>
              <ip_address>203.0.113.2</ip_address>
            </vrt_hst>
          </hosting>
        </add>
      </webspace>
    </packet>

     

    To learn how to create additional domains withing a subscription using Plesk XML API, visit this documentation page:

    The following command creates the additional domain example.net under the subscription example.com, id of which is 3, with document root directory /example.net (Full path /var/www/vhosts/example.com/example.net):

    CONFIG_TEXT: <packet>
      <site>
        <add>
          <gen_setup>
            <name>example.org</name>
            <webspace-id>3</webspace-id>
          </gen_setup>
          <hosting>
            <vrt_hst>
              <property>
                <name>www_root</name>
                <value>/example.net</value>
              </property>
            </vrt_hst>
          </hosting>
        </add>
      </site>
    </packet>

     

  • Subdomain

    To learn how to create subdomains using Plesk XML API, visit this documentation page:

    Example
    The following command creates the new subdomain subdomain.example.com for the main domain example.com with document root directory /subdomain.example.com (Full path /var/www/vhosts/example.com/subdomain.example.com):

    CONFIG_TEXT: <packet>
      <subdomain>
        <add>
          <parent>example.com</parent>
          <name>subdomain</name>
          <property>
            <name>www_root</name>
            <value>/subdomain.example.com</value>
          </property>
        </add>
      </subdomain>
    </packet>

     

  • Domain Alias 

    To learn how to create domain alias using Plesk XML API, visit this documentation page:

    Example
    The following command creates the domain alias example.net for the domain example.com, id of which is 3, with default settings:

    CONFIG_TEXT: <packet>
      <site-alias>
        <create>
          <site-id>3</site-id>
          <name>example.net</name>
        </create>
      </site-alias>
    </packet>

 

Additional information

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.