Play 2 Packaging

Although Play 2 supports Sbt Native Packager, it requires some additional steps to successfully package and run your application.


there are also two sections in the play documentation that describe deploying and configuring:

Build Configuration

Depending on whether you want to package your application as a deb-package or as an rpm-package, you have to setup your build configuration accordingly. Please, refer to Debian Plugin and Rpm Plugin pages for additional information.

Note that Upstart is not supported by all available operation systems and may not always work as expected. You can always fallback to the SystemV service manager instead. For more information on service managers please refer to Java Server Application Archetype page.

Application Configuration

In order to run your application in production you need to provide it with at least:

  • Location where it can store its pidfile
  • Production configuration

One way to provide this information is to append the following content in your build definition:

javaOptions in Universal ++= Seq(
  // JVM memory tuning

  // Since play uses separate pidfile we have to provide it with a proper path
  // name of the pid file must be

  // alternative, you can remove the PID file
  // s"-Dpidfile.path=/dev/null",

  // Use separate configuration file for production environment

  // Use separate logger configuration file for production environment

  // You may also want to include this setting if you use play evolutions

This way you should either store your production configuration under ${{path_to_app_name}}/conf/production.conf or put it under /usr/share/${{app_name}}/conf/production.conf by hand or using some configuration management system.


Your pid file must be called


If you use a system using SystemV start script make sure to provide a etc-default in src/templates and set the PIDFILE environment variable.

# Setting JAVA_OPTS
# -----------------
# you can use this instead of the application.ini as well
# JAVA_OPTS="-Dpidfile.path=/var/run/${{app_name}}/ $JAVA_OPTS"

# For rpm/systemv you need to set the PIDFILE env variable as well

See customize section for Java Server Application Archetype for more information on application.ini and etc-default template.