Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

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.

Introduction

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.

Follow Along with Trail Together

Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series on Trailhead Live. You can find a link to the full session in the Resources section.

Set Up Your Trailhead Playground

Create a new Trailhead Playground

For this project, you need to create a new Trailhead Playground. Scroll to the bottom of this page, click the playground name, then click Create Playground. It typically takes 3-4 minutes to create a new Trailhead Playground.

Note

Yes, we really mean a brand-new Trailhead playground! If you use an existing org or playground, you can run into problems completing the challenges.

Get Your Trailhead Playground Username and Password

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

If you see a tab in your org labeled Get Your Login Credentials, great! Follow the steps below. If not, from the App Launcher (), find and select Playground Starter and follow the steps.

  1. Click the Get Your Login Credentials tab and take note of your username.
  2. Click Reset My Password. This sends an email to the address associated with your username.
  3. Click the link in the email.
  4. Enter a new password, confirm it, and click Change 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 version control system (VCS), and execute tests.

See the Salesforce CLI Setup Guide for complete installation instructions.

  1. Install the CLI from Salesforce CLI.
  2. Confirm the CLI is properly installed and on the latest version by running the following command from the command line.
    sf update

    You should see output like Updating 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.

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback