GrowthBook Setup Guide
GrowthBook is a free open-source split system. This guide covers self-hosted installation via Docker and setting up your first experiment — after that, your assignments are ready to feed into AB-Labz.
Prerequisites
- Docker and Docker Compose installed
- A server or local machine with ports 3000 and 3100 available
- iOS or Android app with a stable user identifier (e.g. device_id, user_id)
1. Install GrowthBook
Clone the official repository and start the containers:
git clone https://github.com/growthbook/growthbook.git
cd growthbook
docker-compose up -dGrowthBook will start two services:
- App (UI + API) on
http://localhost:3000 - MongoDB for storage
Open http://localhost:3000 in your browser. On first launch you'll be prompted to create an admin account.
2. Initial Setup
After logging in:
- Create an Organization — enter your company name
- Set your timezone — important for correct experiment date boundaries
- Go to Features → SDKs and click Add SDK Connection
- Select your platform (iOS or Android), give it a name, and save
- Copy the Client Key — you'll need it in the next step
3. Add SDK to Your App
iOS — Swift Package Manager:
In Xcode: File → Add Packages → https://github.com/growthbook/growthbook-swift
Or via Package.swift:
dependencies: [
.package(url: "https://github.com/growthbook/growthbook-swift.git")
]Initialize at app startup:
import GrowthBook
var sdkInstance: GrowthBookSDK = GrowthBookBuilder(
apiHost: "http://YOUR_SERVER:3100",
clientKey: "sdk-YOUR_CLIENT_KEY",
attributes: ["id": YMMYandexMetrica.deviceID() ?? UIDevice.current.identifierForVendor?.uuidString ?? ""],
trackingCallback: { experiment, result in
// write assignment to your data warehouse here
print("Experiment: \(experiment.key), Variant: \(result.key)")
}
).initialize()Android — Gradle:
// build.gradle (app)
repositories {
mavenCentral()
}
dependencies {
implementation 'io.growthbook.sdk:GrowthBook:7.1.0'
// choose one network dispatcher:
implementation 'io.growthbook.sdk:NetworkDispatcherKtor:1.0.12' // Android + iOS + JVM
// implementation 'io.growthbook.sdk:NetworkDispatcherOkHttp:1.0.7' // Android + JVM only
}Initialize (after obtaining device ID — it's async in Yandex Metrica):
import com.sdk.growthbook.GBSDKBuilder
val gb = GBSDKBuilder(
apiKey = "sdk-YOUR_CLIENT_KEY",
hostURL = "http://YOUR_SERVER:3100/",
attributes = hashMapOf("id" to deviceId),
trackingCallback = { experiment, result ->
// write assignment to your data warehouse here
Log.d("GrowthBook", "Experiment: ${experiment.key}, Variant: ${result.variationId}")
}
).initialize()Note: on Android, Yandex Metrica's
getDeviceIDis async — initialize GrowthBook only after you have the device ID.
4. Create Your First Experiment
- Go to Features → Add Feature
- Set a Feature Key (e.g.
new_onboarding_flow) and type Boolean - In the feature rules, click Add Rule → select Experiment
- Configure:
- Tracking Key — experiment identifier, will appear in your assignments data
- Split — e.g. 50% / 50%
- Variations —
falsefor control,truefor treatment
- Set the environment to Production and save
5. Use the Experiment in Your App
iOS:
let isNewOnboarding = sdkInstance.isOn("new_onboarding_flow")
if isNewOnboarding {
// show treatment
} else {
// show control
}Android:
val isNewOnboarding = gb.isOn("new_onboarding_flow")
if (isNewOnboarding) {
// show treatment
} else {
// show control
}The SDK assigns the user deterministically based on their id attribute — the same user always gets the same variant.
6. Verify Assignments Are Working
The trackingCallback you set during initialization fires every time a user is assigned to an experiment. Use it to write to your data warehouse:
user_id | experiment_id | variant | timestamp
--------|----------------------|-----------|----------
u_123 | new_onboarding_flow | control | 2026-05-25 10:34:12
u_456 | new_onboarding_flow | treatment | 2026-05-25 10:35:01This becomes the assignments table — the source for your AB-Labz datamart.
What's Next
Your GrowthBook is running and assigning users to experiment groups. The next step is building a datamart that joins assignments with your event data — then connecting it to AB-Labz for analysis.
