Skip to content

Potassium Packager

Potassium

Maven Central License: MIT Kotlin Platform

Potassium is a Gradle plugin for packaging and distributing Compose / JVM desktop applications on macOS, Windows, and Linux.

It is a drop-in extension of the official JetBrains Compose Desktop plugin — keep your existing compose.desktop configuration and opt into the capabilities you need. Potassium picks up where jpackage stops: more installer formats, real code signing and notarization, built-in auto-update, and GraalVM Native Image builds, all from a single Gradle DSL.

What it does

Ship everywhere

  • Many installer formats — Linux deb / rpm / AppImage / snap / flatpak, Windows msi / exe (NSIS) / appx / portable, macOS dmg / pkg, plus archives (zip, tar, 7z)
  • Store-ready — Mac App Store, Microsoft Store, Snapcraft, Flathub
  • Code signing & notarization — Windows (PFX / Azure) and macOS, built into the build pipeline
  • Auto-update — electron-builder-compatible update metadata (latest-*.yml) generated alongside your installers, with SHA-512 verification
  • Deep links & file associations — protocol handlers and file type registration on all platforms

Go further

  • GraalVM Native Image — compile your app into a standalone native binary. Potassium resolves the reachability metadata transparently, so most apps build with zero manual reflection config.
  • AOT cache — enable the JDK 25+ ahead-of-time cache for faster startup with a single flag.
  • ProGuard release builds — optimization and obfuscation for production.
  • Trusted CA certificates — import custom root CAs into the bundled JVM's cacerts at build time.
  • CI/CD ready — reusable GitHub Actions for multi-platform matrix builds, universal macOS binaries, and MSIX bundles.

Quick start

// settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
}
// build.gradle.kts
plugins {
    kotlin("jvm") version "..."
    id("org.jetbrains.kotlin.plugin.compose") version "..."
    id("org.jetbrains.compose") version "..."
    id("com.seanproctor.potassium") version "0.1.0"
}

potassium {
    mainClass = "com.example.MainKt"
    packageName = "MyApp"
    packageVersion = "1.0.0"

    macOS { targetFormats(MacOSTargetFormat.Dmg) }
    windows { targetFormats(WindowsTargetFormat.Nsis) }
    linux { targetFormats(LinuxTargetFormat.Deb) }
}
./gradlew run                              # Run locally
./gradlew packageDistributionForCurrentOS  # Build installers for the current OS

Kotlin DSL imports

The Kotlin DSL types live under com.seanproctor.potassium.* (for example import com.seanproctor.potassium.dsl.MacOSTargetFormat).

Coordinates

Requirements

Requirement Version Note
JDK 17+ (25+ for AOT cache)
Gradle 8.0+
Kotlin 2.0+
Node.js 18+ Required by electron-builder for installer formats

Next steps

License

MIT — See LICENSE.