Enable My Domain in Your Development Org

For security purposes, Lightning components require you to define a custom Salesforce domain name for your org. Setting up a new domain is simple, but it takes a few minutes before it’s available for use. When you enable My Domain, references and links to Lightning resources are in the format https://yourDomain.lightning.force.com. Use a Developer Edition org for this exercise.

Force.com IDE is in a maintenance-only state. We still provide support for the product through our official channels, but updates prior to October 12, 2019 will be only for critical security issues that arise. On October 12, 2019, we will no longer provide support or updates of any kind for Force.com IDE. On that date, we will also begin archiving documentation and removing download links for the product. We recommend that you start migrating to Salesforce Extensions for Visual Studio Code or one of the great tools made by our partners. For more information, see The Future of Salesforce IDEs on the Salesforce Developers Blog.

Warning

Enable My Domain in Your Org

Before we get to the heart of creating Lightning components, let’s use Salesforce My Domain to set up a subdomain. Is setting a My Domain a requirement? Yes, if you want to use Lightning components in Lightning tabs, Lightning pages, or as standalone apps. Salesforce requires My Domain as a security measure to help prevent malicious attacks—just in case a security hole lies hidden deep within a third-party or custom component.

Force.com IDE is in a maintenance-only state. We still provide support for the product through our official channels, but updates prior to October 12, 2019 will be only for critical security issues that arise. On October 12, 2019, we will no longer provide support or updates of any kind for Force.com IDE. On that date, we will also begin archiving documentation and removing download links for the product. We recommend that you start migrating to Salesforce Extensions for Visual Studio Code or one of the great tools made by our partners. For more information, see The Future of Salesforce IDEs on the Salesforce Developers Blog.

Warning

If you already have My Domain enabled in your DE org or use a Trailhead Playground org, skip this section and the next one. You already have My Domain set up.

If you don’t have a subdomain yet, it’s easy to set one up.

Every Salesforce org is set up within the salesforce.com domain with a URL like https://na30.salesforce.com. With My Domain, you define your own domain, or a subdomain, within the salesforce.com domain. Your new URL looks something like: https://yourDomain.my.salesforce.com.

Use the My Domain wizard to create a subdomain. My Domain wizard

  1. From Setup, enter My Domain in the Quick Find box, then select My Domain.
  2. Enter the name for your subdomain after https:// and click Check Availability. Typically, a subdomain is your company name, but you can use any name as long as it’s unique. If this name is already taken, choose another one.
  3. Click Register Domain.

Salesforce updates its domain registries with your new subdomain. When it’s done, you receive an email with a subject like, “Your Developer Edition domain ready for testing.” It takes just a few minutes.

Did you catch that last part? It can take a few minutes before your domain is available. You can’t move to the next step until you get the activation email.

Important