Garage is a standard Rust project that can be compiled from source. Building from source allows you to customize the build with specific feature flags and ensures you have the latest version.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/deuxfleurs-org/garage/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Rust Toolchain
You need Rust and Cargo installed on your system.C Toolchain
A full C toolchain is required for building Garage’s dependencies.Building from Source
Clone the repository
The primary location for Garage’s source code is the Forgejo repository.
Checkout a specific version (optional)
To build a specific version of Garage, check out the corresponding tag:
Build Garage
Build a release version of Garage:The compilation process may take several minutes depending on your hardware.
Development Builds
If you’re developing Garage, you can create debug builds that compile faster but run slower:target/debug/garage.
Cargo Feature Flags
Garage supports several compilation options through Cargo feature flags. These allow you to customize the build for your specific use case.Building with Custom Features
Available Feature Flags
| Feature Flag | Default | Description |
|---|---|---|
bundled-libs | ✅ | Use bundled versions of sqlite3, zstd, lmdb, and libsodium |
lmdb | ✅ | Enable using LMDB to store Garage’s metadata |
sqlite | ✅ | Enable using SQLite3 to store Garage’s metadata |
metrics | ✅ | Enable Prometheus metrics collection on the admin API |
consul-discovery | ❌ | Enable automatic node discovery through Consul API |
kubernetes-discovery | ❌ | Enable automatic node discovery through Kubernetes API |
k2v | ❌ | Enable the experimental K2V API |
fjall | ❌ | Enable using Fjall to store Garage’s metadata (experimental) |
journald | ❌ | Enable logging to systemd-journald |
syslog | ❌ | Enable logging to Syslog |
telemetry-otlp | ❌ | Enable OpenTelemetry execution traces |
system-libs | ❌ | Use system versions of libraries (exclusive with bundled-libs) |
If you enable the
k2v feature, all nodes in your Garage cluster must have it enabled for compatibility.Build Configuration
Garage uses the following release profile settings (defined inCargo.toml):
Troubleshooting
Compilation Errors
If you encounter compilation errors:-
Update Rust: Ensure you have the latest stable Rust toolchain
-
Clean build artifacts: Remove old build artifacts and try again
- Check dependencies: Ensure all system dependencies are installed
Out of Memory
If compilation fails due to memory constraints, reduce parallel compilation:Next Steps
After building Garage:- Create a configuration file
- Follow the Quick Start guide to set up your cluster
- Learn about cluster operations
Alternative Installation Methods
If building from source isn’t suitable for your needs:- Install from binary packages
- Run with Docker
- Download pre-built binaries from garagehq.deuxfleurs.fr/download/