Deploying server-side Kotlin Ktor applications on Dokku

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • dokku-letsencrypt

    Automatic Let's Encrypt TLS Certificate installation for dokku

  • As you may have noticed, our application is available on our Dokku host now – but only in an unencrypted fashion (note the lack of https in the address bar). Thankfully, we live in the age of LetsEncrypt offering free TLS certificates, and Dokku makes it easy to enable automatic certificate retrieval and setup for our application via the dokku-letsencrypt plugin. I strongly recommend setting up this plugin so that people using our application can enjoy securely encrypted web-traffic. Once installed (see installation and initial setup instructions), we can enable the LetsEncrypt integration for our application with a single command:

  • heroku-buildpack-gradle

    Heroku's buildpack for Gradle applications.

  • Our application needs to provide a stage task: Dokku uses this task via Heroku’s Gradle buildpack to turn our program into an executable when deploying.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • config

    configuration library for JVM languages using HOCON files

  • Because the Ktor wizard comes with a clever default configuration, we don’t actually need to make any changes here – our app is already configured to respect the PORT environment variable. We can see this in the application.conf file in the resources directory of our project. This HOCON file sets the default port of our application to 8080, optionally overriding it with the content of the PORT environment variable when it is present:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts