Starting Koin

Running your modules

One you have declared your dependencies with the Koin DSL, you just need to start Koin and inject!

The start function

The startKoin() function just need a list of Module to run and it will load every defintion from your modules. It is a function, it can be used every where, dependening on the used runtime.



External properties can be loaded while starting your modules.

Load from

Koin will check if is available, to laod your properties. It has to be in src/main/resources Kotlin folder or asset Android folder.

External properties

For koin core/spark/ktor, you can also load environment properties with the bindSystemProperties parameter:

startKoin(listOf(myModule),bindSystemProperties = true)

Additional properties

You can also supply properties on the fly, with the Koin start function with the properties attribute:

startKoin(listOf(myModule),properties = HashMap(

Starting Koin

Depending on your choosen Koin module, Koin will be launched slight differently.


For a Kotlin app, just start it in your main function:

fun main(vararg args: String) {


For an Android app, you will start Koin in your Application class:

class MyApplication : Application(){
    override fun onCreate() {
        // Start Koin
        startKoin(this, listOf(myModule))


For a Spark web app, just run it from your main function:

fun main(vararg args: String) {
    // Spark
    start(modules = listOf(myModule)) {
        // Controllers

And now?

Your dependencies are delcared in modules. You have started Koin. Let’s go with injection!