Deploy Mike Legal AI
Open-source legal AI for document review and drafting, fully self-hosted
Just deployed
Just deployed
Just deployed
Just deployed
/data
Just deployed
Just deployed
/var/lib/postgresql/data
Just deployed
Just deployed
Deploy and Host Mike on Railway
Mike (MikeOSS) is an open-source legal AI platform. Lawyers chat with contracts and filings, review documents and apply suggested edits, run drafting and tabular-review workflows across many documents, verify citations and research US case law, and organise matters into projects, folders and a shared library. It works with Anthropic, OpenAI, Gemini, routers or a local Ollama model. This is a community-maintained template; it is not affiliated with the Mike project.
About Hosting Mike
Mike is a Next.js web app and an Express API on Supabase Auth and Postgres, with S3-compatible storage for documents, Redis for its job queues and LibreOffice for document conversion. Upstream's Docker Compose stack runs all of it on one machine with demo credentials and open registration.
This template runs the same stack on Railway, in one project, eight services with every secret generated: a self-hosted Supabase (Postgres, Auth, PostgREST and its gateway), RustFS object storage, Valkey, and Mike's API and web app, built from a pinned upstream commit. No Supabase account and no external bucket.
The first start does upstream's one-shot steps for you: it builds the database from upstream's schema (or applies only the new migrations on an existing install), creates your owner account from the e-mail you enter, creates the storage bucket with an upload policy for your web app's origin, imports Mike's workflow catalogue, and only then starts the API. Signup is closed by default and enforced in the database: only the owner, the addresses or domains you list, and colleagues invited to your organisations get accounts.
Why Deploy Mike on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Mike on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Concretely, this template keeps the database, authentication, API and queues on Railway's private network, exposes only the web app and a signed-URL storage endpoint over HTTPS, runs Mike in production mode with secure session cookies, and attaches volumes to the database, the document store and the queue.
Common Use Cases
- A firm's or legal team's private AI assistant for contract review, drafting and research.
- Tabular review: extract the same clauses and terms across a batch of agreements.
- Reusable legal workflows (NDA, DPA and MSA review and drafting) shared across a team.
- Keep privileged documents and chats in storage and a database you control.
Dependencies for Mike Hosting
- A model provider key (Anthropic, OpenAI, Gemini, OpenRouter or Vercel AI Gateway), set on the backend or added by each user in the app, or an Ollama server the backend can reach.
- Optional: a CourtListener API token for higher-rate US case-law lookups.
- Optional: SMTP for account e-mails, and a Google OAuth client for Google sign-in.
Deployment Dependencies
- Mike: https://github.com/open-legal-products/mike (AGPL-3.0)
- Mike workflows: https://github.com/Open-Legal-Products/mike-workflows (MIT)
- Supabase self-hosting stack: https://github.com/supabase/supabase/tree/master/docker (Apache-2.0)
- RustFS: https://github.com/rustfs/rustfs (Apache-2.0)
- Template repository, images and tests: https://github.com/youssefsiam38/mike-railway
Implementation Details
The API and web app are built from a pinned upstream commit exactly as upstream's Dockerfiles build them, with no code changes; the API image adds a start-up that runs upstream's one-shot steps. Thin wrappers adapt Supabase and RustFS to Railway: init scripts baked in, API keys minted from the shared JWT secret, the Vault key kept on the database volume, and RustFS's data directory prepared on its volume with the console off. Every service refuses to start on missing, short or published example secrets. The bundle is tested as a whole in CI, including sign-in, an organisation invitation, a chat against a stand-in model, and a document uploaded through a signed URL and converted to PDF, on fresh and reused volumes.
The deploy form asks for one value, OWNER_EMAIL. After deploying, copy OWNER_PASSWORD from the backend
service's variables, sign in on the web app's domain, and add a model key.
Template Content
OWNER_EMAIL
Your e-mail address. It becomes the owner account you sign in with.
