Kotlin Help

Get started with Kotlin/Wasm and Compose Multiplatform

This tutorial demonstrates how to run a Compose Multiplatform app with Kotlin/Wasm in IntelliJ IDEA and generate artifacts you can publish as a website.

Create a project

  1. Set up your environment for Kotlin Multiplatform development.

  2. In IntelliJ IDEA, select File | New | Project.

  3. In the list of project templates, select Kotlin Multiplatform.

  4. Specify the following fields in the New Project window:

    • Name: WasmDemo

    • Project ID: wasm.project.demo

  5. Select the Web target and the Share UI tab. Make sure that no other options are selected.

  6. Click Create.

    Kotlin Multiplatform wizard

Run the application

  1. Once the project loads, select webApp [wasmJs] in the list of run configurations and click Run.

    Run the Compose Multiplatform app on web

    The web application opens automatically in your browser. Alternatively, once the build finishes, you can open the following URL manually:

    http://localhost:8080/

    The port number may vary if port 8080 is already in use. You can find the actual port number in the output of the Gradle build.

  2. Click the Click me! button. This reveals the Compose Multiplatform logo:

    Compose app in browser

Generate artifacts

Generate your project's artifacts to publish on a website:

  1. Open the Gradle tool window by selecting View | Tool Windows | Gradle.

  2. In WasmDemo | Tasks | kotlin browser, select and run the wasmJsBrowserDistribution task.

    Run the Gradle task

    Alternatively, you can run the following command in the terminal from the WasmDemo root directory:

    ./gradlew wasmJsBrowserDistribution

Once the task completes, you can find the generated artifacts in the webApp/build/dist/wasmJs/productionExecutable directory:

Artifacts directory

Publish the application

Use the generated artifacts to deploy your Kotlin/Wasm application. Select a publishing option that you prefer and follow the instructions:

Once your site is created, open the browser and navigate to your platform's page domain. For example, GitHub pages:

Navigate to GitHub pages

Congratulations! You have published your artifacts.

What's next?

18 May 2026