> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up Local Dev for an Existing App

> Write backend code locally for an app you already have on Base44

Use this guide to write backend code locally for a Base44 app you already have. The [`scaffold`](/developers/references/cli/commands/scaffold) command creates the configuration files your development environment needs and connects your local environment to your app's backend resources. The frontend stays in Base44's visual editor. Unlike [`eject`](/developers/backend/overview/start-from-existing-app), which creates a new app and downloads your existing code including the frontend, scaffold works with your app in place.

<Note>
  * This guide requires your existing app ID. You can find it in the app's URL in the Base44 app editor: `app.base44.com/apps/<id>/...`
  * The CLI requires Node.js 20.19.0 or higher.
  * If you want a different local development approach for an app you already have on Base44, consider these options instead:
    * [GitHub integration](/developers/app-code/local-development/github): two-way auto-sync with a GitHub repo, requires Builder plan.
    * [`base44 eject`](/developers/backend/overview/start-from-existing-app): create a separate local copy of the app as a new project.
    * [`base44 link`](/developers/backend/overview/link-existing-project): link existing project files already on disk to a Base44 backend.
</Note>

<Steps>
  <Step title="Install the CLI">
    Install the Base44 CLI globally:

    ```bash theme={null}
    npm install -g base44@latest
    ```
  </Step>

  <Step title="Create or navigate to your project directory">
    Create a directory for your local project and navigate to it:

    ```bash theme={null}
    mkdir my-project && cd my-project
    ```

    You can also run `scaffold` in a directory that already has files. The command only writes files that don't exist yet.
  </Step>

  <Step title="Scaffold the project">
    Run the scaffold command with your app ID:

    ```bash theme={null}
    base44 scaffold --app-id <your-app-id>
    ```

    If you're not already logged in, the command will prompt you to authenticate.

    The CLI creates configuration files in your directory and links them to your app on Base44.
  </Step>
</Steps>

When complete, your directory contains:

* **`base44/config.jsonc`**: Project configuration, including your app name and visibility settings.
* **`base44/.app.jsonc`**: Links your local directory to your app on Base44. Gitignored by default.
* **`base44/.gitignore`**: Ignores generated files and secrets from version control.
* **`.agents/` and `.claude/`**: AI agent skills that teach your IDE how to work with Base44. Pass `--no-skills` to skip this.

For details on the generated files, see [Project Structure](/developers/backend/overview/project-structure).

## When to use scaffold

Use scaffold when you:

* Want to write backend resources (entities, functions, agents) locally while the frontend stays in Base44's visual editor. To get local access to the frontend code as well, use [`base44 eject`](/developers/backend/overview/start-from-existing-app) instead.
* Prefer manual deploys over automatic sync, or don't have the plan level required for [GitHub integration](/developers/app-code/local-development/github).
* Need to set up local development on a second machine for the same app.

## Next steps

Now that your project is set up, you can:

* Add [entities](/developers/backend/resources/entities/overview), [backend functions](/developers/backend/resources/backend-functions/overview), and [agents](/developers/backend/resources/agents/overview). If you're working in TypeScript, [generate types](/developers/references/sdk/getting-started/dynamic-types) to get autocomplete and type safety.
* Deploy your backend resources to Base44 with [`base44 deploy`](/developers/references/cli/commands/deploy).

## See also

* [`scaffold` command reference](/developers/references/cli/commands/scaffold): Command flags and usage details
* [Project Structure](/developers/backend/overview/project-structure): How project files are organized
* [CLI Command Reference](/developers/references/cli/commands/introduction): All available CLI commands
