Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Development as a Service (DaaS) entry
How-to guide

How to set up a Salesforce DaaS workflow

Setting up Salesforce DaaS means enabling a Dev Hub, installing the Salesforce CLI, structuring a Git repository, and creating your first scratch org. From there, you build on the same primitives.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 20, 2026

Setting up Salesforce DaaS means enabling a Dev Hub, installing the Salesforce CLI, structuring a Git repository, and creating your first scratch org. From there, you build on the same primitives.

  1. Enable Dev Hub in production

    Setup, then Dev Hub, then Enable Dev Hub. Confirm the warning (the feature cannot be disabled later) and save. The org is now your scratch-org quota provider.

  2. Install the Salesforce CLI

    Download from developer.salesforce.com/tools/sfdxcli. Verify with sf --version. The CLI installs globally and updates monthly.

  3. Authenticate the CLI against your Dev Hub

    Run sf org login web --alias DevHub --set-default-dev-hub. A browser opens; log in with the Dev Hub admin credentials. The CLI stores the authorization and uses it for every scratch-org operation.

  4. Create a Salesforce DX project

    Run sf project generate --name MyProject. The CLI scaffolds a Git-friendly directory structure with force-app/main/default, sfdx-project.json, and config/project-scratch-def.json.

  5. Spin up your first scratch org

    From the project directory, run sf org create scratch --definition-file config/project-scratch-def.json --alias myorg --duration-days 7. In about 60 seconds you have a fresh org you can deploy to.

  6. Deploy and test against the scratch org

    Run sf project deploy start --target-org myorg to push metadata. Run sf apex test run --target-org myorg --result-format human to execute tests. Both commands work the same way against any org the CLI knows about.

Key options
Dev Hubremember

The production org that authorizes scratch-org creation. Required for any DaaS workflow.

Salesforce CLI (sf)remember

The unified command-line tool. Authenticates against orgs, deploys metadata, manages scratch orgs.

Scratch Orgsremember

Disposable Salesforce orgs, defined by project files. Default 7-day lifespan.

Second-Generation Packaging (2GP)remember

The DaaS packaging model. Versioned, dependency-aware, deployable via the CLI.

Gotchas
  • Dev Hub cannot be disabled. Enabling it on a sensitive production org is a one-way door; consider enabling it on a dedicated sandbox parent org if you have one.
  • Scratch orgs are NOT sandboxes. They cannot accept Change Sets and they expire automatically. Long-running QA environments still need actual sandboxes.
  • CLI authentication tokens expire. Refresh them with sf org login web when you start a new day or move to a new machine.
  • DaaS workflows fall apart without Git discipline. Source-driven development assumes the source IS the truth; orgs are projections of the source. Treating sandboxes as the truth is the pre-DaaS pattern.

See the full Development as a Service (DaaS) entry

Development as a Service (DaaS) includes the definition, worked example, deep dive, related terms, and a quiz.