Nakama is an open-source, distributed backend server designed specifically for social and real-time multiplayer games and applications. It provides a comprehensive suite of features including user authentication, storage, chat, leaderboards, tournaments, and real-time multiplayer matchmaking—all in a single, scalable system. Built in Go and compatible with major game engines like Unity and Unreal Engine, Nakama eliminates the need to build custom backend infrastructure for multiplayer functionality. It’s ideal for game studios and app developers who want a production-ready solution that handles user data, social graphs, and real-time communication without managing complex distributed systems from scratch.
The server supports multiple protocols including gRPC, REST, WebSockets, and rUDP to accommodate diverse client needs. With an embedded web-based dashboard for monitoring and managing player data, runtime code extensibility via Lua, TypeScript/JavaScript, or Go, and seamless deployment options via Docker or native binaries, Nakama reduces time-to-market for multiplayer features while maintaining high reliability and scalability.
What You Get
- Users - Register and authenticate users via social networks (Facebook, Google), email/password, device IDs, or custom authentication systems with built-in account linking.
- Storage - Store and query user-specific data (settings, inventory, progress) in collections using a flexible JSON-based schema with access controls and versioning.
- Social - Build social graphs where users can connect as friends, join groups, and discover connections between players with automatic relationship tracking.
- Chat - Real-time 1-on-1, group, and global chat with message persistence, read receipts, and offline delivery for seamless communication across platforms.
- Multiplayer - Support for both real-time (low-latency) and turn-based multiplayer sessions with automatic matchmaking, session management, and state synchronization.
- Leaderboards - Create dynamic, seasonal, or global leaderboards with customizable sorting, pagination, and retrieval of rankings around a specific user.
- Tournaments - Organize competitive events with entry rules, prize structures, and multi-stage progression; link tournaments to form leagues for extended engagement.
- Parties - Enable team-based play by allowing users to form parties, invite members, and communicate within private group channels.
- Purchase Validation - Validate in-app purchases from Apple App Store, Google Play, and other platforms with receipt verification and fraud prevention.
- In-App Notifications - Send real-time notifications to connected clients via WebSocket or HTTP, enabling push-style updates without polling.
- Runtime Code - Extend server behavior with custom logic using Lua, TypeScript/JavaScript, or native Go modules—triggered by events like user login or match start.
- Matchmaker - Automatically pair players based on skill, region, latency, or custom criteria with configurable rules and queue management.
- Nakama Console - Embedded web UI for inspecting player data, managing storage objects, viewing metrics, exploring APIs, and configuring permissions—all without external tools.
Common Use Cases
- Building a multiplayer mobile game with social features - A studio developing a battle royale mobile game uses Nakama to handle user registration via Facebook, store player stats and inventory in collections, manage real-time matches with matchmaking, and display leaderboards updated every 5 minutes.
- Creating a social AR app with persistent chat - A developer building an augmented reality experience enables users to form groups, share AR objects via storage, and communicate in real-time using Nakama’s group chat system with message history.
- Problem: Managing backend complexity for indie game devs → Solution: Nakama’s all-in-one server - Indie developers often spend months building user auth, storage, and multiplayer systems. Nakama provides these features out-of-the-box with minimal configuration, reducing backend development time from weeks to days.
- Team: DevOps teams managing cross-platform games - Teams supporting Unity (mobile), Unreal (PC/console), and web clients use Nakama’s unified backend to serve all platforms with consistent APIs, reducing duplication and ensuring data consistency across devices.
Under The Hood
Nakama is a scalable backend platform tailored for real-time multiplayer games and social features, offering a robust infrastructure that supports game logic customization through embedded scripting. It combines a Go-based core with extensible components to enable flexible and high-performance game server solutions.
Architecture
Nakama follows a monolithic yet modular architecture designed for game backend services, with well-defined responsibilities for session management, match-making, and storage.
- Core modules are organized around distinct functional areas such as tracking, streaming, and leaderboard systems
- Design patterns like strategy and observer are applied to manage component interactions effectively
- Clear separation of concerns enables scalable growth while maintaining system coherence
Tech Stack
The project is built in Go and leverages a suite of modern tools and protocols to support real-time communication and data handling.
- Uses gRPC and protobuf for API definitions and inter-service communication
- Integrates PostgreSQL for data persistence and Lua scripting for customizable game logic
- Employs buf, Docker Compose, and Go modules for development and deployment workflows
- Comprehensive testing includes unit, integration, and Lua script validation
Code Quality
Code quality reflects a mature Go project with consistent patterns and some areas of technical debt.
- Error handling follows idiomatic Go practices, though consistency varies across modules
- Testing is present but not uniformly applied across all components
- Type annotations and structured code organization support maintainability
- Legacy modules show signs of accumulated technical debt that impacts long-term scalability
What Makes It Unique
Nakama distinguishes itself through its unique blend of backend infrastructure and embedded scripting capabilities.
- Deep integration of Lua scripting allows developers to customize game logic without recompiling the core system
- Combines traditional game development workflows with modern scalable backend architecture
- Offers extensibility through plugins and custom modules that enhance real-time multiplayer features