Prerna Rawat Prerna Rawat - 1 month ago 31
Java Question

Steps to deploy play framework application to production environment?

I got stuck in the steps to deploy the

application to standalone server. I am using
instance running on
machine. After reading the official documentation I followed these steps:

  • Install
    typesafe activator

  • Copy my project folder to

  • Run
    cd $Home/activator/projects/project

  • Run
    command. It generate the project sh file

  • Run
    cd $HOME/activator/projects/sample/target/universal
    . It shows me three things i.e.

  • Run

  • Run
    cd $Home/activator/sample/target/universal/sample-1.0/bin
    . It shows me two scripts i.e.
    (for mac and linux) and
    (for windows).

Now, I tried to run this command as documentation says:
sample-1.0/bin/sample -Dplay.crypto.secret="abcdefghijk"
but it got stuck and shows nothing except a prompt on terminal.

What next steps are required to run the application in
mode. So that server will continue to run always?

Another question is why do I need to follow these steps because just after copying the project I can easily run
activator run
command to
folder to run the server.


Now I am getting
Error: Could not find or load main class play.core.server.ProdServerStart
while running
sample -Dplay.crypto.secret="abcdefghijk"


Play Framework modes

Play like other frameworks can run in different modes because we are usually like to run our program in different situation and these situations need their configuration. Production is one of play modes. In this mode as the name suggested we are ready to deploy our application where user can use.As a result requirements are different.

Some common configuration in Production mode :

  • We are confining https
  • Using production data base not testing one
  • Play doesn't show errors
  • Play framework run as long term process and if you are log out of your server your application will run
  • If your app fails Play will clone another application and run that so your app run forever except you turn it off.
  • and so on (it is based on your Production config file)

Your answer :

If you just want to test your app in remote server and see what happened, it's okay to use activator run this command runes Play app in development mode and application will killed if you exit or log off (error will shows up and so on). But if you want to use your app for Production it is necessary to run all of these steps.