You don't need to deploy your play app on an application server like tomcat or using a WAR file format. Play already comes with its own bundled server.
For Play version 2.6: "Play now uses the Akka-HTTP server engine as the default backend."
Past versions were using Netty as default. It is still supported but must be explicitly configured.
For deploying your app you need to create a distribution package to do that run on your project home folder:
sbt dist
A binary distribution is created: "This produces a ZIP file containing all JAR files needed to run your application in the target/universal folder of your application.
To run the application, unzip the file on the target server, and then run the script in the bin directory. The name of the script is your application name, and it comes in two versions, a bash shell script, and a windows .bat script."
These are the steps to deploy your app:
- Create a distribution package
sbt dist
- Generate your application secret run:
playGenerateSecret
- Copy and Unzip the package in your server and Run the app's binary start script and pass the secret as a param:
unzip my-first-app-1.0.zip
my-first-app-1.0/bin/my-first-app -Dplay.http.secret.key=abcdefghijk
Check more details about deployment instructions here.
You may also want to investigate other deployment formats using SBT Native Packager as it provides artifact generating capabilities for various formats including:
- OS X disk images
- Microsoft Installer (MSI)
- RPMs
- Debian packages
- System V / init.d and Upstart services in RPM/Debian packages