Nakama is a production-ready, open-source game backend server designed for developers building multiplayer, social, and real-time games. It handles user authentication, storage, chat, leaderboards, tournaments, and real-time multiplayer matchmaking — eliminating the need to build these systems from scratch. Built in Go and compatible with CockroachDB or PostgreSQL, it supports a wide range of game engines including Unity, Unreal, Godot, and more.
Nakama offers multiple protocols (gRPC, REST, WebSockets, rUDP) and runs on any cloud platform or via Docker. Its embedded dashboard, extensible runtime with Lua/TypeScript/Go, and managed cloud option (Heroic Cloud) make it suitable for indie developers and AAA studios alike, providing full control over game data and server logic.
What You Get
- User Authentication - Register and log in users via email, device ID, social networks (Facebook, Google, Apple), and custom authentication systems with JWT token issuance.
- Distributed Storage - Store and query user records, game settings, and custom objects in collections with JSON-based schemas and access controls.
- Realtime Chat - Enable 1-on-1, group, and global chat with message persistence, read receipts, and real-time delivery over WebSockets or gRPC.
- Multiplayer Matchmaking - Build turn-based or real-time multiplayer sessions with automatic player matching, party systems, and session management.
- Dynamic Leaderboards - Create unlimited leaderboards with seasonal, global, or friend-based rankings and retrieve top players or players around a user.
- Tournaments & Leagues - Set up competitive events with entry rules, prize structures, and multi-stage tournaments linked into leagues for long-term engagement.
- In-App Notifications - Push real-time messages to connected clients via socket channels for events, rewards, or alerts without polling.
- Purchase Validation - Validate in-app purchases and subscriptions from Apple App Store, Google Play, Amazon, and Steam with server-side receipt verification.
- Runtime Code Extensions - Extend server logic with Lua, TypeScript/JavaScript, or native Go modules to customize game mechanics, economy systems, or event triggers.
- Embedded Dashboard (Nakama Console) - Web-based UI to inspect player data, manage storage objects, view metrics, explore APIs, and configure permissions — no separate install needed.
- Cross-Platform Client SDKs - Official libraries for Unity, Unreal, Godot, JavaScript, C#, Java (Android), Swift (iOS), and Defold with full documentation.
- CockroachDB/PostgreSQL Support - Uses distributed SQL databases for high availability, scalability, and ACID compliance in production environments.
Common Use Cases
- Building a social mobile game with in-app purchases - A mobile developer uses Nakama to handle user accounts, validate Apple/Google purchases, store player progress, and send real-time notifications for daily rewards.
- Creating a competitive multiplayer shooter with leaderboards - A studio implements Nakama to manage real-time matchmaking, track global and friend-based leaderboards, and run seasonal tournaments with prizes.
- Adding chat and friend systems to a casual merge game - A developer integrates Nakama’s social graph and group chat into Merge Dragons to enable players to connect, share progress, and compete.
- Scaling a VR multiplayer adventure game - A VR studio deploys Nakama on Heroic Cloud to handle 10,000+ concurrent users, manage player inventories, and support real-time voice and text chat in a persistent world.
Under The Hood
Architecture
- Modular monolith design with clearly bounded contexts separating server core, console UI, and migration tooling via Go packages
- Dependency injection through constructor-based patterns with explicit interfaces for database and logging abstractions
- gRPC and REST APIs unified via protobuf contracts, with generated code serving both internal RPC and external HTTP endpoints
- Runtime extensibility enabled by Lua VM integration and dynamic Go module loading, allowing plugin-like behavior without tight coupling
- Database agnosticism achieved through a unified adapter layer supporting PostgreSQL and CockroachDB with shared migration scripts
- Observability concerns like health checks, metrics, and logging are decoupled as cross-cutting services with standardized interfaces
Tech Stack
- Go-based backend leveraging a custom framework with gRPC and Protobuf, built with modern Go versions for performance and reliability
- Primary data stores include PostgreSQL and CockroachDB, both supported with built-in migrations and health monitoring
- Docker Compose orchestrates multi-environment deployments with official images for databases and metrics collection
- Comprehensive testing infrastructure includes race detection, code linting, and Lua-based game logic validation
- Prometheus integrates seamlessly for real-time metrics, complemented by an embedded health endpoint and automated deployment pipelines
- EditorConfig and Makefile conventions enforce consistent formatting across code, SQL, and configuration files
Code Quality
- Extensive test coverage spanning unit, integration, and edge cases with robust assertions and custom validation helpers
- Clear modular structure with well-defined boundaries between server components, runtime modules, and data structures
- Strong type safety and explicit error handling using standard Go patterns, with structured logging for traceability
- Descriptive, domain-aligned naming conventions enhance readability and reduce cognitive load
- Robust failure handling ensures meaningful error propagation without panics or silent failures
- Linting and testing are deeply integrated into the development workflow, validating both success and failure scenarios
What Makes It Unique
- Native Lua scripting for server-side game logic enables dynamic, real-time modularity without external dependencies
- Integrated real-time matchmaker with customizable rules and leaderboards, tightly synchronized with the database for low-latency multiplayer
- Unified authentication system supporting social logins, custom JWT, and device IDs within a single RPC framework
- Protocol buffer-based RPC with bidirectional streaming optimized for mobile and constrained network environments
- Embedded console UI with live debugging and metrics, accessible via HTTP without external tools
- Distributed cluster architecture with automatic discovery and sharding designed for seamless cloud-native scaling