2 Getting started
gregpardo edited this page 2014-12-31 08:08:01 -08:00

Getting started

Requirements

  • Elixir v0.15.1

Setup

  1. Install Phoenix

     git clone https://github.com/phoenixframework/phoenix.git && cd phoenix && mix do deps.get, compile
    
  2. Create a new Phoenix application

     mix phoenix.new your_app /path/to/scaffold/your_app
    

    Important: Run this task in the Phoenix installation directory cloned in the step above. The path provided: /path/to/scaffold/your_app/ should be outside of the framework installation directory. This will either create a new application directory or install the application into an existing directory.

    Examples:

     mix phoenix.new your_app /Users/you/projects/my_app
     mix phoenix.new your_app ../relative_path/my_app
    
  3. Change directory to /path/to/scaffold/your_app. Install dependencies and start web server

     mix do deps.get, compile
     mix phoenix.server
    

When running in production, use protocol consolidation for increased performance:

   MIX_ENV=prod mix compile.protocols
   MIX_ENV=prod PORT=4001 elixir -pa _build/prod/consolidated -S mix phoenix.server