Deploy Nakama

Nakama 3.41 game server with Postgres, client API and admin console.

Deploy Nakama

/var/lib/postgresql/data

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

ServiceImageNetworkingStorage
nakamaheroiclabs/nakama:3.41.0public API domain (7350) and console domain (7351)none (state in Postgres)
PostgresRailway Postgres 18private onlyvolume

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);
VariableDefaultPurpose
NAKAMA_SERVER_KEYgeneratedKey clients use to authenticate
NAKAMA_CONSOLE_USERNAME / _PASSWORDadmin / generatedAdmin console login
NAKAMA_SESSION_ENCRYPTION_KEY / _REFRESH_KEYgeneratedSession token signing
NAKAMA_RUNTIME_HTTP_KEYgeneratedKey for server-to-server RPC calls

Notes:

  • Configuration is passed as flags in the start command; add more --flag value pairs 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

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51