|
1 | 1 | --- |
2 | 2 | title: Self-host |
3 | | -lastModified: "2026-01-10" |
| 3 | +lastModified: "2026-03-10" |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | <Info type="danger"> |
@@ -78,6 +78,44 @@ You can also open Prisma Studio to see the database interface and edit data dire |
78 | 78 |
|
79 | 79 | <PlatformCodeblock document="others/self-host" examples={["prisma-studio"]} hidePlatformSelector /> |
80 | 80 |
|
| 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 | + |
81 | 119 | ## Run individual services |
82 | 120 |
|
83 | 121 | ### Database, Svix, email |
|
0 commit comments