Setup: Build from Source

Build Drasi Server from source code

Building from source is the most complex approach for getting Drasi Server so you can work through the Getting Started tutorial, and it is strongly recommended to use one of the other approaches if you just want to start using Drasi Server quickly. This approach is ideal for future contributors or if you want to modify the code.

Prerequisites

  • Git — Needed to clone the Drasi Server code
  • Docker and Docker Compose — Needed to run the PostgreSQL database used in the tutorial
  • Rust 1.88+ — Needed to build Drasi Server
  • Text Editor — Needed to edit files during the tutorial
  • curl — Used to interact with Drasi Server’s REST API during the tutorial

If you are not sure you have these prerequisites installed, or need help installing them, see the troubleshooting section at the end of this page for guidance.

Step 1: Setup Native Build Dependencies

Building Drasi Server requires several native C libraries. Install the dependencies for your platform:

macOS

Install Xcode Command Line Tools to get clang and perl.

Then install the remaining dependencies with Homebrew:

brew install protobuf
brew install jq

Debian / Ubuntu

perl is pre-installed. Install everything else with:

sudo apt-get install -y libssl-dev pkg-config clang libclang-dev libjq-dev libonig-dev protobuf-compiler 

Windows

Building natively on Windows requires the Visual Studio 2022 Build Tools (for the MSVC toolchain):

winget install --id Microsoft.VisualStudio.2022.BuildTools -e `
    --override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"

Then install the pinned Rust MSVC toolchain:

rustup toolchain install 1.88.0-x86_64-pc-windows-msvc

Step 2: Clone Drasi Server Repo

Clone the Drasi Server repository. In a terminal, run:

git clone https://github.com/drasi-project/drasi-server.git

Step 3: Build Drasi Server

Once the cloning is complete, change to the newly created drasi-server folder.

cd drasi-server

Run the Build

Build and install Drasi Server:

cargo install --path . --root . --locked

The cargo install command takes several minutes to complete the first time you run it because it needs to download and compile all dependencies. Subsequent runs will be much faster since Cargo caches the compiled dependencies.

The --root . flag tells Cargo to put the newly built drasi-server binary in the ./bin directory, which is where the rest of the tutorial assumes it will be.

Verify the Build

Verify the drasi-server binary works:

./bin/drasi-server --version

You should see output showing the version number. The exact versions depend on which release of Drasi Server you have installed, so the numbers below are only examples. The latest release is always available from the Drasi Server releases page.

drasi-server 0.2.1
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
plugin-sdk: 0.9.1

Step 4: Build the SSE CLI

The tutorial uses a companion CLI tool called drasi-sse-cli to observe Server-Sent Events (SSE) sent by Drasi Server in later steps. This is a separate Rust project in the examples/sse-cli folder of the repository.

To build the SSE CLI run:

cargo install --path examples/sse-cli --root . --locked

The build will put the drasi-sse-cli binary in the ./bin directory with the drasi-server binary, where the tutorial expects it.

Verify the drasi-sse-cli binary works:

./bin/drasi-sse-cli --version

You should see output showing the version number. The exact version depends on which release you have installed, so the number below is only an example. The latest release is always available from the Drasi Server releases page.

drasi-sse-cli 0.1.0

✅ Setup Complete

You now have Drasi Server accessible at ./bin/drasi-server from the repository root.

Continue with the Tutorial

Troubleshooting

Installing Git

The tutorial uses git to clone the Drasi Server repository. If you don’t have Git installed, you can install it from the Git download page.

To verify Git is installed, run:

git --version

You should see output like git version 2.x.x. If you see “command not found”, install Git from the link above.

Installing Docker and Docker Compose

The tutorial uses Docker and Docker Compose to run a PostgreSQL database that is used as a Source in the tutorial.

If you are not sure you have Docker installed or that it is running, you can verify by running:

docker ps

If Docker is running, you’ll see a table with these headings showing running containers (even if no containers are running):

CONTAINER ID   IMAGE   COMMAND   CREATED   STATUS   PORTS   NAMES

To verify you have Docker Compose installed, run:

docker compose version

If Docker Compose is installed, you should see output showing the version number, for example:

Docker Compose version v2.10.2

If you don’t have Docker and Docker Compose installed, the easiest way to get started depends on your platform:

If you see an error like Cannot connect to the Docker daemon, Docker isn’t running. Start Docker Desktop (Mac/Windows) or the Docker service (sudo systemctl start docker on Linux) and wait for it to fully initialize, then try again. If problems persist, see the Docker troubleshooting guide for additional help.

Installing Rust

Drasi Server is written in Rust, so you need Rust 1.88 or later to build it. If you don’t have Rust installed, you can install it via rustup.

To verify Rust is installed, run:

rustc --version   # Should be 1.88.0 or later
cargo --version

If the Rust compiler and Cargo package manager are installed, you should see output like:

rustc 1.88.0 (6b00bc388 2025-06-23)
cargo 1.88.0 (873a06493 2025-05-10)

Installing curl

The tutorial uses curl to interact with Drasi Server during the tutorial. If you don’t have curl installed you can install it using the instructions on the curl download page.