UPDATE: This tutorial is for Play 1.x (an old version). Check out my Play 2 Tutorial if you want to get started with the latest stuff.
Last week Heroku announced that you can now run Java apps on Heroku. Today Heroku announced that you can also easily run Play Framework apps on Heroku! Here’s a quick guide to getting started with Play! on Heroku:
- Install the heroku command line client on Linux, Mac, or Windows.
- Install git and setup your SSH key
- Install Play! version 1.2.3
Login to Heroku from the command line:
- Create a new Play! app:
play new play_hello_world cd play_hello_world
- Run the app locally to test it:
play run --%production
- Create a git repo, add the files, and commit:
git init git add app conf lib public test git commit -m init
- Create a new app on Heroku:
heroku create -s cedar
- Push the app to Heroku:
git push heroku master
- Open the app in your browser:
That’s it! If you want to learn more about Heroku, check out the Heroku for Java Workbook and the Heroku Dev Center. And if you are at Dreamforce 2011 then check out Felipe Oliveira’s session on “Introducing Play! Framework: Painless Java and Scala Web Applications” on Wednesday at 3:30pm.
Let me know what you think and if you have any questions.