Try SpatialOS

Sites

Menu
These are the docs for 13.1, an old version of SpatialOS. 13.2 is the newest →

Deploying locally from the command line

This page covers deploying locally using the spatial command-line tool. With our game engine integrations, you can deploy directly from the game engine editor.

This page is about local deployments. For information about cloud deployments, see Deploying to the cloud.

Deploy from the command line

To run a local deployment from the command line:

  1. Open a terminal and navigate (cd) to the root directory of your project.
  2. If you have a default launch configuration file (default_launch.json), run the command:

    spatial local launch
    

    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 and connect workers.

You can use spatial local launch to launch a local deployment offline, so you can iterate on local projects without an internet connection. For more information, see Using the spatial CLI offline for local projects.

Connect workers to the deployment

You can connect any type of worker to a local deployment from the command line, but usually you’ll just want to connect clients.

To do this, use:

spatial local worker launch <worker type> <launch_config>

where:

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

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

spatial local worker launch MyCSharpClient default

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

Stop a local deployment

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

There’s a known issue where Ctrl + C sometimes doesn’t properly stop all processes. See this forum post for fixes and workarounds.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums