Start tracking your progress
Trailhead Home
Trailhead Home

Set Up Your Salesforce DX Environment

Learning Objectives

In this project, you’ll:

  • Install Salesforce CLI.
  • Install Visual Studio Code and extensions for Salesforce DX.
  • Create and deploy a Lightning web component.


Lightning Web Components is a new programming model for building Lightning components. It uses web standards breakthroughs, can coexist and interoperate with the Aura programming model, and delivers unparalleled performance. To create and develop Lightning Web Components and use their powerful features and performance benefits, you need to set up Salesforce DX. For this Quick Start you also use Visual Studio Code, which is the recommended code editor for developing on the Salesforce platform. Once your developer environment is ready, you learn how to write a simple Lightning web component and add it to a page in Lightning Experience.

The Salesforce Developer Experience (DX) is a set of tools that streamlines the entire development life cycle. It improves team development and collaboration, facilitates automated testing and continuous integration, and makes the release cycle more efficient and agile.

Set Up Your Trailhead Playground 

Create a new Trailhead Playground.

  1. To create a new Trailhead Playground, click the dropdown at the end of this step and select Create a Trailhead Playground.     The Create a Trailhead Playground dropdown in a module's hands-on challenge.
  2. Once you have a Trailhead Playground, click Launch.

Reset your password. You need both your username and password to authenticate your Trailhead Playground with the Salesforce CLI in a later step.

  1. Click The Setup gear icon.and select Setup.
  2. Enter users in the Quick Find box, then click Users.
  3. Locate your name on the list of users.
  4. Select the checkbox next to your name. Make note of the username. This is the username for your Trailhead Playground.
  5. Click Reset Password(s) then OK. This sends a password reset email to the email address associated with your username. Be sure to check your spam folder if you don't see the email.   Reset your Trailhead Playground password on the Users page in Setup.
  6. Click the link in the email.
  7. Set your password.

Install the Command Line Interface (CLI)

Use the Salesforce CLI to control the full application life cycle of your Salesforce apps. With it you can easily create environments for development and testing, synchronize source code between your orgs and VCS, and execute tests. 

  1. Install the CLI using the links below.
    Operating System
    Link to Installer
    Windows 32-bit
    Windows 64-bit
    Debian/Ubuntu 64
    Download the archive from one of the URLs in the manifest, extract the archive, then run the ./install script.
    Debian/Ubuntu x86
    Download the archive from one of the URLs in the manifest, extract the archive, then run the ./install script.
  2. Let’s make sure the CLI is properly installed and you know how to access online help for the commands. In a command window, enter sfdx.

    You see something like this:
    Usage: sfdx COMMAND [command-specific-options]
     Help topics, type "sfdx help TOPIC" for more details:
     sfdx force # tools for the salesforce developer
     sfdx plugins # manage plugins
     sfdx update # update sfdx-cli

In our next step, we set up our local development environment with Visual Studio Code.

We won’t check any of your setup. Click Verify Step to go to the next step in the project.