sbt stage, and the web process runs the start script that Play writes, on the Java 25 runtime. Ingot, Sevalla’s default builder, builds Maven and Gradle projects but not sbt projects, so you choose the Dockerfile build strategy before the first deployment: with Ingot, the build stops with Ingot couldn't tell what kind of application this is. Play listens on the port that Sevalla sets in the PORT environment variable once conf/application.conf reads it.
At a glance
Environment variables
Before you begin
- A Sevalla company with a payment method, and a GitHub, GitLab or Bitbucket account for the repository. See Git providers.
- A Java 25 JDK and sbt 1.13 on your computer.
Create the project
Create a project namedstorefront from Play’s official Scala template:
/ that shows Welcome to Play!. The template pins the Play sbt plugin at 3.0.11. Raise it to the latest release, 3.0.12, in project/plugins.sbt:
project/plugins.sbt
Prepare the project for Sevalla
Add these lines to the end ofconf/application.conf:
conf/application.conf
Each
${?NAME} reads an environment variable when Play starts, and leaves the setting as it is when the variable isn’t set.
Add a route for the readiness probe at the end of conf/routes:
conf/routes
app/controllers/HomeController.scala, after index():
app/controllers/HomeController.scala
+ anyhost exempts this one route from the check, so the probe gets 200 while every other route still checks the host.
Replace conf/logback.xml, which writes the log to a file and adds color codes, with a configuration that writes plain lines to the standard output, where Sevalla collects the runtime logs:
conf/logback.xml
Failed to create parent directories for [/app/./logs/application.log]: the image has no writable logs folder, and a log file in an instance is lost at the next deployment anyway. The pattern leaves out the date, because the runtime logs show the time of each line.
Run
sbt run and open http://localhost:9000 to check the application locally.
Deploy with a Dockerfile
Ingot doesn’t build sbt projects, so Sevalla builds this application from a Dockerfile that you add to the repository. Add aDockerfile and a .dockerignore to the root of the project:
Dockerfile
.dockerignore
.dockerignore keeps the Git history, sbt’s and your editor’s local folders, the template’s .g8 folder, local build output, the log and process ID files of sbt run and local environment files out of the build. Build the image locally to check it:
lib/. Initialize a Git repository, commit everything and push it to your Git provider:
Deploy to Sevalla
These steps build from the Dockerfile in Deploy with a Dockerfile. A new application builds with Ingot, which can’t build an sbt project, so choose the Dockerfile build strategy before you deploy.1
Create the application
In the sidebar, click Applications, then click Create > Application. Under Source, click Private repository, then choose the Git provider, the Repository and the Branch. Under Location, choose a Data center. Keep the Size at H1 or choose a larger one, then click Create application. The application opens on its Overview tab with the status Not deployed yet: creating an application doesn’t deploy it.
2
Choose the Dockerfile build strategy
Click the Settings tab. In the Build strategy section, click Update build strategy. Click Dockerfile, keep the Dockerfile path
Dockerfile and the Docker context ., then click Update build strategy.3
Add the environment variables
Click the Environment variables tab, then click Add environment variables. Add these variables, clear Available during buildtime, and click Add environment variables:
4
Add the readiness probe
Click the Processes tab, click ⋯ on the Web process, then click Update process. Under Health checks, turn on Readiness probe and set the Path to
/health. Keep the Port at the web process’s port, 8080 unless you changed it, then click Update process.5
Deploy
Click the Overview tab, then click Deploy now under Recent deployments. Check the Branch and click Deploy.
6
Turn on auto-deploy
To deploy every push to the branch automatically, click the Settings tab, then click Update auto-deploy in the Auto-deploy section. Turn on Auto-deploy and click Update auto-deploy. See Deployments.
Verify the deployment
- On the Deployments tab, click the deployment. Its Build log starts the build with
📦 Building and pushing docker image using Dockerfile..., then shows thesbt updateandsbt stagesteps. The deployment’s Dockerfile tab shows the file the image was built from. - Wait for the deployment’s status to change to Deployed. The deployment waits until the new instance answers the readiness probe. The application’s status next to its name changes to Running.
- Click the domain under the application’s name, for example
storefront-x7k2m.sevalla.app. The page showsWelcome to Play!


Application started (Prod), then Listening for HTTP on /[0:0:0:0:0:0:0:0]:8080. If the deployment fails, read its build log and the runtime logs, then see Troubleshoot.
To check the deployment from a terminal or an AI agent, read its status with Get deployment (getDeploymentV3) until it’s success, and its build log with Get application deployment logs (getApplicationDeploymentLogsV3), as in Deploy with the API. The build log names the Dockerfile build:
getProcessV3) returns the web process’s probe in readiness_probe:
getApplicationRuntimeLogsV3) with search finds the address Play listens on:
Size the web process
On H1, the smallest size, with a memory limit of 300 MiB, Play started in about 14 seconds, from the JVM’s first log line toListening for HTTP, and the Memory usage chart on the application’s Analytics tab reached the limit. The application served every request in the test. For traffic, scale the web process to S1 or larger. The readiness probe keeps a slow start from taking requests before Play listens. See Size the JVM memory.
Allow your domains
Play’s allowed hosts filter answers a request only when itsHost header is in play.filters.hosts.allowed. Any other request gets 400 with a page titled Bad Request, and the runtime logs show Host not allowed: followed by the host. The list starts with localhost, .local and 127.0.0.1, and conf/application.conf adds the domain in ALLOWED_HOST. If you set ALLOWED_HOST to another domain, the application’s own domain gets 400 too.
To serve the application on a custom domain as well as on its sevalla.app domain, add the custom domain in conf/application.conf, next to the ALLOWED_HOST line:
conf/application.conf
".example.com", allows the domain and all its subdomains.
Shut down gracefully
When Sevalla stops an instance, during a deployment, a restart or a scale-down, it waits 5 seconds, sendsSIGTERM, and stops the instance if it’s still running 30 seconds after the shutdown began. See How processes run.
The JVM receives SIGTERM and runs Play’s shutdown hook. Play stops taking new connections, logs Unbinding /[0:0:0:0:0:0:0:0]:8080, and waits up to 5 seconds for the requests in progress, the default timeout of the service-requests-done phase of Pekko’s coordinated shutdown, before it closes them. The old instance’s runtime logs end with Running provided shutdown stop hooks on every deployment after the first. To wait longer for slow requests, set play.server.terminationTimeout and pekko.coordinated-shutdown.phases.service-requests-done.timeout in conf/application.conf, both under 25 seconds.
Deploy changes
With Auto-deploy on, every push to the branch starts a deployment; otherwise, click Deploy now for each change. Each deployment builds the image from the Dockerfile, waits for the new instance to answer the readiness probe, then replaces the old one. When only your code changes, the build log showsCACHED for the sbt update step, so the build downloads nothing again. See Deployments.
Use environment variables
Add configuration on the application’s Environment variables tab and read it inconf/application.conf with ${?NAME}, as the file reads PORT, or in code with sys.env. Variables apply at the next deployment. Variables marked Available during buildtime arrive in the Docker build as build arguments, which a stage reads only after an ARG line for each one. See Environment variables.
Add a custom domain
To serve the application from your own domain, such asshop.example.com, add the domain on the application’s Domains tab and create the DNS records that Sevalla shows. Then add it to the allowed hosts, as in Allow your domains, and deploy. Custom domains need a web process larger than H1, so scale the web process first. See Custom domains.
Troubleshoot
For more causes, see Troubleshoot builds and deployments.
Deploy with the API
These calls make the same deployment as Deploy to Sevalla, in an order that a script or an AI agent runs as it is. Each step names the Sevalla API operation, then the CLI command and the MCP server tool that do the same. You need:- An API key with the Company developer role, or the
APP:CREATE,APP:READandAPP:UPDATEpermissions, in theSEVALLA_API_KEYenvironment variable. The CLI reads the key fromSEVALLA_API_TOKEN. - The repository on a Git provider that’s connected to your Sevalla account. See Git providers. Creating the application checks it: when Sevalla can’t read the repository, the call returns
400withCannot access repository https://github.com/acme/storefront: Repository not found or you don't have access., followed by where to grant access. curl,jqandopenssl.
1
Choose the location
List clusters (CLI:
listClustersV3) returns the locations your company can use, each with its id, the display_name that the dashboard shows and its region ID in location. Keep the ID of the one you want by its region ID, such as eu-frankfurt-1 for Frankfurt, Germany. Locations lists them all:sevalla resources clusters. MCP: get_platform_options.2
Create the application
Create application (CLI:
createApplicationV3) creates the application with a web process. It isn’t deployed yet:sevalla apps create --name storefront --cluster $CLUSTER_ID --source privateGit --git-type github --repository https://github.com/acme/storefront --branch main. MCP: create_application with deploy set to false.3
Choose the Dockerfile build strategy
The application builds with Ingot (CLI:
build_type is ingot), which can’t build an sbt project. Update application (updateApplicationV3) switches it to the Dockerfile at the root of the repository:sevalla apps update $APP_ID --data '{"build_type":"dockerfile","dockerfile_path":"Dockerfile","docker_context":"."}'. MCP: sevalla_api_update with updateApplicationV3 and the same body.4
Find the domain
List application domains (CLI:
listApplicationDomainsV3) returns the domain that Sevalla gives the application. It appears a few seconds after the application is created, so ask until it’s there:sevalla apps domains list --app-id $APP_ID. MCP: get_application.5
Add the environment variables
Create environment variable (CLI:
createEnvironmentVariableV3) adds a new secret in APPLICATION_SECRET and the domain in ALLOWED_HOST, available at runtime only:sevalla apps env-vars create $APP_ID --key ALLOWED_HOST --value $HOST, once per variable; it always makes a variable available during the build and runtime. MCP: set_environment_variables with buildtime set to false.6
Find the web process
List processes (CLI:
listProcessesV3) returns the web process that the application was created with:sevalla apps processes list --app-id $APP_ID. MCP: get_application.7
Find the H1 size
List process resource types (CLI:
listProcessResourceTypesV3) returns the sizes by name, in lowercase:sevalla resources process-types. MCP: get_platform_options.8
Set the size and the readiness probe
The API creates the web process at S1, where the dashboard’s default is H1. Update process (CLI:
updateProcessV3) sets the size and adds the readiness probe on /health, with the dashboard’s default timings. Send timeoutSeconds: a probe without it gets 120 seconds, where the dashboard sets 1:sevalla apps processes update $WEB_ID --app-id $APP_ID --resource-type $H1_ID sets the size; it has no option for the probe. MCP: sevalla_api_update with updateProcessV3 and the same body.9
Turn on auto-deploy
Update application (CLI:
updateApplicationV3) turns on automatic deployments for every push to the branch:sevalla apps update $APP_ID --data '{"auto_deploy":true}'. MCP: sevalla_api_update with updateApplicationV3.10
Deploy
Trigger deployment (CLI:
triggerDeploymentV3) deploys the latest commit on the branch:sevalla apps deployments trigger $APP_ID --branch main. MCP: trigger_deployment.11
Wait for the deployment
Get deployment (CLI:
getDeploymentV3) returns the deployment’s status: waiting and inProgress while it runs, then success, failed, cancelled or skipped. Poll it until the status is final, for up to 30 minutes:sevalla apps deployments get $DEPLOYMENT_ID --app-id $APP_ID. MCP: get_deployment.12
Read the build log
Get application deployment logs (CLI:
getApplicationDeploymentLogsV3) returns the build log, oldest line first: the checkout, the Docker build and the rollout. When the status is failed, the last lines say why. Without limit, it returns the latest 1,000 lines:sevalla apps deployments logs $DEPLOYMENT_ID --app-id $APP_ID --limit 5000. MCP: get_deployment_logs.13
Check the application
Request the home page from the application’s domain:Then run the other checks in Verify the deployment.