Skip to content

Commit c4004e1

Browse files
docs(cloud): clarify VPS env setup
1 parent 8ef28fb commit c4004e1

2 files changed

Lines changed: 93 additions & 11 deletions

File tree

docs/engram-cloud/docker-compose.ghcr.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ services:
22
postgres:
33
image: postgres:16-alpine
44
restart: unless-stopped
5+
env_file:
6+
- .env
57
environment:
6-
POSTGRES_USER: engram
7-
POSTGRES_PASSWORD: change-me
8-
POSTGRES_DB: engram_cloud
8+
POSTGRES_USER: ${POSTGRES_USER}
9+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
10+
POSTGRES_DB: ${POSTGRES_DB}
911
volumes:
1012
- engram-cloud-pg:/var/lib/postgresql/data
1113
healthcheck:
@@ -20,14 +22,8 @@ services:
2022
depends_on:
2123
postgres:
2224
condition: service_healthy
23-
environment:
24-
ENGRAM_DATABASE_URL: postgres://engram:change-me@postgres:5432/engram_cloud?sslmode=disable
25-
ENGRAM_CLOUD_TOKEN: replace-with-random-token
26-
ENGRAM_CLOUD_ADMIN: admin
27-
ENGRAM_JWT_SECRET: replace-with-32+-byte-random-secret
28-
ENGRAM_CLOUD_ALLOWED_PROJECTS: my-project
29-
ENGRAM_CLOUD_HOST: 0.0.0.0
30-
ENGRAM_PORT: "18080"
25+
env_file:
26+
- .env
3127
ports:
3228
- "18080:18080"
3329

docs/engram-cloud/quickstart.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,92 @@ Dokploy guidance:
9090
4. Expose container port `18080`.
9191
5. Avoid build-from-source mode unless you are actively developing Engram itself.
9292

93+
### VPS / self-hosted Compose
94+
95+
For a plain VPS, put secrets in a `.env` file next to your compose file instead of
96+
hardcoding them into YAML.
97+
98+
Directory layout:
99+
100+
```text
101+
/opt/engram/
102+
docker-compose.yml
103+
.env
104+
```
105+
106+
Example `.env`:
107+
108+
```dotenv
109+
POSTGRES_USER=engram
110+
POSTGRES_PASSWORD=replace-with-strong-postgres-password
111+
POSTGRES_DB=engram_cloud
112+
113+
ENGRAM_DATABASE_URL=postgres://engram:replace-with-strong-postgres-password@postgres:5432/engram_cloud?sslmode=disable
114+
ENGRAM_CLOUD_TOKEN=replace-with-long-random-bearer-token
115+
ENGRAM_CLOUD_ADMIN=replace-with-separate-admin-token
116+
ENGRAM_JWT_SECRET=replace-with-32+-byte-random-secret
117+
ENGRAM_CLOUD_ALLOWED_PROJECTS=engram,gentle-ai
118+
ENGRAM_CLOUD_HOST=0.0.0.0
119+
ENGRAM_PORT=18080
120+
```
121+
122+
Notes:
123+
- Keep `.env` on the server only. Do not commit it.
124+
- `ENGRAM_CLOUD_TOKEN` is the bearer token clients use for authenticated sync.
125+
- `ENGRAM_CLOUD_ADMIN` is the dashboard admin token. Use a different secret from `ENGRAM_CLOUD_TOKEN`.
126+
- `ENGRAM_JWT_SECRET` must be an explicit, non-default strong secret in authenticated mode.
127+
- `ENGRAM_CLOUD_ALLOWED_PROJECTS` is required server-side and should be a comma-separated allowlist.
128+
129+
Reference compose:
130+
131+
```yaml
132+
services:
133+
postgres:
134+
image: postgres:16-alpine
135+
restart: unless-stopped
136+
env_file:
137+
- .env
138+
environment:
139+
POSTGRES_USER: ${POSTGRES_USER}
140+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
141+
POSTGRES_DB: ${POSTGRES_DB}
142+
volumes:
143+
- engram-cloud-pg:/var/lib/postgresql/data
144+
145+
cloud:
146+
image: ghcr.io/gentleman-programming/engram:latest
147+
restart: unless-stopped
148+
depends_on:
149+
postgres:
150+
condition: service_healthy
151+
env_file:
152+
- .env
153+
ports:
154+
- "18080:18080"
155+
```
156+
157+
Start or restart after editing `.env`:
158+
159+
```bash
160+
docker compose up -d
161+
docker compose restart cloud
162+
```
163+
164+
If you upgrade the `engram` image tag, redeploy or restart the container so the
165+
running server picks up the new binary.
166+
167+
### Client-side token setup
168+
169+
On the machine that runs the Engram CLI, set the client token in the shell before
170+
cloud sync:
171+
172+
```bash
173+
engram cloud config --server https://your-host:18080
174+
export ENGRAM_CLOUD_TOKEN=replace-with-long-random-bearer-token
175+
engram cloud enroll my-project
176+
engram sync --cloud --project my-project
177+
```
178+
93179
> `ENGRAM_CLOUD_INSECURE_NO_AUTH=1` is for local/dev smoke only. Never use it in production.
94180

95181
---

0 commit comments

Comments
 (0)