---
title: "How to Deploy a Ktor Application | Hostman Docs"
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

You can find the step-by-step deployment guide [here](https://hostman.com/docs/app-platform/backend-apps/).

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:

```shell
./gradlew buildFatJar --no-daemon
```

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

```shell
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.
