Deploying the Play 2.0 application on Heroku

Knoldus Inc.
Knoldus - Technical Insights
2 min readApr 2, 2012

We are working on a project using Play freamework with Scala programming language. Here we’ll discuss about the deployment of the play application on Heroku. This is a very straightforward process. You just have need to follow some simple steps and your application will be on Heroku in minutes.




1. Heroku needs a file named ‘Procfile’ for each application to be deployed on it. Procfile is a mechanism for declaring what commands are run when your web or worker dynos are run on the Heroku platform. Find more about Procfile here. Create a file Procfile and put it in the root of your project directory.

2. Add the following line to your Procfile that you had just created:
[code language=”scala”]
web: target/start -Dhttp.port=$PORT -DapplyEvolutions.default=true
[/code]

3.Now Initiate the git session for your project and add files to git as
[code language=”scala”]
git init
git add .
[/code]

4. Commit the changes for the project to git as:
[code language=”scala”]
git commit -m init
[/code]

5. On the command line create a new application using the “cedar” stack:
[code language=”scala”]
heroku create -s cedar
[/code]
Celedon Cedar is Heroku’s most recent runtime stack.

6.The application is ready to be deployed to the cloud. push the project files to heroku as:
[code language=”scala”]
git push heroku master
[/code]
7. Go to your heroku account -> MyApps and you’ll find a new application that you had just created. Launch the URL and have a look to your running application on heroku. You can also rename your application as well.

Heroku Applications

--

--

Knoldus Inc.
Knoldus - Technical Insights

Group of smart Engineers with a Product mindset who partner with your business to drive competitive advantage | www.knoldus.com