Amit Chaudhary

Amit Chaudhary

Amit Chaudhary is Salesforce Application & System Architect and working on Salesforce Platform since 2010. He is Salesforce MVP since 2017 and have 17 Salesforce Certificates. He is a active blogger and founder of Apex Hours.

How to Setup Visual Studio Code for Salesforce

Visual Studio Code is recommended IDE for Salesforce development. In this post, we will learn about how to setup Visual Studio Code for Salesforce development. We’ll explore the features of VS Code, configure it, and customize it to use it as a powerful tool for Salesforce Development.

Step 1) Download and Install VsCode

Download the Visual Studio Code from here and install on your computer.

Download and Install VsCode for Salesforce

Step 2) Install Salesforce DX CLI

To connect the VsCode with Salesforce org we need SalesforceDX CLI. Download the Salesforce CLI from here.

Operating System 
Link to Installer 
Windows 32-bit 
Windows 64-bit 
Install Salesforce DX CLI

Once Salesforce CLI is installed. You can validate the same with sfdx command on command line terminal. Check this post if you want to learn more about Salesforce CLI

Step 3) Install Salesforce Extension Pack

We are almost there. Open your VsCode and Click on Extensions icon on left hand side or press CTRL+SHIFT+X. Then Search for “Salesforce Extension Pack” and click on install button

Install Salesforce Extension Pack for VsCode

With Salesforce Extension pack all below extension will install automatically.

  1. Apex
  2. Salesforce CLI Integration
  3. Apex Interactive Debugger
  4. Apex Replay Debugger
  5. Visualforce
  6. Aura Components
  7. Lightning Web Component

Step 4) Create Project

Congratulation. Till this step your software setup is completed. Now its time to create your first project in VsCode. To Create the project open Command Palette or press Ctrl + Shit + P.  Then type SFDX: Create Project with Manifest .

SFDX: Create Project with Manifest
SFDX: Create Project with Manifest

Then provide your project name and select location where you want to save your project.

How to Setup Visual Studio Code for Salesforce

Till this point you will able to see blank folder structure in VsCode. Let see how we can connect our VsCode with Salesforce

Step 5) Connect with your Salesforce Org

Our project is ready on our local machine, Its time to connect our VsCode with Salesforce. Again open Command Palette or press Ctrl + Shit + P.   This time we need to type or Select “SFDX: Authorize an Org“.

SFDX: Authorize an Org
SFDX: Authorize an Org

Then it will ask you which environment we need to connect to

How to Setup Visual Studio Code for Salesforce

In the last step you need to provide the org alias name. Then it will take you to your default browser and ask you for org credentials. If prompted to allow access, click Allow

Till this point your Salesforce org is connected with VsCode. Now its time for Development.

Step 6) Retrieve Component

Now you want to extract all your Salesforce component in your VsCode? Open Package.xml file from Manifest folder. Then Modify your Package.xml file to add and remove component. Finally Click on Package.xml and select “SFDX: Retrieve This Source from Org” option

SFDX: Retrieve This Source from Org

SFDX: Retrieve This Source from Org

It’ll retrieve all the metadata from your org which is specified in your package.xml file

Step 7) Deploy component

Open any file and work one your component. IF you want to learn about how to create Lightning Web Component then check this post. Now do your changes in VSCode and then select the file which you want to deploy in your org. Then Right click on VsCode and select “SFDC: Deploy This Source to Org” option for deployment.

Deploy component with VsCode


If you want to learn about how to use VsCode on cloud check this post.


I hope this post helped you to understand how to set up vsCode in Salesforce. Check out the Top 10 VsCode Extensions for Salesforce to increase your productivity for Salesforce Development.

Share this article


  • How to connect & work with GIT from VSCODE.
    Best if a blog post that explains the process with example scenario @Amit

  • I would also like to request a video blog on ‘How to connect and work with GIT from VSCODE for SF’
    Thankful for the wonderful learning you and your team have been imparting to the SF Community.

  • Doesn’t work.

    Whenever I want to deploy something, nothing happenes. I see the loading bar moving, but nothing happens even after minutes of waiting.

  • Whenever I am trying to retrieve the elements from SF Org, only static resource is retrieved and retrieve not working for other elements. There are no errors also of failed retrieve. Please help.

Leave a reply

Keep in Touch

Subscribe for Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,229 other subscribers


Our Supporter


Apex Hours

Apex Hours is one stop platform to learn Salesforce skills and technology

Join our Newsletter and get tips and tricks how to explore the salesforce for free!