> ## Documentation Index
> Fetch the complete documentation index at: https://docs.restate.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Learn how to set up your local Restate development environment.

Set up Restate locally in minutes.

## Install Restate Server & CLI

Restate is a single self-contained binary. No external dependencies needed.

> [tab] Homebrew
>
> ```shell theme={null}
> brew install restatedev/tap/restate-server restatedev/tap/restate
> ```
>
> Start the server:
>
> ```shell theme={null}
> restate-server
> ```
>
> Find the CLI at:
>
> ```shell theme={null}
> restate --help
> ```

> [tab] Download binaries
>
> Download prebuilt binaries from the [releases page](https://github.com/restatedev/restate/releases/latest):
>
> ```shell MacOS-x64 theme={null}
> BIN=/usr/local/bin && RESTATE_PLATFORM=x86_64-apple-darwin && \
> curl -L --remote-name-all https://restate.gateway.scarf.sh/latest/restate-{server,cli}-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restate-server-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-server-$RESTATE_PLATFORM/restate-server && \
> tar -xvf restate-cli-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-cli-$RESTATE_PLATFORM/restate && \
> chmod +x restate restate-server && \
> sudo mv restate $BIN && \
> sudo mv restate-server $BIN
> ```
>
> ```shell MacOS-arm64 theme={null}
> BIN=/usr/local/bin && RESTATE_PLATFORM=aarch64-apple-darwin && \
> curl -L --remote-name-all https://restate.gateway.scarf.sh/latest/restate-{server,cli}-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restate-server-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-server-$RESTATE_PLATFORM/restate-server && \
> tar -xvf restate-cli-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-cli-$RESTATE_PLATFORM/restate && \
> chmod +x restate restate-server && \
> sudo mv restate $BIN && \
> sudo mv restate-server $BIN
> ```
>
> ```shell Linux-x64 theme={null}
> BIN=$HOME/.local/bin && RESTATE_PLATFORM=x86_64-unknown-linux-musl && \
> curl -L --remote-name-all https://restate.gateway.scarf.sh/latest/restate-{server,cli}-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restate-server-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-server-$RESTATE_PLATFORM/restate-server && \
> tar -xvf restate-cli-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-cli-$RESTATE_PLATFORM/restate && \
> chmod +x restate restate-server && \
> mv restate $BIN && \
> mv restate-server $BIN
> ```
>
> ```shell Linux-arm64 theme={null}
> BIN=$HOME/.local/bin && RESTATE_PLATFORM=aarch64-unknown-linux-musl && \
> curl -L --remote-name-all https://restate.gateway.scarf.sh/latest/restate-{server,cli}-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restate-server-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-server-$RESTATE_PLATFORM/restate-server && \
> tar -xvf restate-cli-$RESTATE_PLATFORM.tar.xz --strip-components=1 restate-cli-$RESTATE_PLATFORM/restate && \
> chmod +x restate restate-server && \
> mv restate $BIN && \
> mv restate-server $BIN
> ```
>
> Start the server:
>
> ```shell theme={null}
> restate-server
> ```
>
> Find the CLI at:
>
> ```shell theme={null}
> restate --help
> ```

> [tab] npm
>
> ```shell theme={null}
> npm install --global @restatedev/restate-server@latest @restatedev/restate@latest
> ```
>
> Start the server:
>
> ```shell theme={null}
> restate-server
> ```
>
> Find the CLI at:
>
> ```shell theme={null}
> restate --help
> ```

> [tab] Docker
>
> Run the Restate Server:
>
> ```shell theme={null}
> docker run --name restate_dev --rm \
> -p 8080:8080 -p 9070:9070 -p 9071:9071 \
> --add-host=host.docker.internal:host-gateway \
> docker.restate.dev/restatedev/restate:latest
> ```
>
> Run CLI commands:
>
> ```shell theme={null}
> docker run -it --network=host \
> docker.restate.dev/restatedev/restate-cli:latest \
> invocations ls
> ```
>
> Replace `invocations ls` with any CLI subcommand.

You can find the Restate UI running on port 9070 (`http://localhost:9070`) after starting the Restate Server.

> [accordion] Lightweight local dev server
>
> You can use `restate up` to start a lightweight, local dev server.

> [accordion] Random ports
>
> You can start `restate-server` binding to random ports via:
>
> ```shell theme={null}
> restate-server --use-random-ports=true --no-logo
> ```
>
> The chosen ports will be displayed in the first three standard output lines.

Also check out the [CLI](https://docs.restate.dev/references/cli-config.md) or [Server configuration options](https://docs.restate.dev/server/configuration.md).

> [!NOTE]
>
> Restate Server collects anonymized telemetry about versions and uptime via [Scarf](https://about.scarf.sh).\
> We don't have access to your IP or any information about your cluster.
> To disable, set `DO_NOT_TRACK=1`.

## Restate UI

The UI is bundled with the Restate Server and available at [http://localhost:9070](http://localhost:9070) when running locally. Use the UI to manage, debug, and configure your applications.

![Restart from prefix](https://mintcdn.com/restate-6d46e1dc/Up9-AG1h_WsYrDMV/img/develop/ui.png?fit=max\&auto=format\&n=Up9-AG1h_WsYrDMV\&q=85\&s=90402dc478f6c254fa7824290ce07166)

The UI gives you the best experience when working with Restate.

## Useful CLI Commands

With the CLI installed, try these commands:

> [accordion] Check which server you are connected to
>
> ```shell theme={null}
> restate whoami
> ```

> [accordion] Register a new service deployment
>
> (If using Docker, use `http://host.docker.internal:9080`)
>
> ```shell theme={null}
> restate deployments register localhost:9080
> ```

> [accordion] List deployments
>
> ```shell theme={null}
> restate deployments list
> ```

> [accordion] List invocations
>
> ```shell theme={null}
> restate invocations list
> ```

> [accordion] Cancel/kill a single or batch of invocations
>
> ```shell theme={null}
> # a single invocation
> restate invocations cancel my_invocation_id
> # cancel all invocations of a service, object, or handler
> restate invocations cancel MyService
> restate invocations cancel MyService/myHandler
> restate invocations cancel MyObject/myObjectKey
> restate invocations cancel MyObject/myObjectKey/myHandler
> ```
>
> Use `restate invocations kill` to force kill.

> [accordion] Clear the K/V state of a Virtual Object or Workflow
>
> ```shell theme={null}
> restate state clear MyObject
> restate state clear MyObject/myObjectKey
> ```

> [accordion] Wipe the server during local development
>
> Remove the `restate-data` directory to wipe all invocations, state, registered services, etc.
>
> ```shell theme={null}
> rm -rf restate-data
> ```

> [accordion] Execute a SQL query on invocation or application state
>
> See [SQL introspection docs](https://docs.restate.dev/services/introspection.md#inspecting-invocations) for examples.
> Use `--json` for JSON output.
>
> ```shell theme={null}
> restate sql "query"
> ```

> [accordion] View your service configuration
>
> ```shell theme={null}
> restate services config view <SERVICE_NAME>
> ```

See also the [introspection page](https://docs.restate.dev/services/introspection.md) for more CLI debugging commands.

## Advanced: Installing `restatectl`

`restatectl` is a command-line tool for managing Restate clusters. It provides commands for cluster management, introspection, and debugging.

This tool is specifically designed for system operators to manage Restate servers and is particularly useful in a cluster environment.

> [tab] Homebrew
>
> Install with:
>
> ```shell theme={null}
> brew install restatedev/tap/restatectl
> ```
>
> Then run:
>
> ```shell theme={null}
> restatectl --help
> ```

> [tab] Download binaries
>
> Install restatectl by downloading the binary with `curl` from the [releases page](https://github.com/restatedev/restate/releases/latest), and make them executable:
>
> ```shell Linux-x64 theme={null}
> BIN=$HOME/.local/bin && RESTATE_PLATFORM=x86_64-unknown-linux-musl && \
> curl -LO https://restate.gateway.scarf.sh/latest/restatectl-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restatectl-$RESTATE_PLATFORM.tar.xz --strip-components=1 restatectl-$RESTATE_PLATFORM/restatectl && \
> chmod +x restatectl && \
>
> # Move the binary to a directory in your PATH, for example ~/.local/bin:
> mv restatectl $BIN
> ```
>
> ```shell Linux-arm64 theme={null}
> BIN=$HOME/.local/bin && RESTATE_PLATFORM=aarch64-unknown-linux-musl && \
> curl -LO https://restate.gateway.scarf.sh/latest/restatectl-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restatectl-$RESTATE_PLATFORM.tar.xz --strip-components=1 restatectl-$RESTATE_PLATFORM/restatectl && \
> chmod +x restatectl && \
>
> # Move the binary to a directory in your PATH, for example ~/.local/bin:
> mv restatectl $BIN
> ```
>
> ```shell MacOS-x64 theme={null}
> BIN=/usr/local/bin && RESTATE_PLATFORM=x86_64-apple-darwin && \
> curl -LO https://restate.gateway.scarf.sh/latest/restatectl-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restatectl-$RESTATE_PLATFORM.tar.xz --strip-components=1 restatectl-$RESTATE_PLATFORM/restatectl && \
> chmod +x restatectl && \
>
> # Move the binary to a directory in your PATH, for example /usr/local/bin (needs sudo):
> sudo mv restatectl $BIN
> ```
>
> ```shell MacOS-arm64 theme={null}
> BIN=/usr/local/bin && RESTATE_PLATFORM=aarch64-apple-darwin && \
> curl -LO https://restate.gateway.scarf.sh/latest/restatectl-$RESTATE_PLATFORM.tar.xz && \
> tar -xvf restatectl-$RESTATE_PLATFORM.tar.xz --strip-components=1 restatectl-$RESTATE_PLATFORM/restatectl && \
> chmod +x restatectl && \
>
> # Move the binary to a directory in your PATH, for example /usr/local/bin (needs sudo):
> sudo mv restatectl $BIN
> ```
>
> Then run:
>
> ```shell theme={null}
> restatectl --help
> ```

> [tab] npm
>
> Install with:
>
> ```shell theme={null}
> npm install --global @restatedev/restatectl@latest
> ```
>
> Then run:
>
> ```shell theme={null}
> restatectl --help
> ```

> [tab] Docker
>
> The server image contains the `restatectl` tool. To run `restatectl`, use the following command:
>
> ```shell theme={null}
> docker run -it --network=host --entrypoint restatectl docker.restate.dev/restatedev/restate:latest nodes ls
> ```
>
> You can also execute `restatectl` in a running server container using the following command:
>
> ```shell theme={null}
> docker exec restate_dev restatectl nodes ls
> ```
>
> Replace `restate_dev` with the name of a running container, and `nodes ls` with the subcommand you want to run.

> [!NOTE]
>
> `restatectl` requires direct access to nodes via their advertised addresses (default port: 5122). Ensure that restatectl commands can reach these addresses.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.