# Package your game

> Turn your Minecraft server image into a versioned Package you install with one command and share with one link, with settings owners can change and updates that reach a running world only when its owner chooses.

Package your game once and install it on any Akua Cluster: on your own network, or for every server owner you share it with. A Package holds your server image, the settings owners may change, and a version number. Akua turns the settings into an install form, and a running world changes only when its owner updates it.

## Build the server image

Build a container image with the server software and plugins your game needs, and push it to your registry. Include the [Connect plugin](https://connect.minekube.com/guide/connectors/plugin) and leave its endpoint name unset, so every copy picks its own public address without an open port. Keep the world and the plugin's config directory on a mounted volume, so the address and the save survive restarts and updates. For a private registry, see [Private images](https://docs.akua.dev/private-images).

## Describe the settings

Keep the Package manifest (`akua.toml`) and its KCL program (`package.k`) next to the game; `akua pkg init` creates both. Declare what owners may change in the typed `Input` schema, for example the message of the day as a string and the game mode as a fixed set of choices:

```py title="package.k"
type Mode = "survival" \
    | "creative" | "adventure"

schema Input:
    motd: str = "Paper on Akua"
    """Shown in the server list."""
    game_mode: Mode = "survival"
    max_players: int = 10

    check:
        1 <= max_players <= 50, \
            "max_players: 1 to 50"
```

Each field becomes a field of the install form, and `check` refuses a value outside the range. Use those inputs when building the workload and its volume, and pin the image version. The [Package format](https://docs.akua.dev/akua/package-format) has the full syntax. If you already have a Helm chart, [Packages](https://docs.akua.dev/packages) shows how to publish it instead.

## Check and publish

From the Package directory, in the Workspace that owns the game, run:

```sh
akua pkg check
akua pkg publish
```

Each version number is published once and never changes. Install the new version on your own Cluster, join the game, change a setting and check that the world survives an update. See [Publish a Package privately](https://docs.akua.dev/packages#publish-a-package-privately) for repository and release settings.

## Publish from your CI

The same commands run in any CI system, such as GitHub Actions. Give the job a Workspace API token in `AKUA_API_TOKEN` and the Workspace in `AKUA_WORKSPACE`, then on each release:

1. Build and push the game image.
2. Run `akua pkg check` and `akua pkg publish` for the Package version that references it.
3. Optionally move your own test or production Install to the new version with `akua installs update`.

See [CLI](https://docs.akua.dev/cli) for installing and authenticating the CLI in automation.

## Update a running world

Publishing never changes a running Install. Its owner moves it to a newer version when they are ready, with `akua installs update`; the Install keeps its address, its settings and its world volumes. Keep volume names and data formats compatible between versions, because Akua does not migrate the data inside a volume. [Update an installation](https://docs.akua.dev/installs/lifecycle#update-an-installation) shows the exact command.
