Install Hiro
Hiro is a game development kit that extends Nakama with powerful systems for economies, progression, social features, and more. This guide walks you through installing Hiro on your Nakama server and getting it running locally.
System requirements #
This guide assumes you’re running Nakama with Docker, which is the recommended approach for getting started quickly.
You’ll need:
- A compatible version of Nakama
- Go for building your server runtime
- Docker and Docker Compose for running Nakama locally
Compatibility matrix #
Use the following table to find the required Nakama version for your Hiro release:
Obtaining Hiro #
Hiro is available exclusively from Heroic Labs. Contact us to request access. We’ll provide you with:
- Server binaries
- Client SDKs
- License key for your project
- Access to dedicated engineering support
Install Hiro on the server #
Extract Hiro binaries #
After receiving your Hiro distribution archive (Hiro-<version>.zip), extract it to find the server binaries.
- Unzip the archive:
| |
- Copy the binary files to your Nakama server directory:
| |
You should now have files like hiro-linux-arm64.bin, hiro-darwin-arm64.bin, etc. in your project directory.
Configure Docker #
Update your Docker configuration to copy Hiro binaries into your container and set up the recommended environment.
Update your Dockerfile #
Replace your existing Dockerfile with this configuration:
| |
This Dockerfile builds your Go runtime as a plugin and copies both your code and the Hiro binaries into the Nakama container.
Update your docker-compose.yml #
Replace your existing docker-compose.yml with this recommended setup:
| |
Set up your Go runtime #
Create your server-side code that initializes Hiro and configures which systems you want to use.
Add Hiro to your Go dependencies #
Run this command to add Hiro as a dependency:
| |
Configure your license key #
Add your HIRO_LICENSE key to your local.yml config file:
| |
Replace <your-license-key> with the license key provided by Heroic Labs.
Create your main.go file #
Your main.go file needs to initialize Hiro with your license key and configure which game systems you want to use. This code will:
- Validate your license key from environment variables.
- Detect your platform and select the correct Hiro binary.
- Initialize Hiro with common game systems (base, inventory, economy, achievements, leaderboards, and stats).
Create a main.go file in your project root:
| |
Create system config files #
Hiro systems are configured using JSON files. Create these files in your project root:
base-system-dev1.jsonbase-inventory-dev1.jsonbase-economy-dev1.jsonbase-achievements-dev1.jsonbase-leaderboards-dev1.jsonbase-stats-dev1.json
For now, create empty JSON objects in each file:
| |
You’ll configure these files later based on your game’s requirements. See the individual system documentation for configuration options.
Download dependencies and build #
Install all Go dependencies:
| |
Build and run your server with Docker Compose:
| |
The first build takes a few minutes. Docker will:
- Build your Go plugin
- Create the Nakama container with your code and Hiro
- Start PostgreSQL
- Run database migrations
- Start Nakama
Verify installation #
You’ll know Hiro is installed correctly when you see logs like these:
| |
These logs show that Hiro’s RPC functions are registered and ready to use.
Test your server is responding:
| |
You should see a JSON response with Nakama server information.
Install Hiro client SDKs #
After setting up Hiro on your server, you’ll need a client SDK to connect to it from your game. Hiro provides client SDKs for multiple platforms:
| Platform | Description | Documentation |
|---|---|---|
| Unity | Package containing DLLs for Unity projects | Unity client |
| Unreal | Plugin for Unreal Engine with full C++ and Blueprint support | Unreal client |
| C++ | Cross-platform C++ library for custom engines | C++ client |
| TypeScript | TypeScript library for web and Node.js | TypeScript client |
| Dart | Dart client library for Flutter and Dart applications | Dart client |
| Godot | Client for Godot Engine projects | Godot client |
| Python | Client for Python projects | Python client |
Post installation #
Upgrade Hiro #
To upgrade to a new version of Hiro:
Download the new Hiro release from Heroic Labs.
Replace the binary files in your server project:
1cp Hiro-<new-version>/server/hiro*.bin /path/to/your/nakama-project/Update your Go dependency to match the server version:
1go get github.com/heroiclabs/hiro@v<hiro-version>Check the version compatibility table in the System requirements section to see which Nakama version your new Hiro version requires
Update your
Dockerfileto use the matching Nakama version:1 2 3FROM heroiclabs/nakama-pluginbuilder:<nakama-version> AS builder # ... FROM heroiclabs/nakama:<nakama-version>Download updated dependencies:
1go mod vendorUpgrade your client SDK to the matching version using the same installation process as before
Rebuild and run your server:
1docker compose up --build
Upgrade on Heroic Cloud #
If you’re using Heroic Cloud for hosting:
- Push your latest code to your repository.
- Go to your builder’s edit page in Heroic Cloud.
- Select the matching
Nakama Imageversion from the dropdown. - Click Update.
- Run a new container build.
Next steps #
Now that Hiro is installed, here’s what to do next:
Configure your game systems to populate the JSON configuration files with your game’s economy, achievements, and other system settings.
Explore sample projects for complete ready-to-run examples that demonstrate Hiro in action.
