salesforce community with custom domain

Salesforce community with custom domain

Usually when we enable community in salesforce, the URL is generated by salesforce such as https://yourcompanyname.force.com. The URL is provided by Salesforce and has the salesforce branding as well. In some cases companies will need to use their custom URL such as https://community.yourcompany.com. Let’s see how that can be done. This includes various steps to be done, let’s see them below. Remember these steps should be done in a production org. Dev orgs should not be used for this.

Create a CA Signed Certificate

In your salesforce org, go to setup and find certificate and key management and click on “create CA signed certificate”.

certificate management salesforce community with custom domain

Fill up the certificate form and make sure you enter the domain name correctly in the common name field.

certificate management

if your community URL should be https://community.mycompany.com then fill up community.mycompany.com, so that you can get a SSL certificate for this subdomain. Once this form is filled up you can download the certificate request and send the details to the signing authority. Once the CA signed the certificate, come back to this page and upload the .crt file here. This certificate will be later used for configuring the domain in next steps.

Domain Creation

Login to your salesforce org. Go to setup and find Domain.

community setup in salesforce salesforce community with custom domain

Click on Add a Domain to see the below screen:

new domain : salesforce community with custom domain

Give any name to the Domain as you like. Click on the browse icon on the next field to select the  Certificate we just created in previous step.

Configuration on your domain provider

Login to your domain provider and setup the DNS zone. Different providers have different setting options so check your providers site to get the Zone Editor. Once you have the editor fill the information as below.

Hosting provider

The Name should be your community url you want. in this example the value for name will be “community.mycompany.com” ,
TTL = 14400 ,
Type = CNAME ,
Address should be the url you have seen in the domain setup page in salesforce. in our example it should be :
community.mycompany.com..live.siteforce.com

In Salesforce

After these are all done, let’s setup the url to be used for our community. Go to the Domain menu under setup and click on the domain we created in the above step. You should see “New custom URL” button:

    • click New Custom URL
    • Select your domain via the lookup icon
    • For the path, that should typically be “/”, unless you want your community to live on domain.com/community
    • For the Site field, click the lookup icon and select your Lightning Community
    • Then click Save

If all okay you should be able to see the below screen when you click on the domain you just setup. It should open your custom domain with the community.

Salesforce community with custom domain

Conclusion

I hope this helps someone in need of this information: salesforce community with custom domain. If you need any help on this please contact using the comment box. Keep reading and sharing..


Comments

7 responses to “salesforce community with custom domain”

  1. Hi Amit,
    Is there any way we can automate the above using code/API?
    We have a use case where for every new customer who signs up, we want to create a custom domain and URL which has their company name in the community URL.

    Thanks,
    Sneha

    1. Amit Sahu Avatar
      Amit Sahu

      Hi Sneha, Thanks for reaching out you cannot have different domains in one salesforce and salesforce has not provided API for creating domains yet. So, this will not be possible at this time.

      Thanks,
      Amit

  2. Ok, thanks Amit.

  3. Hi Amit,

    I created domain and subdomain from free sites such as freenom, does that mean i have to opt for 3rd option i,e. A non-Salesforce host or service serves this domain over HTTPS?

    I am using that option and was able to create domain and custom url in salesforce, however the new url shows me site cannot be reached error.What could be possibly wrong?

    1. Amit Sahu Avatar
      Amit Sahu

      You may not have the DNS entries for the free domain. Did you add the Salesforce DNS values in the domain?

  4. Hi Amit,
    Good Evening,
    Error: Salesforce.com can’t validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you. Make sure the domain name xyz.com uses xyz.com.******.live.siteforce.com as its CNAME target and try again later.

    Is there any process to be follow for this?

    1. Amit Sahu Avatar
      Amit Sahu

      Did you add the CNAME correctly? If yes , sometime it takes the domain provider to propagate the records across all the servers. It may work in 30-40 min. Just wait and try..

Leave a Reply

Your email address will not be published. Required fields are marked *