Getting started
Requirements
Setup
-
Install Phoenix
git clone https://github.com/phoenixframework/phoenix.git && cd phoenix && mix do deps.get, compile
-
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
-
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