twenty
The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.
Twenty is a modern, open-source CRM built as a community-driven alternative to proprietary platforms like Salesforce, designed for technical teams that need a customer relationship management system they can truly own and extend. Rather than forcing teams into rigid, predefined data models, Twenty lets you define custom objects, fields, views, and relationships directly from the UI — or as code using the Twenty SDK and CLI.
At its core, Twenty is architected as a metadata-driven platform: each workspace gets its own isolated PostgreSQL schema, and the entire GraphQL API is generated dynamically from the object model you define. This means your CRM schema evolves with your business without requiring database migrations written by hand or expensive professional services.
Twenty ships with the full feature set of a modern CRM out of the box — contacts, companies, opportunities, email and calendar sync, Kanban views, workflow automation, and rich-text notes — while remaining fully extensible via a marketplace of apps, logic functions, and AI agents. Developers can scaffold new workspace apps with npx create-twenty-app, define objects and views as TypeScript code, and publish them to the workspace with version control.
With 50,000+ stars on GitHub, weekly releases, and a cloud-hosted option alongside Docker Compose self-hosting, Twenty occupies a rare position: a genuinely enterprise-capable CRM that doesn’t lock you in and that you can run, fork, and adapt to your needs.
What You Get
- Custom Object Builder - Define your own CRM objects (deals, properties, projects, or anything else) with custom fields, field types, and relationships — all from the UI with no migrations needed.
- Multiple View Types - Visualize any object in table, Kanban, timeline, or calendar views with drag-and-drop column ordering, filters, and grouped display options.
- Email and Calendar Sync - Two-way Gmail and Microsoft 365 sync connects your inbox and calendar to CRM records, automatically associating threads and events with contacts and companies.
- Workflow Automation - Build automated pipelines triggered by record events (creation, update, status change) with logic steps, code execution, and integrations via webhooks.
- AI Agents - Embed AI agents directly in the workspace with configurable prompts, access to workspace data, and the ability to take actions on records via natural language.
- Twenty SDK and CLI - Scaffold workspace apps as TypeScript code using
npx create-twenty-app, define objects and views programmatically, and publish versioned apps to your workspace. - Rich-Text Notes - BlockNote-powered rich text editor with embeds, mentions, and collaborative editing attached to any CRM record.
- Permissions and Roles - Fine-grained role-based access control with workspace roles, object-level permissions, and row-level security for multi-team deployments.
Common Use Cases
- Running a B2B sales pipeline - A SaaS startup tracks leads, syncs Gmail threads automatically to contact records, and uses Kanban views to manage deal stages with custom fields for contract value and renewal dates.
- Replacing Salesforce for an engineering team - A mid-market tech company migrates off Salesforce by defining their exact data model using the Twenty SDK, keeping historical data in their own PostgreSQL database with no vendor lock-in.
- Building a custom CRM for a vertical - An agency uses
npx create-twenty-appto scaffold a client management app with custom objects for projects, deliverables, and retainers, published to their workspace alongside standard CRM tools. - Automating customer onboarding workflows - A product team sets up workflow automations triggered when a deal closes — creating onboarding tasks, sending welcome emails via the email integration, and notifying Slack.
- Managing investor relations - A startup tracks investor contacts, meeting notes in rich-text, and portfolio updates in a custom Investors object with relationship fields linking to founders and deals.
- AI-assisted data enrichment - Operations teams deploy AI agents inside Twenty that read contact and company records, call external APIs via logic functions, and write enriched data back to CRM fields automatically.
Under The Hood
Architecture Twenty is structured as a large Nx monorepo with hard domain boundaries between a NestJS backend and a React frontend, connected through a dynamically generated GraphQL API. The central architectural innovation is a “workspace as a schema” pattern: every tenant receives its own isolated PostgreSQL schema, and the entire object graph — including GraphQL types, REST endpoints, and query resolvers — is generated at runtime from workspace metadata stored in a central metadata database. Schema changes (adding a custom object or field) trigger a workspace migration pipeline that applies DDL changes to the tenant schema without downtime. The metadata-driven design means the API surface changes dynamically as users modify their data model, making the system genuinely extensible without code deployment.
Tech Stack The backend runs TypeScript on NestJS 11 with GraphQL Yoga as the API gateway, PostgreSQL for persistent storage accessed through both TypeORM and TwentyORM (a custom repository layer handling per-workspace schema routing), Redis for caching and BullMQ job queues, and ClickHouse for analytics. The frontend uses React with Jotai for atom-based state management, Linaria for zero-runtime CSS-in-JS, Apollo Client 4 for GraphQL, and BlockNote for rich-text editing. AI features are powered through the Vercel AI SDK with support for Anthropic, OpenAI, Google, Mistral, Amazon Bedrock, and xAI providers. The stack is orchestrated with Nx and ships as a Docker Compose bundle for self-hosting.
Code Quality
The server-side codebase has extensive test coverage with hundreds of spec files across unit and integration layers, enforced by Jest and the NestJS testing harness. TypeScript strict mode is applied throughout both packages, and the project uses ESLint, Prettier, and oxlint for consistent formatting and linting. Error handling is explicit: NestJS exception filters and typed exception classes are used systematically rather than swallowing errors. The repository also ships with an oxlint ruleset package, end-to-end testing infrastructure, and a GitHub Actions CI pipeline covering builds, tests, and lint. Approximately 240 server files are marked @license Enterprise and governed by a commercial license separate from the AGPLv3 core.
What Makes It Unique Twenty’s core differentiator is its treatment of the CRM schema as a runtime artifact rather than a hardcoded application layer. Users and developers can define, modify, and version the entire data model — objects, fields, views, and relationships — through the UI or as TypeScript code via the SDK, with the server dynamically compiling the changes into live GraphQL schemas and PostgreSQL DDL. Layered on top of this, Twenty introduces AI agents as first-class workspace citizens addressable through the metadata system, a marketplace for distributing workspace apps (similar in concept to Salesforce AppExchange but fully open), and MCP server integration for connecting the CRM to external AI toolchains. The result is an open-source CRM that behaves more like a composable runtime platform than a traditional fixed-schema application.
Self-Hosting
Twenty is released under the GNU Affero General Public License v3 (AGPLv3) for the majority of its codebase, with a subset of files — approximately 240 server-side modules covering billing, advanced permissions, and certain enterprise features — governed by a separate commercial license, clearly marked with a @license Enterprise header. For self-hosters, the AGPLv3 means you can run, modify, and distribute the software freely, but any modifications to the network-accessible server must also be released under the same license. The commercial license files are included in the repository but their use outside the terms defined in the LICENSE file requires a separate commercial agreement with Twentyhq.
Operationally, self-hosting Twenty requires a meaningful infrastructure commitment: a PostgreSQL database, a Redis instance, and adequate compute for the Node.js server. The Docker Compose bundle in packages/twenty-docker covers a standard single-node deployment, but production use at scale requires thinking about database connection pooling, Redis persistence, S3-compatible object storage for file uploads, and regular backup of both the core PostgreSQL database (which holds workspace metadata) and each tenant’s workspace schema. Twenty releases weekly and has shipped 80+ tagged versions since 2023, which means keeping self-hosted instances up to date is an ongoing responsibility — database migrations run automatically on startup, but testing upgrades in a staging environment is advisable for production deployments.
Compared to the managed cloud offering at twenty.com, self-hosters take on full responsibility for uptime, availability, upgrades, and data recovery. The cloud tier adds managed infrastructure, automatic upgrades, SLA guarantees, and first-party support channels. The cloud offering also has a billing and entitlement system that gates certain enterprise features; self-hosters running only the AGPLv3 core will have access to the open portion of the codebase but not to commercial-licensed modules unless a separate enterprise agreement is in place. For most technical teams running Twenty internally, the open core is comprehensive, and the primary trade-off is operational overhead rather than missing features.
Related Apps
Odoo
ERP · CRM · Productivity
The open source ERP platform that integrates CRM, accounting, inventory, manufacturing, and 60+ business apps into one seamlessly connected suite.
Odoo
OtherKrayin CRM
Ecommerce · CRM
Free, open-source Laravel & Vue.js CRM for SMEs and enterprises to manage the complete customer lifecycle.
Krayin CRM
MITSpree Commerce
Marketing · Ecommerce · CRM
Open-source headless eCommerce platform with a REST API, TypeScript SDK, and Next.js storefront for B2B, cross-border, and marketplace commerce — no vendor lock-in, no platform fees.