You can run your Phoenix dev server on a different port that tcp/4000.

# myapp/config/dev.exs
config :my_app, MyApp.Endpoint,
  http: [port: System.get_env("PORT") || 4000],

Phoenix will use the ENV variable “PORT” if it exists. Otherwise it will fallback to tcp/4000. Then from the terminal

$ PORT=4003 mix phx.server

or

$ PORT=4003 iex -S mix phx.server

reference: Chris McCord’s answer on github

Tested on
elixir 1.4.4
phoenix 1.3.0
macOS Sierra 10.12.6