Docs menu

Getting started with Scala

Deploy a minimal Scala Play app to Primcloud end-to-end from a sample repo, in about ten minutes.

On this page

This guide takes a small Scala Play app from a git repo to a running URL on Primcloud. You'll fork a sample, import it, watch the build, and open the deployed app at its *.primcloud.app address. Budget about ten minutes. A Scala build runs longer than most languages the first time through, before the caches are warm.

Before you start#

You'll need:

  • A Primcloud account. Creating one costs nothing; compute is metered by the minute once you deploy, from around $5/mo for the smallest app.
  • A git provider connected to your account, with access to at least one repo.
  • Optional: sbt and a JDK locally, if you want to run the sample or change it before deploying. The sample targets JDK 25 and sbt 1.11.7.

The sample app#

Use Heroku's heroku/scala-getting-started repo, a minimal Play app that deploys on Primcloud with no changes. Fork it into an account your connected provider can see, so Primcloud can pull from it.

The sample already carries the three files a Scala app on Primcloud relies on:

  • project/build.properties pins sbt.version (1.11.7 here).
  • system.properties pins java.runtime.version, the OpenJDK major (25 here).
  • Procfile declares the web command that launches the packaged app.

1. Create the application#

From the dashboard, hit Import Git Repository on the applications list. The wizard is three steps:

  1. Pick a repository: your fork of scala-getting-started.
  2. Configure the deployment:
    • Branch: main, the fork's default.
    • Region: US East (NYC).
  3. Review and create: Primcloud provisions the app's primary *.primcloud.app subdomain on the production environment.

2. Deploy#

The first deployment starts on its own when the app is created. Watch it stream in the Deployments tab:

  • Detection. Primcloud finds build.sbt and project/build.properties and picks the Scala toolchain.
  • JDK. OpenJDK is resolved from system.properties (java.runtime.version=25 in the sample) and installed.
  • sbt. Primcloud fetches the sbt version pinned in project/build.properties (1.11.7) and runs the build with it.
  • Build. sbt compile stage runs. Play pulls in sbt-native-packager and wires up the stage task, which assembles the runnable app under target/universal/stage/.
  • Release. Primcloud starts the web process, running the sample's Procfile line: target/universal/stage/bin/scala-getting-started -Dhttp.port=${PORT}.

Expect the first build to take a few minutes. sbt downloads Play, the Scala library, and their transitive dependencies from Maven Central the first time through. Later deploys reuse the cached Ivy and Coursier stores and finish much faster.

When the status flips to Release Succeeded, the app is live.

3. Reach the app#

The application dashboard shows the assigned *.primcloud.app URL in its header. Open it, and the sample's landing page renders.

If it doesn't come up:

  • Deployments: the build log holds the raw sbt output, including any compile or stage error.
  • Logs: your app's runtime output streams here, including Play's startup banner and any unhandled exception.
  • Confirm the app binds to $PORT. Primcloud sets that variable on the web process, and the sample passes it through with -Dhttp.port=${PORT}.

Where to go next#