Quickstart
This guide walks you through creating a minimal Sigil environment with a Postgres database and a service that connects to it.
1. Create a config file
Section titled “1. Create a config file”Create sigil.config.ts in your project root:
import { Environment, Postgres, Service } from "sigil";import path from "path";
const root = import.meta.dir;const env = new Environment("my-app");
// Add a Postgres databaseconst db = env.add( new Postgres("db", { port: 5432, database: "myapp", username: "postgres", password: "postgres", }));
// Add your backend serviceenv.add( new Service("api", { command: ["node", "server.js"], cwd: path.join(root, "backend"), env: { DATABASE_URL: db.connectionString, }, readyCheck: { url: "http://localhost:3000/health", timeout: 30000, }, }));
export default env;2. Start the environment
Section titled “2. Start the environment”sigil upSigil will:
- Pull the Postgres Docker image (first run only)
- Start a Postgres container
- Wait for the database to be ready
- Start your backend service with
DATABASE_URLinjected - Poll the health endpoint until the service is ready
Output looks like:
[sigil] Starting environment "my-app"...[sigil] Starting entity: db[sigil] Pulling image postgres:16...[sigil] Container sigil-db started on port 5432[sigil] Starting entity: api[api] Server listening on port 3000[sigil] All entities started. Press Ctrl+C to stop.3. Check status
Section titled “3. Check status”In another terminal:
sigil statusInstance: default (PID 12345, running, started 2m ago) Config: /path/to/sigil.config.ts Entities: db running api running4. Tear down
Section titled “4. Tear down”sigil downOr press Ctrl+C in the terminal running sigil up.
Named instances
Section titled “Named instances”You can run multiple instances simultaneously:
sigil up dev # starts instance named "dev"sigil up test # starts instance named "test"sigil status # shows bothsigil down dev # stops only "dev"Next Steps
Section titled “Next Steps”- Concepts — Understand entities, interfaces, and the lifecycle model
- Full-Stack Example — A complete app with Postgres + FastAPI + React