Cozy Stack is the core server component of the Cozy platform, designed to bring all your web services into a single, private, self-hosted environment. It eliminates third-party data profiling by keeping your data on your own hardware while enabling seamless sharing between apps and devices. Built in Go, it serves web applications from its app store, manages user authentication via sessions and OAuth2, and provides a REST API for document operations. With built-in job scheduling, email sending, and database replication via CouchDB, it’s ideal for users seeking full control over their digital ecosystem without relying on commercial cloud providers.
What You Get
- REST API for document management - Create, update, and delete documents in a CouchDB-backed database with standardized endpoints for apps to interact with user data.
- OAuth2 and session-based authentication - Supports both web app sessions (for apps hosted on the server) and OAuth2 for external client applications to securely access user data.
- Job scheduler with sandboxing - Executes one-time and periodic tasks (like data connectors from external sites) using nsjail for process isolation to ensure server security.
- Database replication API - Enables bidirectional synchronization between the Cozy Stack and local databases, crucial for mobile clients to work offline and sync later.
- Built-in email sending - Allows applications to send emails through the stack’s integrated mailer system without external dependencies.
Common Use Cases
- Building a self-hosted personal cloud - Users replace Google Drive, Dropbox, and Gmail with Cozy Stack to host files, contacts, calendars, and emails on their home server while keeping full data ownership.
- Developing privacy-first web apps - Developers create applications that run on Cozy Stack to ensure user data never leaves their infrastructure, ideal for healthcare or financial tools requiring compliance.
- Problem: Data silos across services → Solution: Cozy Stack unifies them - Users have data scattered across Gmail, Dropbox, and Trello; Cozy Stack imports all via connectors, stores it in one place, and lets apps access it securely through a single API.
- DevOps teams managing private cloud infrastructure - Teams deploy Cozy Stack on-premises or in private clouds to offer a secure, app-rich platform for employees without relying on SaaS vendors.
Under The Hood
Cozy Cloud is a personal data platform designed to give users control over their data while offering a modular and flexible architecture for deployment across various client types. It emphasizes simplicity, modularity, and user sovereignty in handling personal information.
Architecture
The system follows a layered architecture that clearly separates concerns between core logic, data storage, and client interactions. This approach supports both scalability and ease of maintenance.
- The architecture is organized into distinct layers, ensuring a clean separation between backend services and frontend interfaces
- Command-line tools and structured CLI design support system management and deployment flexibility
- Modular components allow for independent development and integration of features without tight coupling
- A unified API layer enables seamless data portability and user-controlled migration between instances
Tech Stack
The project is built primarily using Go, leveraging its performance and reliability for backend operations. It integrates a range of tools and libraries to support its functionality across multiple domains.
- The core is implemented in Go, utilizing the standard library and ecosystem for robust system-level operations
- Dependencies are managed through Go modules, with integration points across CouchDB and Swift storage systems
- Build automation is handled via Makefiles, while linting and code quality checks are enforced through golangci-lint
- Testing practices include unit and integration tests, supported by a structured CI/CD pipeline and code analysis tools
Code Quality
The codebase reflects a mixed quality with strong testing practices and some consistency, although signs of technical debt persist.
- Extensive test coverage is present across modules, supporting reliability and maintainability through varied testing strategies
- Error handling follows consistent patterns with structured exception management and multiple recovery mechanisms
- Code naming and structure show reasonable adherence to standards, though some deviations are evident in legacy components
- Technical debt is visible in outdated shell scripts and configuration files that may hinder long-term maintainability
What Makes It Unique
Cozy Cloud stands out by combining user control over data with a modular platform that supports multi-client experiences and extensibility.
- A unified API layer enables users to maintain ownership and portability of their data across different instances
- Multi-client support (web, mobile, desktop) is integrated within a cohesive platform without compromising performance or usability
- Modular app installation and management capabilities are supported by strong security boundaries around user data
- Developer accessibility is enhanced through consistent architectural patterns and clear separation of concerns that simplify contributions