I am new to Play Framework (2.0.4). I have developed a little app and ran it locally on built-in play framework web server. Now I want to deploy it on remote server (APPFOG.COM or any other web server). Can some one guide me how deploy it remotely.
Whether I have to create war file, if so, then guide me how to create it and deploy it on remote server.
If there is some other way, please guide me in this regards.
Thanks in advance
For running Play Framework applications with Intellij Idea tools you need to download and install Scala plugin. You can run you play-app via command line executing play run under the application root directory.
Play comes with two configurable server backends, which handle the low level work of processing HTTP requests and responses to and from TCP/IP packets. Starting in 2.6. x, the default server backend is the Akka HTTP server backend, based on the Akka-HTTP server. Prior to 2.6.
The best place to look at is the Play documentation on Github: https://github.com/playframework/Play20/wiki/Production
In this doc, you'll find several ways to deploy your app on several providers:
But if you want to deploy your Play2 app in a servlet container (ie as a war), take a look at the play2-war-plugin.
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:
sbt dist
playGenerateSecret
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With