Skip to main content

Set Up Visual Studio Code

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.

(This clip starts at the 7:04 minute mark, in case you want to rewind and watch the beginning of the step again.)

Install Salesforce Extensions for Visual Studio Code

Visual Studio Code is the go-to code editor for Salesforce developers. It's free, open-source, and available for Windows, Linux, and macOS. This editor has easy-to-install extensions for syntax highlighting, code completion, and more.

Visual Studio Code's code completion in action.

In this project, we install Visual Studio Code and the recommended Salesforce Extension Pack.

Note

Some features, particularly Apex support, in Salesforce Extensions for Visual Studio Code depend on the Java Platform, Standard Edition Development Kit (JDK). It requires an installation of either JDK version 21 (Recommended), JDK version 17 or JDK version 11. If you have another version of Java installed, you need to also install JDK 21, JDK 17 or JDK 11. Once you install the right JDK, use the following link to configure your setup:

  1. Download and install the latest version of Visual Studio Code for your operating system. If you already have Visual Studio Code installed, there's no need to reinstall it.
  2. Launch Visual Studio Code.
  3. On the left toolbar, click the Extensions icon Visual Studio Code's Extension.
  4. Search for Salesforce Extension Pack and click Install.
    Visual Studio Code search for Salesforce Extension Pack.
Note

There is also a Salesforce Extension Pack (Expanded) version. It also includes third-party extensions that are commonly used by Salesforce Developers. You only need one of the Extension Packs.

Ensure Your Development Environment Is Ready

Now that you've installed Visual Studio Code and enabled the necessary extensions, you need to test them out.

  1. In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
  2. Enter sfdx to filter for commands provided by the Salesforce Extensions. Visual Studio Code: Filter sfdx commands in Visual Studio code.
    As you use more SFDX commands, those commands will show up in the recently used panel.

In the final step, you create your first Lightning web component and add it to your org's home page.

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