Skip to main content
This guide covers building Temporal Server binaries and related tools from source code.

Initial Build

For your first build, use the default make command to install all build dependencies and compile the binaries:
This target:
  • Installs required build tools (protoc plugins, linters, etc.)
  • Compiles all proto definitions
  • Builds all binaries
  • Runs the complete test suite

Build Binaries Only

After the initial setup, you can build binaries without running tests:
This builds the following binaries:
  • temporal-server - Main server binary
  • temporal-cassandra-tool - Cassandra schema management tool
  • temporal-sql-tool - SQL database schema management tool
  • temporal-elasticsearch-tool - Elasticsearch schema management tool
  • tdbg - Temporal debugging tool

Build Individual Binaries

You can build specific binaries individually:

Temporal Server

The server is built with CGO_ENABLED=0 by default. To enable CGO:

Temporal Server (Debug Build)

This builds the server with the TEMPORAL_DEBUG tag, which extends functional test timeouts for debugging sessions.

Database Tools

Cassandra Tool:
SQL Tool (MySQL/PostgreSQL):
Elasticsearch Tool:

Debugging Tool

Cross-Platform Builds

You can build for different platforms by setting GOOS and GOARCH:

Build Tags

Temporal Server uses several build tags:
  • disable_grpc_modules - Excludes gRPC dependencies from cloud.google.com/go/storage, reducing binary size by ~16MB
  • test_dep - Enables test hooks implementation for testing
  • TEMPORAL_DEBUG - Extends timeouts for debugging
  • integration - Includes integration test dependencies
Build tags are automatically applied by the Makefile. To apply them manually:

Proto Compilation

If you modify .proto files, regenerate the Go code:
This command:
  1. Lints proto definitions
  2. Compiles proto files to Go code
  3. Generates service clients and server interceptors
  4. Generates search attribute helpers

Code Generation

After modifying files with //go:generate directives, run:
This regenerates:
  • Mock implementations (using mockgen)
  • String methods (using stringer)
  • RPC wrappers

Clean Build

To remove all build artifacts and start fresh:
This removes:
  • All binary files
  • Build tools in .bin/
  • Test output in .testoutput/
  • Go test cache

Build Verification

After building, verify the binaries:

Updating Dependencies

API Dependencies

To update to the latest api and api-go:

Minor Version Updates

Update all dependencies to their latest minor versions:

Major Version Updates

List available major version updates:

Working with Local API Changes

If you need to modify the gRPC/protobuf definitions alongside server changes:
1

Clone Related Repositories

2

Make Changes to api Repository

Commit your changes to a branch in the api repository.
3

Update api-go

4

Point Server to Local Copies

Add to go.mod in the temporal repository:
Then rebuild:

Common Build Issues

Protoc Not Found

If you see “protoc: command not found”:

Out of Date Generated Code

If you see errors about generated code:

Build Cache Issues