Skip to main content

Local Dev

Running Restate Server & CLI locally

Install Restate Server and run it:


npm install --global @restatedev/restate-server@latest &&
restate-server

Install Restate Server and run it:


npm install --global @restatedev/restate-server@latest &&
restate-server

Or use npx, without installation:


npx @restatedev/restate-server

Or use npx, without installation:


npx @restatedev/restate-server

Install the Restate CLI via:


npm install --global @restatedev/restate@latest

Install the Restate CLI via:


npm install --global @restatedev/restate@latest

Server and CLI configuration

Have a look at the CLI configuration docs or Server configuration docs for more configuration options.

Wiping Restate

To start the Restate Server from a clean slate and wipe ongoing invocations and K/V state:


restate-server --wipe all

Useful dev CLI commands

Check if the CLI is installed correctly and can find the server:


restate whoami

Check if the CLI is installed correctly and can find the server:


restate whoami

Register a new service deployment.
When running Restate in a Docker, replace localhost with host.docker.internal.


restate deployments register localhost:9080

Register a new service deployment.
When running Restate in a Docker, replace localhost with host.docker.internal.


restate deployments register localhost:9080

Cancel a single invocation or a batch of invocations. Use --kill to kill the invocation. To remove all invocations, restart the server with --wipe all.


restate invocation cancel <INVOCATION_ID>
# also works with <SERVICE>/<SERVICE_KEY>/<HANDLER> or a subset of it

Cancel a single invocation or a batch of invocations. Use --kill to kill the invocation. To remove all invocations, restart the server with --wipe all.


restate invocation cancel <INVOCATION_ID>
# also works with <SERVICE>/<SERVICE_KEY>/<HANDLER> or a subset of it

Purge completed invocations from the state:


restate invocation purge <INVOCATION_ID>
# also works with <SERVICE>/<SERVICE_KEY>/<HANDLER> or a subset of it

Purge completed invocations from the state:


restate invocation purge <INVOCATION_ID>
# also works with <SERVICE>/<SERVICE_KEY>/<HANDLER> or a subset of it

Clear the K/V state of a Virtual Object or Workflows. To clear all state, restart the server with --wipe all.


restate kv clear <OBJECT_OR_WORKFLOW_NAME>
restate kv clear <OBJECT_OR_WORKFLOW_NAME>/<SERVICE_KEY>

Clear the K/V state of a Virtual Object or Workflows. To clear all state, restart the server with --wipe all.


restate kv clear <OBJECT_OR_WORKFLOW_NAME>
restate kv clear <OBJECT_OR_WORKFLOW_NAME>/<SERVICE_KEY>

Execute a SQL query on the invocation or application state. See SQL introspection docs for example queries. Use --json to get the output in json format.


restate sql "query"

Execute a SQL query on the invocation or application state. See SQL introspection docs for example queries. Use --json to get the output in json format.


restate sql "query"

Debugging and troubleshooting with the CLI

Have a look at the introspection page for a list of useful commands.