Deploying a Ktor App

Updated on 28 May 2026

You can find the step-by-step deployment guide here.

This guide explains how to build and deploy a Ktor application on Hostman App Platform. It covers the build environment, JAR selection process, and the runtime requirements your application must meet for a successful deployment.

Building the Application

The application is built using the following environment:

  • OpenJDK
  • Kotlin
  • Gradle

The build process runs in the root of the repository or in the directory specified in the Project directory path field.

If the project includes a gradlew file, the template uses Gradle Wrapper for the build process. If gradlew is not present, the system Gradle installation is used instead.

By default, the following build command is executed:

./gradlew buildFatJar --no-daemon

If Gradle Wrapper is not available, the following command is used instead:

gradle buildFatJar --no-daemon

Selecting the JAR File to Run

After the build is completed, App Platform selects the JAR file to run using the following logic:

  1. If the build/libs/ directory contains a file matching the *-all.jar pattern, that file is used. This is typically the fat JAR generated by Ktor.
  2. If no *-all.jar file is found, the platform uses the first .jar file found in the build/libs/ directory.

Make sure the Ktor Gradle plugin is configured correctly and that the buildFatJar task is available in the project.

Application Requirements

Make sure your application listens on 0.0.0.0 instead of 127.0.0.1. Otherwise, external connections will not be able to reach the application.

Was this page helpful?
Updated on 28 May 2026

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support