Docker Compose
Everything on one server: the app, PostgreSQL with pgvector, a migration step and a scheduler. Put a reverse proxy with HTTPS in front.
Compose guideSelf-hosting
Sastra is free software under the AGPL-3.0. Sastra Cloud sells the running of it; if you would rather run it yourself, here is how.
Everything on one server: the app, PostgreSQL with pgvector, a migration step and a scheduler. Put a reverse proxy with HTTPS in front.
Compose guidePaste the Compose file as a resource, or build from the Dockerfile with a Coolify Postgres. Coolify handles HTTPS and the domain.
Coolify guideA one-click template creates the app, a database and a file bucket in your own Railway account. A small team usually stays under $10 a month.
Railway guide| Runtime | The container image ghcr.io/sastra-cloud/sastra for amd64 and arm64, or a build from the Dockerfile. |
|---|---|
| Database | PostgreSQL 16 or newer with the vector extension. The pgvector/pgvector images have it. |
| Files | Any S3-compatible bucket: Cloudflare R2, AWS S3, Railway Buckets or MinIO. |
| Resend or any SMTP provider. Required, because sign-in links and invitations are email. | |
| AI | An OpenRouter key, in the environment or pasted by an admin in Settings. Optional; the app works without AI. |
| Scheduler | Anything that can call one URL every minute. The Compose bundle includes it. |
mkdir sastra && cd sastra
curl -fsSLO https://raw.githubusercontent.com/Sastra-Cloud/sastra/main/deploy/compose/docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/Sastra-Cloud/sastra/main/deploy/compose/.env.example -o .env
# fill in .env, then
docker compose up -d
Then open your address. The first screen creates the first admin. The full environment reference lists every setting.
Ask in Discussions, report bugs as issues, and read CONTRIBUTING.md before sending a change. Self-hosted installations are supported by the community and the maintainers as time allows; there is no service level. If you would like someone else to carry the servers, that is what Sastra Cloud is for.
Because Sastra is AGPL software, an installation that other people use over a network must offer them its source. The app does this for you with the Source link in the sidebar; if you modify Sastra, point that link at your own copy.