Getting Started with Play Framework

New to Play?

Start with our documentation or the Hello World Tutorial.

» Learn whether Play Framework is right for your project

» Follow the Hello World Tutorial

Play requires Java 8 or higher. You can check your version with the java -version command or install it from Oracle's site. See details about Play's system requirement.

First, download the starter project:

Play 2.6.x Starter Projects

Play Java Starter Example Download (zip) View on GitHub
Play Scala Starter Example Download (zip) View on GitHub

Play 2.5.x Starter Projects

Play Java Starter Example (2.5.x) Download (zip) View on GitHub
Play Scala Starter Example (2.5.x) Download (zip) View on GitHub

Then, unzip the project in a convenient location and follow the directions in the README.md file to build and run the tutorial.

Already know a bit about Play?

Check out our example projects for Java or Scala. The downloadable zip files include everything you need, including sbt, Play Framework, and an HTTP server. Examples also support Gradle. You can also create a Play project from the command line using a template if you have sbt installed already.

Play requires Java 8 or higher. You can check your version with the java -version command or install it from Oracle's site. See details about the requirements to work with Play.

» Try a focused example

Follow these steps to try an example project:

  1. Choose an example from Lightbend's Tech Hub.
  2. Click "CREATE A PROJECT FOR ME" to download the zipped project.
  3. Unzip the project in a convenient location.
  4. In a command window, navigate to the top level project directory.
  5. Enter one of the following commands:
    • On macOS or Linux systems: ./sbt run or ./gradlew runPlayBinary
    • On Windows systems: sbt.bat run or gradlew.bat runPlayBinary
  6. The build tool downloads dependencies and compiles the project.
  7. After the build finishes, enter the following URL in a browser to view the app: http://localhost:9000/

Check out the README.md file in the top level project directory to learn more about the example.

» Create a Play Java or Scala project using sbt new

In a command window, enter one of the following lines to create a new project:

Java seed template

sbt new playframework/play-java-seed.g8

Scala seed template

sbt new playframework/play-scala-seed.g8

After the template creates the project:

  1. Enter sbt run command to download dependencies and start the system.
  2. In a browser, enter http://localhost:9000 to view the welcome page.