Just tried to deploy new salesforce custom site via Metadata API (ant tool) and also tried Eclipse but target org returns the following message:

The Force.com Site subdomain has not been set in the organization

enter image description here

I have modified Metadata and specified username and unique sub-domain name. Example of Custom Site metadata file is below:

Is it generally possible to create Force.com site via Metadata API - did not find any evidence in documentation.


Also can not find Force.com Site among unsupported components


  • Hi Yuri, You can definitely deploy a site via ant as per Salesforce documentation. Can you share the file you are trying to deploy? Commented Jul 14, 2015 at 23:11
  • 1
    It sounds like it's telling you that the subdomain needs to be configured in the Org before your can deploy the site. That's something which isn't part of the metadata and requires point & click configuration in the org itself first before you do your deployment. The site domain, etc has to exist for you to deploy to.
    – crmprogdev
    Commented Jul 14, 2015 at 23:38
  • @AmrIbrahim - the link to the example of site metadata file I am trying to deploy is below: gist.github.com/yury-vrp/9ccc5835a3879511b5d4#file-mysite-xml Commented Jul 15, 2015 at 13:06
  • @Yury Do you have your domain already setup? If not you might want to follow the format in this page Commented Jul 15, 2015 at 22:48
  • @AmrIbrahim No, I do not. The idea is to create a script that will preform full configuration of force.com site from command line (including domain registration). Isn't it possible to register domain via ant (Metadata)? Commented Jul 16, 2015 at 14:16

2 Answers 2


Do not find a way to register force.com site domain through Metadata API/Migration tool.

Most likely in order to be able to deploy Site configuration you need to register your force.com site sub-domain first, manually, through salesforce interface (see screenshot attached)

enter image description here


Using ant to get retrieve a site's metadata is useful even if you can't turn-around and use it for anything else.

It doesn't seem it can be used for creating a new site in a target org, and it doesn't appear to be a way to update an existing site with new values.

If anyone does figure out how to use it to update sites in multiple orgs (usually sandboxes), let me know.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .