Creating Project, DevHub and Scratch Org - LWC
Learning Content
Last updated: February 21, 2026
Creating Project, DevHub and Scratch Org – Lightning Web Components
Objective
A. Create a SalesforceDX Project
B. Create a DevHub Org
C. Create a Scratch Org
D. Get to know about some basic commands
In this unit, We will be creating a project, DevHub Org and scratch org.
A) Create SalesforceDX Project
1. Open VSCode. Press CTRL+SHIFT+P(Windows or Linux), Command+Shift+P (Mac).
2. Here type SFDX:Create Project with Manifest

If you do not see the option ('Create Project with Manifest'), you might try restarting your IDE or verify if all per-requisites are met.
What is the difference between Create Project and Create Project using Manifest?
Create Project is an empty project with only the folders.
- Choose an existing folder for your project on disk
- Open VSCode. Press
CTRL+SHIFT+P(Windows or Linux),Command+Shift+P(Mac). - Here type SFDX: Authorize an Org
- Enter an alias of this org (here MYFIRSTAPP)
- Enter your credentials (user/password)
- Terminal (tab): type the next command lines directly
sfdx force:source:retrieve -m ApexClass
sfdx force:source:retrieve -m AuraDefinitionBundle
Create Project using Manifest => "manifest" folder contains a default package.xml
- Choose an existing folder for your project on disk
- Open VSCode. Press
CTRL+SHIFT+P(Windows or Linux),Command+Shift+P(Mac). - Here type SFDX: Authorize an Org
- Enter an alias of this org (here MYFIRSTAPP)
- Enter your credentials (user/password)
- Right click on package.xml
- SFDX: Retrieve Source in Manifest from Org
3. Enter as the project name and press enter

4. After giving the name, It will ask you to save your project in the folder. Specify the folder here. ( I would suggest you to first create a folder name lwc and store the project in this folder. as we will be wiring more session examples here.)

5. Click on the Create Project button. Now you can see the folder hierarchy.

B) Create a Dev Hub Org
- First Sign Up for Salesforce Developer Edition.
- Build and test Lightning Web Components (LWC)
- Write and debug Apex classes and triggers
- Create custom objects, fields, and metadata
- Work with APIs and integrations
- Prepare for real-world projects and certifications
- After successful login, Goto Setup(Top-Right).
- Here search for Dev Hub in the sidebar.
- To create a scratch org we need to enable a dev hub as shown in the below images.
- These are the two new objects which are created after we enabled dev hub in our org as shown below.
- Open VSCode. Create a project.
- Goto VS code. Press
Ctrl+Shift+P(Windows),Command+Shift+P(Mac) - Here type SFDX: Authorize a Dev Hub.
- It will open the login page in the browser. Here enter detail of the org that you have created above and do the login.
- Go back to Visual Code Studio where we can see the status of authorization as shown below.
Salesforce Developer Edition provides a free and safe environment for learning, testing, and building applications on the Salesforce platform. It is specifically designed for developers who want to explore features, write code, and practice without impacting production data.
With a Developer Edition org, you can:
To create your free Salesforce Developer Edition account, sign up here:
developer.salesforce.com/signup
Once you complete the signup process, Salesforce will send a confirmation email. After activation, you can log in and start building Lightning Web Components right away.


-> Quick Find Search Box --> Enter Dev Hub

-> Here enable the DevHub feature.


Till now, You have an Org. Now we need to connect this to our IDE.


Cool, You have authorized your dev hub.
C) Create a Scratch Org
- Again, Goto the VS Code and Press
Ctrl+Shift+P(Windows),Command+Shift+P(Mac) - Here type SFDX: Create a Default Scratch Org.
- Just hit the enter. Now provide the scratch org name. ( You can give LWCProjectScratch)
- Wait for a few minutes, Salesforce will create a new org for you. All of the development will go here.
D) Commands that you should know:
1. Open your scratch org by the following command.
sfdx force:org:open
2. You can see all of your org lists by the following command:
sfdx force:org:list
3. Push your code to scrap org:
sfdx force:source:push
Practice What You've Learned
Test your understanding with these practice exercises
