Setting Up Koin
This guide covers everything you need to add Koin to your project.
Quick Setup
Choose your platform to get started:
| Platform | Package | Guide |
|---|---|---|
| Kotlin/JVM | koin-core | Gradle Setup |
| Android | koin-android | Gradle Setup |
| Android + Jetpack Compose | koin-android + koin-compose | Gradle Setup |
| Compose Multiplatform | koin-compose | Gradle Setup |
| Kotlin Multiplatform | koin-core | Gradle Setup |
| Ktor | koin-ktor | Gradle Setup |
Recommended Setup: BOM + Compiler Plugin
For the best experience, we recommend:
- Use the Koin BOM - Manages all Koin library versions
- Use the Koin Compiler Plugin - Provides compile-time safety
See the Compiler Plugin Setup Guide for detailed instructions.
Setup Guides
Gradle Setup
Complete dependency configuration for all platforms:
- Koin BOM (recommended)
- Version catalogs
- Platform-specific packages
- Testing dependencies
Compiler Plugin Setup
Detailed guide for the Koin Compiler Plugin:
- Gradle plugin configuration
- Configuration options
- Kotlin version requirements
- Troubleshooting
KSP Processor Setup (Deprecated)
Legacy setup for koin-ksp-compiler, the KSP-based processor for Koin Annotations:
- ⚠️
koin-ksp-compileris deprecated — migrate to the Koin Compiler Plugin - Koin Annotations itself is not deprecated;
koin-annotationsis now part of the main Koin project - Migration guide included
Version Compatibility
| Koin Version | Kotlin Version | Koin Compiler Plugin |
|---|---|---|
| 4.2.x | 2.3+ | ✅ Recommended |
| 4.1.x | 2.1/2.2+ | ⚠️ KSP Processor only |
| 4.0.x | 1.9/2.0+ | ⚠️ KSP Processor only |
| 3.5.x | 1.8+ | ❌ Not available |
Current Version
Find all Koin packages on Maven Central.
Next Steps
After setup:
- Core Concepts - Learn how to use Koin
- Tutorials - Build your first app
- Android Integration - Android-specific features