Skip to content

Commit a93a868

Browse files
Document local emulator mode for self-hosting development
1 parent add0d56 commit a93a868

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

Submodule implementation deleted from e4f32c6

docs/content/docs/(guides)/others/self-host.mdx

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Self-host
3-
lastModified: "2026-01-10"
3+
lastModified: "2026-03-10"
44
---
55

66
<Info type="danger">
@@ -78,6 +78,44 @@ You can also open Prisma Studio to see the database interface and edit data dire
7878

7979
<PlatformCodeblock document="others/self-host" examples={["prisma-studio"]} hidePlatformSelector />
8080

81+
## Local Emulator Mode
82+
83+
**Local emulator mode** lets you map projects to local config files during development, instead of creating them through the dashboard.
84+
85+
### Enabling Local Emulator Mode
86+
87+
Set this environment variable in both your backend and dashboard `.env` files:
88+
89+
```
90+
NEXT_PUBLIC_STACK_IS_LOCAL_EMULATOR=true
91+
```
92+
93+
### How It Works
94+
95+
When local emulator mode is enabled:
96+
97+
1. **Auto-login**: The dashboard automatically signs you in with a pre-configured emulator account
98+
2. **Config file-based projects**: Instead of "Create Project", you'll see "Open config file" to map a local `stack.config.ts` file to a project
99+
3. **Branch config from files**: Project configuration is read from and written directly to your local config file
100+
4. **Read-only environment config**: Environment configuration cannot be modified—make these changes in your production deployment instead
101+
102+
### Opening a Project from a Config File
103+
104+
1. Go to the Projects page in the dashboard
105+
2. Click **Open config file**
106+
3. Enter the absolute path to your `stack.config.ts` file (e.g., `/Users/you/myapp/stack.config.ts`)
107+
4. The emulator will create or reuse a project mapped to that file path
108+
109+
Your config file should export a `config` object:
110+
111+
```ts title="stack.config.ts"
112+
export const config = {
113+
// Your branch configuration
114+
} as const;
115+
```
116+
117+
Changes you make to branch-level settings in the dashboard will be written back to this file, making it easy to version control your configuration.
118+
81119
## Run individual services
82120

83121
### Database, Svix, email

0 commit comments

Comments
 (0)