# How GreptimeDB Enables Edge Deployments on ARM Devices Using a Single Codebase

> Discover how GreptimeDB achieves seamless edge deployments on ARM devices. Learn how its single codebase and multi-platform Docker builds enable ARM64 installations with zero code changes.

- Repository: [Greptime/greptimedb](https://github.com/greptimeteam/greptimedb)
- Tags: how-to-guide
- Published: 2026-03-02

---

**GreptimeDB compiles the same Rust source tree for ARM64 edge devices through architecture detection scripts and multi-platform Docker builds, requiring zero code modifications.**

GreptimeDB is a cloud-native time-series database written in Rust that supports edge deployments on ARM devices like Raspberry Pi and NVIDIA Jetson using the exact same codebase as x86_64 servers. The repository achieves this portability through build-time configuration in the Makefile and Dockerfiles, ensuring a consistent binary across all platforms.

## Architecture Detection and Binary Selection

The deployment process begins with automatic CPU detection. In [`scripts/install.sh`](https://github.com/greptimeteam/greptimedb/blob/main/scripts/install.sh), the `get_arch_type()` function inspects the host architecture using `uname -m` and maps it to standardized platform identifiers:

```bash
get_arch_type() {
  arch_type="$(uname -m)"
  case "$arch_type" in
    arm64|aarch64) ARCH_TYPE=arm64 ;;
    x86_64|amd64)   ARCH_TYPE=amd64 ;;
    *) echo "Error: Unknown CPU type: $arch_type"; exit 1 ;;
  esac
}

```

*Source:* [[`scripts/install.sh`](https://github.com/greptimeteam/greptimedb/blob/main/scripts/install.sh) lines 34-50](https://github.com/greptimeteam/greptimedb/blob/main/scripts/install.sh#L34-L50)

This detection allows the same installation command to fetch the correct binary regardless of whether the device is an ARM64 edge node or an AMD64 server.

## Cross-Compilation Configuration in the Makefile

The build orchestration happens in the root `Makefile`, which converts the host architecture string into Docker-compatible platform labels. The `ARCH` variable dynamically selects between `amd64` and `arm64` based on the output of `uname -m`:

```make
ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')

```

*Source:* [`Makefile` lines 18-20](https://github.com/greptimeteam/greptimedb/blob/main/Makefile#L18-L20)

When building container images, this variable determines which binary directory to copy into the Docker context, ensuring the correct architecture-specific artifact is packaged.

## Multi-Architecture Docker Images for Edge Devices

GreptimeDB leverages Docker Buildx and the `TARGETARCH` argument to produce images that run on ARM hardware without emulation. The CI Dockerfile at `docker/ci/distroless/Dockerfile` uses conditional logic to copy the appropriate binary:

```dockerfile
ARG TARGETARCH
COPY $TARGETARCH/greptime /greptime/bin/

```

*Source:* [`docker/ci/distroless/Dockerfile` lines 8-15](https://github.com/greptimeteam/greptimedb/blob/main/docker/ci/distroless/Dockerfile#L8-L15)

Similarly, the dev-builder Dockerfile handles `TARGETPLATFORM` to select the correct base image for ARM builds. This approach allows the same `docker build` command to produce ARM64 images suitable for resource-constrained edge environments.

### Building for ARM Locally

To build a native ARM64 image on an edge device or through cross-compilation:

```bash

# Enable Docker Buildx (one-time setup)

docker buildx create --use --name greptime-builder

# Build specifically for ARM64

make docker-image-buildx \
     CARGO_PROFILE=release \
     IMAGE_TAG=v0.12-arm64 \
     BUILDX_MULTI_PLATFORM_BUILD_OPTS="--platform linux/arm64"

```

*Source:* [`Makefile` lines 45-53](https://github.com/greptimeteam/greptimedb/blob/main/Makefile#L45-L53)

## Standalone Mode for Low-Resource Edge Deployment

The same binary compiled for ARM64 supports **standalone mode**, which runs as a single process ideal for edge devices with limited CPU and memory. This mode uses the identical code paths as distributed cluster nodes, allowing seamless scaling from edge to cloud without binary changes:

```bash

# Download and run on ARM device (auto-detects architecture)

curl -sSfL https://raw.githubusercontent.com/greptimeteam/greptimedb/main/scripts/install.sh | sh -

# Start in standalone mode

./greptime standalone start \
    --http-addr 0.0.0.0:4000 \
    --rpc-bind-addr 0.0.0.0:4001 \
    --mysql-addr 0.0.0.0:4002 \
    --postgres-addr 0.0.0.0:4003

```

*Source:* [[`README.md`](https://github.com/greptimeteam/greptimedb/blob/main/README.md) standalone example](https://github.com/greptimeteam/greptimedb/blob/main/README.md#L19-L31)

## CI/CD Pipeline with Native ARM64 Runners

The project maintains ARM compatibility through GitHub Actions workflows that provision dedicated ARM64 runners. The [`.github/workflows/nightly-build.yml`](https://github.com/greptimeteam/greptimedb/blob/main/.github/workflows/nightly-build.yml) defines EC2 instance types specifically for ARM builds:

```yaml
linux_arm64_runner:
  type: choice
  description: The runner used to build linux‑arm64 artifacts
  default: ec2-c6g.4xlarge-arm64
  options:
    - ec2-c6g.xlarge-arm64
    - ec2-c6g.2xlarge-arm64
    - ec2-c6g.4xlarge-arm64

```

*Source:* [[`.github/workflows/nightly-build.yml`](https://github.com/greptimeteam/greptimedb/blob/main/.github/workflows/nightly-build.yml) lines 27-36](https://github.com/greptimeteam/greptimedb/blob/main/.github/workflows/nightly-build.yml#L27-L36)

This ensures every release includes native ARM64 binaries built on actual ARM hardware rather than relying on slow emulation.

## Manual Cross-Compilation for Custom Targets

For edge devices requiring custom optimization, you can cross-compile directly using Cargo:

```bash

# Install the ARM64 target

rustup target add aarch64-unknown-linux-gnu

# Build release binary for ARM

cargo build --release --target aarch64-unknown-linux-gnu

```

The resulting binary at `target/aarch64-unknown-linux-gnu/release/greptime` is identical to the CI-produced artifacts and runs natively on any ARM64 Linux edge device.

## Summary

- **Architecture detection** in [`scripts/install.sh`](https://github.com/greptimeteam/greptimedb/blob/main/scripts/install.sh) automatically selects ARM64 or AMD64 binaries based on `uname -m` output.
- **Build configuration** in the `Makefile` handles platform translation without modifying Rust source code.
- **Docker multi-arch support** uses `TARGETARCH` arguments to package the correct binary for ARM edge devices.
- **Standalone mode** provides a lightweight single-process deployment option perfect for low-resource ARM hardware.
- **Native CI runners** ensure ARM64 binaries are built and tested on actual ARM infrastructure, not emulated environments.

## Frequently Asked Questions

### Can I run GreptimeDB on a Raspberry Pi or other ARM edge devices?

Yes. GreptimeDB supports ARM64 (`aarch64`) architecture through the same codebase used for x86_64 servers. The [`scripts/install.sh`](https://github.com/greptimeteam/greptimedb/blob/main/scripts/install.sh) script detects Raspberry Pi and other ARM devices automatically, downloading the appropriate `arm64` binary. For 32-bit ARM (armv7), you would need to cross-compile with the specific target triple, though the source code remains identical.

### Do I need to modify the source code to build for ARM?

No. The repository contains a single source tree with no ARM-specific code branches. Platform selection happens entirely at build time through Makefile variables, Docker `TARGETARCH` arguments, and Cargo target specifications. The Rust source in `src/` is platform-agnostic and compiles for any target supported by the LLVM backend.

### How does the install script detect my device's architecture?

The `get_arch_type()` function in [`scripts/install.sh`](https://github.com/greptimeteam/greptimedb/blob/main/scripts/install.sh) executes `uname -m` and maps the output to standardized values: `aarch64` and `arm64` map to `ARCH_TYPE=arm64`, while `x86_64` maps to `amd64`. This allows the script to fetch the correct release tarball from GitHub without user intervention.

### Can the same ARM binary run in both standalone and distributed mode?

Yes. The `greptime` binary contains both operational modes in a single artifact. Running `./greptime standalone start` launches a single-process edge deployment, while `./greptime datanode start` or `./greptime frontend start` allows the same binary to participate in a distributed cluster. This dual-mode capability ensures you can migrate from edge testing to production clustering without rebuilding or redeploying the binary.