Getting Started with Play Framework on Heroku
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
-
Login to Heroku from the command line:
bash heroku auth:login
-
Create a new Play! app:
bash play new play_hello_world cd play_hello_world
-
Run the app locally to test it:
bash play run --%production
-
Create a git repo, add the files, and commit:
bash git init git add app conf lib public test git commit -m init
-
Create a new app on Heroku:
bash heroku create -s cedar
-
Push the app to Heroku:
bash git push heroku master
-
Open the app in your browser:
bash heroku open
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.