atoll CLI and an account. See Getting started for the CLI.
1. Create the project
Make a directory with three files:settings.gradle.kts:
build.gradle.kts:
application plugin and the ktor-server dependency are what tell the platform this module is a Ktor server.
2. Listen on PORT
src/main/kotlin/Main.kt:
PORT. Locally, the server falls back to 8080.
3. Add the Gradle wrapper
The platform builds with your wrapper, so the project needs one:4. Deploy
: because the server is the root project. Open the URL.
5. Add a database URL
Set the URL as a secret that only the running server sees. It contains a password, so put it in a file instead of typing it on the command line, where it would end up in your shell history:System.getenv("DATABASE_URL"). Env var changes apply on the next deployment. Run atoll deploy again, or use Redeploy production in the panel’s Env tab.
6. Watch it
atoll listshows your deployments and their URLs.atoll logs 3c9e41a0prints the build log again.atoll logs --project hello --followshows what your server prints while it runs, and so does the panel’s Logs tab.
Next
- Full-stack Kotlin adds a web app and an Android app to the same build.
- Custom domains puts the server on your own domain.