s&boxNetwork Storage

Any host.
Your server runs the rules.

The open-source game backend for s&box. Let players host or run dedicated servers: purchases, rewards, XP and combat results are checked by your Network Storage server before they are saved, using the same game values your game reads.

  • Open source, AGPL-3.0
  • No signup or subscription
  • SQLite or PostgreSQL
  • Free HTTPS name

Try it: who decides?

Player 7656…7705
Inventory: Potion
240gold
  • Send a request to see what the server decides.

An illustration in your browser: it mirrors the endpoint rules and error codes, but it is not your server and certifies nothing.

Owner console: the finish-combat endpoint with eight steps, combat rules in game values YAML, and a dry run that rejects TOO_MANY_HITS
The real owner console: a combat endpoint, the game values it checks against, and a dry run rejecting an impossible kill.

Install in one command

On a Linux VPS or a Mac, the installer creates a project and API keys, gets a free HTTPS name and starts the service.

  • Checks the download against the release SHA256SUMS
  • Free name under sboxns.com, or your own domain
  • Prints your project ID, keys and HTTPS address
Full install guide

Public IP

curl -fsSL https://github.com/sbox-cool/sbox-network-storage-server/releases/latest/download/install.sh \
  | sudo env SBOX_NS_PROJECT="My Game" SBOX_NS_DNS=1 \
      SBOX_NS_ACME_EMAIL="you@example.com" SBOX_NS_ACCEPT_LETSENCRYPT_TERMS=1 sh

For a Linux VPS, or a Mac with public or port forwarded ports 80 and 443. Your name looks like NAME.n1.sboxns.com and players connect straight to your IP. SBOX_NS_ACCEPT_LETSENCRYPT_TERMS=1 accepts the Let's Encrypt subscriber agreement; the email is the certificate contact.

Sign in to the dashboard
sudo sbox-ns admin login-link
Check the server
sudo sbox-ns doctor
Print credentials again
sudo sbox-ns quickstart "My Game"

One backend. Any host.

Your game servers stay thin. Whether a player hosts the session or you run a dedicated box, currency, XP, items and scores change through endpoints on your Network Storage server when collections are set to endpoint access.

Hosting models

Player-hosted

A player runs the listen server from their own game. It only holds the public key, so it can call public endpoints but not dedicated-only endpoints or the management API. The cheapest way to start; the rules still run on your backend.

Public key

Dedicated

Your own box runs the game server with a secret key. It can call dedicated-only endpoints and the management API. Use it for tournaments, seasons and anything worth protecting.

Secret key

Hybrid

Players host day-to-day sessions while your dedicated box runs special modes. One project serves both: public endpoints for everyone, secret-key endpoints for your box.

Both

The dashboard's authority check lists any game data a client could still change directly, so you close the gaps before players find them.

Game values: one set of numbers for game and server

Define weapons, items, prices and tuning once. Your game loads them in one call and shows them instantly; your endpoints check claims against the same numbers.

Game values guide

Predict on the client, check on the server

Show a zombie's health as 20 × level before the fight. The endpoint computes the same number from the same value and rejects a kill that does not add up.

Versioned with every build

Publishing a build snapshots its game values. Players on a supported previous build keep theirs, so new items do not reach builds that cannot load them. Or push straight to live; supported snapshots are not overwritten.

One request, then instant

Load the whole item catalog when the game starts. Lookups after that are local: no round trip per item, no lag, less load on your server.

Change a value live

Edit them in your dashboard or over the API. Live requests use the new numbers at once, with no game update; builds pinned to a supported older revision keep theirs.

Game values (YAML)
items:
  - id: combat
    type: group
    entries:
      zombie_hp_per_level: 20
      max_clock_skew_ms: 2000
  - id: weapons
    type: table
    columns:
      - key: weapon_id
        type: string
      - key: damage
        type: number
      - key: fire_interval_ms
        type: number
    rows:
      - weapon_id: pistol
        damage: 15
        fire_interval_ms: 300
      - weapon_id: shotgun
        damage: 45
        fire_interval_ms: 900
In your game (C#)
var gv = await NetworkStorage.GetGameValues();
if ( !gv.HasValue ) return;
var combat = gv.Value.GetProperty( "groups" )
    .GetProperty( "combat" ).GetProperty( "values" );

// Predict before the fight; the server checks the same number
int zombieHp = combat.Int( "zombie_hp_per_level" ) * zombieLevel;

var weapons = gv.Value.GetProperty( "tables" ).GetProperty( "weapons" )
    .ReadList( "rows", r => (Id: r.Str( "weapon_id" ), Damage: r.Int( "damage" )) );

Game values are read-only from game code. Change them in your dashboard, over the API, or with a coding agent you allow.

Build the economy once. Enforce it everywhere.

Collections hold the data and endpoints hold the rules. Both are YAML you push from the s&box editor or write in the dashboard.

Shops, crafting and inventories

Prices live on your server in game values. The endpoint looks up the price, checks the balance, then charges and adds the item in one write.

  • The game sends an item id, never a price
  • Gold is a ledger field: every change records a reason
  • INSUFFICIENT_GOLD returns before anything is written
YAML Source reference
endpoints/purchase-item.endpoint.yml
kind: endpoint
id: purchase-item
method: POST
input:
  type: object
  properties:
    item_id:
      type: string
steps:
  - id: player
    type: read
    collection: players
    key: "{{steamId}}"
  - id: item
    type: lookup
    source: values
    table: shop_items
    where:
      field: item_id
      op: "=="
      value: "{{input.item_id}}"
  - id: can_afford
    type: condition
    check:
      field: player.gold|0
      op: ">="
      value: "{{item.cost}}"
    onFail:
      status: 400
      error: INSUFFICIENT_GOLD
  - id: pay_and_add
    type: write
    collection: players
    key: "{{steamId}}"
    ops:
      - op: inc
        path: gold
        valueExpression: "0 - {{item.cost}}"
        reason: "Purchased {{item.name}}"
      - op: push
        path: inventory
        value:
          item_id: "{{input.item_id}}"

Built for agents. Designed for old builds.

A modern backend that coding agents can operate, designed to keep the games already in players' hands running.

Agent-driven development

sbox-ns mcp gives Claude Code, Cursor and other coding agents the tools you have: set up the server, write and dry-run endpoints, read request logs, errors and records.

  • Runs over SSH or locally on stdio. Nothing new listens on the network.
  • Read-only by default. Definition writes, data writes and deletes are each opt-in.
  • JSON output from every CLI command, and a Claude Code plugin with setup and debugging skills.
claude mcp add sbox-ns -- ssh my-vps sudo sbox-ns mcp
Coding agents guide

Modern backend, existing games

One self-contained .NET binary with SQLite or PostgreSQL. Point the existing Network Storage library at your URL; game code does not change.

  • Server updates keep published builds working within their support window.
  • Replaced API forms stay supported for at least six months, with 90 days' notice.
  • Published revisions are kept while supported, so older builds run their own definitions.
NetworkStorage.Configure(
    "YOUR_PROJECT_ID",
    "sbox_ns_YOUR_PUBLIC_KEY",
    "https://YOUR_HOSTNAME" );
Compatibility policy

A dashboard built around your data

Collections open on their records. Settings, keys and deletes sit one click away instead of in your way. The theme follows your system, or pick one.

Explore the live demo

Questions

More in the documentation and on GitHub.

Can players cheat their currency or items?

Network Storage limits this when game data stays behind endpoints. Collections set to accessMode: endpoint refuse direct writes from game clients with ENDPOINT_ONLY, and changes go through endpoint steps that run on your server: balance checks, prices from game values, once-per-day conditions, combat checks against weapon stats and the server clock. These checks bound what a client can claim; they cannot prove a hit landed or rule out every kind of cheating.

A player host only ever holds the public key, so it cannot call dedicated-only endpoints either. The dashboard's authority check lists any data a client could still change directly.

What are game values?

Named numbers and tables that your game and your server both read: weapon damage, item catalogs, prices, drop rates and reward amounts. Edit them in your server's dashboard or set them over its API.

The game loads every group and table with one NetworkStorage.GetGameValues() call; endpoints read the same numbers with {{values.*}}, so the client can predict a result and the server checks the claim against the same numbers.

What happens to older builds when I change game values?

Publishing a build snapshots its endpoints, collections and game values. Builds still in players' hands keep running against their own snapshot while it is inside its support window. Requests with no revision header, or with an unknown or expired revision, use live values. A missing snapshot resource can fall back to live values.

Push to staged to ship changes with your next build, or push to live to change the live values for every build not pinned to a supported snapshot. Pushing to live does not overwrite supported snapshots. Player records are always shared live data.

Player-hosted or dedicated: which should I use?

Start player-hosted: it costs nothing to run game sessions, and the rules still live on your backend. Add a dedicated server when you want tournaments, seasons or other modes worth protecting; it holds a secret key for dedicated-only endpoints. One project can serve both at once.

Do I need to change my game code?

No. Games use the existing Network Storage library for s&box. Point NetworkStorage.Configure at your server's URL with your project ID and public key. Server updates keep published game builds working within their support window, so updating the backend does not normally require republishing your game.

What does it cost?

The server is free and open source (AGPL-3.0). You pay your own VPS provider; a VPS around $5 a month can be a starting point for a small game, depending on your workload. There is no signup, subscription or required telemetry.

Which databases does it support?

SQLite by default, with no setup. Switch to PostgreSQL when you need it. Export your configuration and data at any time for backups or to move servers.

Does my server depend on sboxns.com?

Only to create your free name and to update it when your IP changes. With a public IP, players connect to you directly and Bunny DNS answers the lookup; with a tunnel, Cloudflare carries the traffic to you. If sboxcool.com goes down, your existing name keeps working. You can also use your own domain and skip sboxns.com entirely.

Where is my admin panel?

Open https://YOUR_NAME/login to sign in and /dashboard to manage your server. For the first sign-in, run sbox-ns admin login-link on the server and open its single-use link. There is no /admin/login route.

Can coding agents manage it?

Yes. sbox-ns mcp serves the Model Context Protocol over stdio, locally or through SSH, for Claude Code, Cursor and other agents. Agents can read everything; saving definitions, writing player data and deleting are each off until you turn them on.