Launch an App with Stacks
A Stack provisions a whole application and everything it needs, wired together, in a single call. Instead of creating a database, deploying an app, and connecting them by hand, you launch one template and get a running URL.
This showcase launches the BI Workspace stack: a Metabase business-intelligence app running on FoundryDB app-hosting, backed by a managed PostgreSQL database it can query. The same lifecycle applies to every stack in the catalog.
What you use
| Product | Role |
|---|---|
| Stacks | One template that composes and wires the whole application |
| Managed PostgreSQL | The database Metabase connects to and queries |
| App-hosting | Runs the Metabase container behind a managed TLS domain |
Prerequisites
- Owner or admin credentials (
FOUNDRYDB_USER/FOUNDRYDB_PASSWORD). - Your organization id (
ORG_ID).
Step 1: Browse the catalog
List the stack templates. Each describes an app plus the services it composes.
curl -s -u "$FOUNDRYDB_USER:$FOUNDRYDB_PASSWORD" \
https://api.foundrydb.com/stacks/templates | jq -r '.templates[] | "\(.name): \(.description)"'
The catalog includes, among others:
bi-workspace— Metabase on your own PostgreSQL.nocode-db— NocoDB, a spreadsheet-style UI with REST APIs, over PostgreSQL.graphql-api— Hasura, an instant GraphQL API over PostgreSQL.cms— Directus headless CMS on PostgreSQL.document-store— MongoDB with the Mongo Express console.event-streaming— Kafka with the Kafka UI console.rag-chatbot— Open WebUI plus a pgvector database and EU-routed inference (this one requires an inference provider connected to your organization first).
Step 2: Preview the cost
Every stack has a cost preview so you see the monthly total before you commit. The launch call requires you to accept it.
curl -s -u "$FOUNDRYDB_USER:$FOUNDRYDB_PASSWORD" -X POST \
https://api.foundrydb.com/stacks/preview \
-H "Content-Type: application/json" \
-d "{\"template_name\":\"bi-workspace\",\"organization_id\":\"$ORG_ID\"}" \
| jq '{monthly_total, line_items: [.line_items[] | {symbolic_name, kind, description}]}'
For bi-workspace this returns a monthly_total of 40.5 EUR: a tier-1 PostgreSQL database and a tier-1 app.
Step 3: Launch it
Launch the stack, passing the accepted monthly cost from the preview:
curl -s -u "$FOUNDRYDB_USER:$FOUNDRYDB_PASSWORD" -X POST \
https://api.foundrydb.com/stacks/ \
-H "Content-Type: application/json" \
-d "{\"name\":\"my-bi\",\"template_name\":\"bi-workspace\",\"organization_id\":\"$ORG_ID\",\"accepted_monthly_cost\":40.5}"
The response returns the stack in Pending with its two resources (db and app), each also Pending. Capture the stack id:
export STACK_ID="<id-from-response>"
Step 4: Wait for it to come up
Poll the stack until its status, and both resources, read Running. The database provisions first, then the app deploys on top of it.
curl -s -u "$FOUNDRYDB_USER:$FOUNDRYDB_PASSWORD" \
https://api.foundrydb.com/stacks/$STACK_ID \
| jq '{status, resources: [.resources[] | {symbolic_name, status}]}'
When it is Running, read the app URL from the stack detail (the app resource is served on a managed *.foundrydb.com domain, for example https://my-bi-app-xxxxxxxx.foundrydb.com).
Step 5: Open the app
The Metabase app is live behind managed TLS. A quick check:
curl -s https://<your-app-domain>/api/health
# {"status":"ok"}
Open the URL in a browser and you land on Metabase's first-run setup, already able to reach the managed PostgreSQL the stack provisioned. You went from one launch call to a running BI tool on your own database, with no manual wiring.
An AI variant: launch a RAG chatbot
The same lifecycle deploys an AI app. The rag-chatbot stack provisions a pgvector database, a Files bucket, an EU-routed inference key, and an Open WebUI chat app, all wired together.
Because this stack composes inference, it first needs an inference provider connected to your organization (there is no platform-default LLM). Connect one, for example Groq:
curl -s -u "$FOUNDRYDB_USER:$FOUNDRYDB_PASSWORD" -X PUT \
https://api.foundrydb.com/organizations/$ORG_ID/inference/providers \
-H "Content-Type: application/json" \
-d '{"provider":"groq","api_key":"<your-groq-key>","enabled":true}'
The key is stored encrypted and never returned. Then launch the stack exactly as in the steps above, with template_name: "rag-chatbot" and the previewed cost.
When it reaches Running, the Open WebUI app is live behind managed TLS:
curl -s https://<your-app-domain>/health
# {"status":true}
Requests from the app route through the same EU-enforced inference proxy and key, so groq/... calls go through one place with per-key rate limits, a monthly cost circuit, and EU residency. Open the URL, complete Open WebUI's first-run admin setup, pick a model, and chat, grounded on documents you add to the bundled pgvector database.
To keep generation on your own EU hardware instead of a third-party provider, run a Managed Inference service (see Deploy and Call Your First Model) and select its model in the app.
Cleanup
Deleting the stack tears down every resource it created (the app and the database) in one call:
curl -s -u "$FOUNDRYDB_USER:$FOUNDRYDB_PASSWORD" -X DELETE \
https://api.foundrydb.com/stacks/$STACK_ID
What you built
- A running Metabase application on FoundryDB app-hosting, behind a managed TLS domain.
- A managed PostgreSQL database it queries, provisioned and wired by the same stack.
- A one-call launch and a one-call teardown for the whole application.
Next steps
- Build an In-Platform RAG Assistant to combine a database with managed inference.
- Try another stack from the catalog (
graphql-api,nocode-db,document-store), the launch lifecycle is identical. - The
rag-chatbotstack pairs Open WebUI with pgvector and EU-routed inference once you have connected an inference provider to your organization.