---
title: "Server (server-zd)"
description: "server-zd is the Dex Server. It stores every Flow's state and hands Steps and"
canonical_url: "https://docs.superdurable.io/primitives/components/server/"
source: "docs/content/primitives/components/server.mdx"
locale: "en"
---

# Server (server-zd)

server-zd is the Dex Server. It stores every Flow's state and hands Steps and
RPCs to Workers. Its only runtime dependency is object storage, such as Amazon
S3 or an S3-compatible store.

## How it works

server-zd commits every write to object storage before it acknowledges the
write. It keeps a local store as a cache. After a restart, a node rebuilds that
cache from object storage.

One active process serves a cluster. It holds a lease in object storage, so a
second process cannot write at the same time. You can run standby processes
that take over when the active process stops.

## How it fits with the other components

- [Workers and Clients](https://docs.superdurable.io/primitives/components/application.md) connect to the
  server's API port. Workers open outbound streams; the server never calls in.
- [Dex Web](https://docs.superdurable.io/primitives/components/web.md) runs as a separate process and reads
  Flows through the same API.
- [dexcli](https://docs.superdurable.io/primitives/components/cli.md) calls the same API. **dexcli dev** also
  starts server-zd on your machine.
- [External Attribute Sync](https://docs.superdurable.io/primitives/components/external-attribute-sync.md)
  is a server feature. server-zd writes selected Attributes to PostgreSQL.

## Run it

For local development, run **dexcli dev**. It starts server-zd with embedded
object storage, together with Dex Web.

In production, run **dex-server-zd serve** with one YAML configuration file. The
release publishes binaries and a container image. On Kubernetes, run it as a
StatefulSet.

```bash
dex-server-zd serve --config /etc/dex-server-zd/config.yaml
```

To run one production node on local disk without external object storage, run
**dex-server-zd local**. It keeps an embedded object store in its data
directory and has no standby.

## Reference

The [Server reference](https://docs.superdurable.io/reference/server.md) covers configuration, Kubernetes,
high availability, object storage, authentication, Worker dispatch, search,
Attribute Store sync, metrics, and upgrades.
