Get SpatialOS

Sites

Menu

Deploying locally

After setting up your project, you can run a local SpatialOS deployment. This runs your game, along with a local version of SpatialOS (which will run your server-side workers).

This creates a similar environment to the one used for deployments in the cloud. For information about running a cloud SpatialOS deployment, see Deploying to the cloud.

From the command line

To run a local SpatialOS deployment from the command-line, from a terminal in the root directory of your project, run spatial local launch. This assumes you have a default launch configuration file (default_launch.json).

Alternatively, run spatial local launch <launch configuration>, where

  • launch configuration specifies the launch configuration file you want to use. For example, development.json. For information about this file, see the launch configuration page.

Run spatial local launch --help for more information.

When SpatialOS starts successfully, you should see SpatialOS ready in the console. At this point, you can access the Inspector at http://localhost:21000/inspector.

From Unity

  1. In the Unity Editor, open the SpatialOS window (Window > SpatialOS).
  2. Under Run SpatialOS locally, click Run.

    This opens a console running spatial local launch.

When SpatialOS starts successfully, you should see SpatialOS ready in the console. At this point, you can access the Inspector at http://localhost:21000/inspector.

Stop a local deployment

When spatial local is running, use Ctrl + C to stop it.

Run workers from the command line

To manually run a worker locally, use spatial local worker launch <worker type> <launch_config>, where

  • worker type: the type of the worker. For example, UnityClient.
  • launch_config: the launch configuration file.

Run spatial local worker launch --help for more information.

For example, to start a UnityClient using the default launch configuration, run

spatial local worker launch UnityClient default

When successful, you will see the new Unity client worker at http://localhost:21000/inspector.

Next

Connect an external worker.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums