
Deploy Nakama
Nakama 3.41 game server with Postgres, client API and admin console.
Just deployed
/var/lib/postgresql/data
nakama
Just deployed
Deploy and Host Nakama on Railway
Nakama is an open-source game server for multiplayer and social features. It provides user accounts and device authentication, realtime multiplayer, matchmaking, chat, leaderboards, tournaments, storage and in-app purchase validation, with client SDKs for Unity, Unreal, Godot, Defold, JavaScript, Swift and Kotlin. The server is written in Go.
About Hosting Nakama
This template deploys Nakama 3.41.0 with a Railway Postgres database. Migrations run before every start. The service has two public domains: the client API and realtime socket on port 7350, and the admin console on 7351. The server key, session keys, runtime HTTP key, console password and console signing key are all generated at deploy time, replacing Nakama's well-known development defaults. Custom Lua, TypeScript or Go modules need your own image built from the official one. The Hobby plan fits development and small games. Back up Postgres regularly, since it holds all player data.
Common Use Cases
- Accounts, friends, chat and leaderboards for mobile and web games
- Realtime multiplayer and matchmaking backends
- A self-hosted alternative to hosted game backend services
Dependencies for Nakama Hosting
heroiclabs/nakama:3.41.0(official image)- Railway Postgres (
ghcr.io/railwayapp-templates/postgres-ssl:18) with a volume
Deployment Dependencies
Implementation Details
| Service | Image | Networking | Storage |
|---|---|---|---|
| nakama | heroiclabs/nakama:3.41.0 | public API domain (7350) and console domain (7351) | none (state in Postgres) |
| Postgres | Railway Postgres 18 | private only | volume |
Client SDKs use the API domain on port 443 with SSL and the generated server key:
const client = new Client(process.env.NAKAMA_SERVER_KEY, "", "443", true);
const session = await client.authenticateDevice(deviceId, true);
| Variable | Default | Purpose |
|---|---|---|
NAKAMA_SERVER_KEY | generated | Key clients use to authenticate |
NAKAMA_CONSOLE_USERNAME / _PASSWORD | admin / generated | Admin console login |
NAKAMA_SESSION_ENCRYPTION_KEY / _REFRESH_KEY | generated | Session token signing |
NAKAMA_RUNTIME_HTTP_KEY | generated | Key for server-to-server RPC calls |
Notes:
- Configuration is passed as flags in the start command; add more
--flag valuepairs there. - The gRPC API (7349) is not exposed; clients use HTTP and WebSocket on 7350.
This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Nakama project or its maintainers.
Why Deploy Nakama on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Nakama on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
