2.3 Compiling JSONAir
How to build JSONAir from source.
JSONAir uses a standard Go toolchain and a Makefile for convenience. The end result is five standalone static binaries — the server, the agent, the encryption utility, the admin web interface, and the write-only API.
Before You Start
Make sure you have:
Go 1.26.2 or later installed (
go versionto confirm)The repository cloned locally:
git clone https://github.com/k9io/jsonair.git
cd jsonairBuilding with Make (Recommended)
The simplest way to build everything is to run make from the repository root. This will tidy the Go module dependencies and compile every binary in one step.
makeThis is equivalent to running:
make tidy
make buildThe compiled binaries are placed in the bin/ directory:
bin/
jsonair/jsonair ← the JSONAir server
jsonair-agent/jsonair-agent ← the JSONAir agent
jsonair-encrypt/jsonair-encrypt ← the config data encryption tool
jsonair-admin/jsonair-admin ← the admin web interface
jsonair-write/jsonair-write ← the write-only APIBuilding Individual Components
If you only need one of the binaries, you can build them separately.
Server only:
Agent only:
Encryption tool only:
Admin web interface only:
Write-only API only:
Building Directly with Go
You can also build without make using the Go toolchain directly.
Server:
Agent:
Encryption tool:
Admin web interface:
Write-only API:
Running the Tests
Cleaning Build Artifacts
To remove the bin/ directory and start fresh:
Cross-Compilation
Because JSONAir has no C dependencies, it cross-compiles cleanly using Go's built-in support. Set GOOS and GOARCH before the build command to target a different platform.
Example — build the server for Linux (amd64) on a Mac:
Common targets:
Linux 64-bit
linux
amd64
Linux ARM64 (e.g. AWS Graviton)
linux
arm64
macOS Intel
darwin
amd64
macOS Apple Silicon
darwin
arm64
Last updated