Unreal Engine Multiplayer Backend: How to Connect Nakama for Scale


Add accounts, matchmaking, and persistence to your Unreal game with the open-source Nakama SDK, then scale past built-in networking.
Unreal ships with a capable networking framework, and actor replication keeps the server and its clients in sync during a match. That handles the session. It does not handle what happens between sessions. You still need player accounts, saved progress, and matchmaking that outlive a single match. Those live on a server that stays up after the match ends. That server is your Unreal Engine multiplayer backend, and this guide shows you how to set one up with Nakama.
What is the best Unreal multiplayer backend?
The best Unreal multiplayer backend is the one that owns the persistent layer your engine does not, then hands you the source and the data. No single product wins for every game. You pick by the shape of your team and how much control you need.
Three archetypes cover the field. An open-source self-host stack runs on your own infrastructure and gives you the code to change. A managed game backend as a service hides the servers and trades some control for speed. An engine-tied cloud bundles backend features with one engine and keeps you inside it.
We built Nakama, our open source game backend, as the answer. It is a multiplayer game backend you can read, fork, and run anywhere, under the Apache 2.0 license. More than 1M developers build on it, from small studios to publishers shipping at scale. Games on the platform bring in more than $5B in annual games revenue, and Nakama serves over 1T requests a month. It is proven at 2M+ peak CCU. When you want the managed path, we run it for you, and the source still stays yours.
Authoritative vs relayed multiplayer in Unreal
Nakama runs two match types, and the choice sets who owns the game state. In an authoritative match, your server runs the game loop and validates every input before broadcasting state to players. In a relayed match, one client drives the state and Nakama forwards messages to the rest without inspecting them. Server authoritative multiplayer buys you anti-cheat and control. Client authoritative multiplayer buys you the lowest overhead for trusted clients.
| Model | Authority | Latency | Anti-cheat | When to use |
|---|---|---|---|---|
| Authoritative | Server runs the game loop and validates input | Server hop, one tick at the 1 to 60 Hz rate you set | Strong, the server rejects bad input | Competitive play and higher player counts |
| Relayed | One client owns state and the server relays | Lower, the server forwards messages without simulating them | Weak, clients are trusted | Co-op and social with trusted clients |
You set the tick rate on an authoritative match, from 1 to 60 Hz. Fast action runs high. Turn-based runs low. Relayed matches have no server tick; Nakama forwards data immediately. A single Nakama node can run hundreds or thousands of matches at once, depending on the gameplay.
How to add a backend to Unreal Engine
Add a backend to Unreal Engine by installing the SDK and connecting it to a Nakama server. From there you call the server for auth, matchmaking, and storage.
Before you start, have these ready:
- Unreal Engine 4.25 or later, or Unreal Engine 5. The same C++ plugin covers both.
- A C++ toolchain so the editor can rebuild after you drop the plugin in.
- Docker. Follow the Docker Compose install so a local Nakama server is listening at
127.0.0.1:7350, with the console at127.0.0.1:7351.
The Unreal multiplayer backend setup is six steps:
- Install the Nakama Unreal SDK and start a local server
- Create a client and open a realtime socket
- Authenticate players and manage sessions
- Match players with the matchmaker
- Persist progress with the Storage Engine
- Scale to production
Step 1: Install the Nakama Unreal SDK and start a local server
Grab the plugin from the Nakama Unreal SDK releases on GitHub. This is our Unreal Engine SDK for Nakama, a C++ plugin with full Blueprint access. Copy the Nakama folder into your project’s Plugins directory, restart the editor, then enable HeroicLabs.Nakama from the Edit menu under Plugins. This is the fastest Unreal multiplayer setup path: those few files plus a rebuild.
You still need a server to talk to. Start Nakama locally with the Docker Compose install. When it is up, the server listens at 127.0.0.1:7350 and the console is at 127.0.0.1:7351. Point the client at a hosted cluster later.
Step 2: Create a client and open a realtime socket
Build one Nakama client with your server key, host, and port. On the local Docker server from Step 1, that is 127.0.0.1 on port 7350. Keep a single client per server for the whole game. Open a realtime socket from that client for latency-sensitive features like matches, parties, and chat. Then connect it. The socket carries the real-time traffic. The client handles request and response calls like login and storage. Keep the client on a long-lived actor or subsystem so your whole game shares one connection.
Step 3: Authenticate players and manage sessions
Authenticate to create a session, and Nakama creates the account on first login when you ask it to. The SDK supports device, custom, and social sign-in. It also handles console sign-in for Sony, Microsoft, and Nintendo platforms. A session is a portable object that holds the tokens, the user data, and the expiry. Store it, restore it, and refresh it before it expires, so returning players skip the login wall. Device auth gets players in fast. Link email or a social account later so progress survives a new phone.
Step 4: Match players with the matchmaker
Use the Nakama matchmaker to add players to a pool and pair them on your rules. Matchmaking finds players, and joining the match is a separate step, so you can reuse it for lobbies or social features. The flow is short.
- Add a player to the pool with your criteria, like two to ten players at a set skill level. A shooter queues four players of similar rank.
- Wait for the matched event that Nakama sends when the pool has a fit. Your lobby UI shows the found opponents.
- Join with the match token or match ID from the matched event, then open your gameplay scene. The four players load into the arena.
- Exchange match state over the socket as the match runs. Positions and shots stream to every client.
Start with simple criteria, then add desired and optional properties as your player base grows.
Step 5: Persist progress with the Storage Engine
Save player data with the Nakama Storage Engine, a document store built into the server. Data lives in named collections as JSON under a key and a user id, and each player owns their objects by default. Read and write from the Unreal client, or lock writes to server code when a value must be trusted, like currency or inventory. Conditional writes stop two devices from overwriting the same save.
| Kind | Who writes it | Example |
|---|---|---|
| Client-owned | The Unreal client | Cosmetics, settings, a favorite loadout |
| Server-owned | Server runtime code | Currency, inventory, unlocks |
| Public-read | Owner writes, anyone reads | A profile card or post-match stats |
Keep cosmetics and settings client-owned, and move economy state to server-authoritative writes.
Step 6: Scale to production
Point the same client at a production server, and nothing in your Unreal code changes. Prototype and run on open-source Nakama. When one node is no longer enough for a launch spike, Nakama Enterprise adds node clustering and high availability. Heroic Cloud is the managed path for larger studios, publishers, and enterprise teams. It gives you production ops and compliance like SOC 2 Type II without rewriting the stack, and it is the choice when live traffic and uptime matter.
| Option | Who runs ops | Getting started | Scaling and regions |
|---|---|---|---|
| Self-host Nakama | You run and monitor | Local start with Docker | One node; scale the machine |
| Nakama Enterprise | You run and monitor | Same API, clustering license | Node clustering, HA, multi-region |
| Heroic Cloud | We run and monitor for you | Deploy to a managed cluster | Managed scaling, multi-region on AWS or GCP |
That is the enterprise game backend route when you would rather ship than run infrastructure.
Own your Unreal backend
Own your backend and your data from the first commit, and let Nakama carry the scale. Start with the Nakama Unreal SDK and connect your first match.
FAQ
Does the Nakama Unreal SDK work with Unreal Engine 5?
Can I use Nakama with Blueprints instead of C++?
Do I have to self-host Nakama for Unreal?
Is the Nakama Unreal SDK free?
Enterprise game backends
See how studios ship multiplayer at scale without rebuilding infrastructure.
Walk through Nakama and Heroic Cloud: org-level access control and managed ops without rewriting your stack. Book a demo to see it in action.
- SOC 2 Type II certified
- Proven at 2M concurrent users
- Dedicated capacity, no CCU limits
