# Deployment Process

This chapter describes the process of deploying an [ApplicationInstance](/game-hosting/elements/application/applicationinstance.md).

## Prerequisites

Before an ApplicationInstance can be deployed, you must first create a [Deployment Configuration](/game-hosting/processes/deployment-configuration.md). This ensures you have a [DeploymentEnvironment](/game-hosting/elements/deploymentenvironment.md) with [Fleet](/game-hosting/elements/deploymentenvironment/fleet.md)s and [Region](/game-hosting/elements/deploymentenvironment/deploymentregion.md)s. Hosts (bare metal servers in your account or VMs) onto which ApplicationInstances are deployed will automatically become part of a region based on their geographical location.

Here is a schematic overview of the resulting structure:

![](/files/1FiVT4ylN0qhU5OhUM5P)

Figure 1: Deployment (environment) structure with ApplicationInstances

## Manual deployments

ApplicationInstances will normally be deployed dynamically and automatically by the platform. You can however deploy them manually as well, e.g. if you just want to test a build.

Manually deploying new ApplicationInstances is a two-step process:

### Creating the instance entity

The first step into deploying a new ApplicationInstance is to create an entity for it. From that moment on it exists in our system (but is not yet deployed):

[`POST /v3/applicationInstance/fleet/{fleetId}/host/{hostId}`](/api/api_one.md#v3-applicationinstance-fleet-fleetid-host-hostid)

JSON request data [ApplicationInstance](/game-hosting/elements/application/applicationinstance.md):

```
{
  "labelPublic": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "metadata": [
    {
      "key": "string",
      "value": "string"
    }
  ]
}
```

Parameter `fleetId` can be obtained from [GET /fleet](/api/api_one.md#v3-fleet)\
Parameter `hostId` can be obtained from [GET /host](/api/api_one.md#v3-host)

[`labelPublic` usage explained](/game-hosting/elements/application/label.md)\
[`metadata` usage explained](/game-hosting/elements/application/metadata.md)

### Deploying a software build

With the entity created, you can now deploy an [ApplicationBuild](/game-hosting/elements/application/applicationbuild.md) for it:

[`POST /v3/applicationInstance/{applicationInstanceId}/deploy`](/api/api_one.md#v3-applicationinstance-applicationinstanceid-deploy)

JSON request data:

```
{
  "applicationBuildId": {applicationBuildId}
}
```

Parameter `applicationInstanceId` is the ID of the previously created ApplicationInstance.\
Parameter `applicationBuildId` can be obtained from [GET /applicationBuild](/api/api_one.md#v3-applicationbuild)

This call will trigger the [deployment process](#the-deployment-process) for the ApplicationInstance.

## Automatic deployments

ApplicationInstances are normally deployed automatically by the platform. This would at least be the case for the live environment of your game. For this to happen, all you have to do is enable automatic deployment and / or automatic scaling in the Fleet(s) created for your live environment. Please see the [Fleet's Operational Status](/game-hosting/elements/deploymentenvironment/fleet.md#operational-status) documentation.

For the complete documentation on automatic deployment and scaling, please see the [Automatic Deployment](/game-hosting/processes/automatic-deployment.md) chapter.

## The deployment process

Below is a schematic overview of the (automatic) deployment process for an ApplicationInstance:

![](/files/djZQ6NY9JMTuTrMwL5CO)

Figure 2: ApplicationInstance deployment process

The default `installPath` and `instancesPath` on Linux are:

* installPath: /home/gameinstalls
* instancesPath: /home/gameinstances

The default `installPath` and `instancesPath` on Windows are:

* installPath: C:\localuser\gameinstalls
* instancesPath: C:\localuser\gameinstances


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/game-hosting/processes/deployment-process.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
