Self-Hosting Open Historia

Run your own grand strategy game server — completely offline, on your LAN, or accessible to friends over the internet.

Why Self-Host?

Open Historia is a self-hosted grand strategy game built on Node.js. There are no central game servers, no accounts, and no cloud dependencies — everything runs on your own machine.

Quick Setup: Self-Hosting in 3 Steps

Step 1 — Install Open Historia

First, get the game installed on the machine that will act as your server. Use the launcher script for your platform, or follow the manual setup. The server machine needs Node.js — client players only need a browser or the Android APK.

Step 2 — Start the server

In the project directory, run the launcher script for your platform:

The server will start on port 3000.

Step 3 — Connect players

Players connect by opening a browser and navigating to the server's address:

For remote play over the internet, you'll need to either:

Going Offline

Once installed and built, Open Historia runs entirely offline — no internet connection needed. The game logic, map rendering, scenario data, and the entire UI are all local.

Connecting an AI backend for diplomacy and events requires a local LLM (see the AI setup guide), but the game is fully playable without AI as a pure strategy sandbox with the map editor and scenario system.

CORS Configuration

By default, the server only accepts write operations (save, create, delete) from the same origin. If you're connecting from a different device on the network, set the environment variable to allow cross-origin requests:

OH_ALLOW_CROSS_ORIGIN=1 node server/server.js

This is safe for LAN and private networks. For public internet hosting, consider putting the server behind a reverse proxy like nginx or Caddy.

Running as a Service

Linux (systemd)

Create a systemd service file at /etc/systemd/system/open-historia.service:

[Unit]
Description=Open Historia Game Server
After=network.target

[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/open-historia
ExecStart=/usr/bin/node server/server.js
Restart=on-failure
Environment=PORT=3000

[Install]
WantedBy=multi-user.target

Then enable and start: sudo systemctl enable --now open-historia

Windows (Task Scheduler)

Use Task Scheduler to run node server/server.js at system startup with the "Run whether user is logged on or not" option.

macOS (launchd)

Create a plist file in ~/Library/LaunchAgents/ to run the server as a background daemon.

Related Guides

Play Open Historia