Install Beacon and Beacon LiveAdmin in a new Phoenix LiveView application to enable running and managing sites.
- If you already have a Phoenix LiveView application that meets the minimum requirements for Beacon and Beacon LiveAdmin, you can skip to step 6.
- Beacon LiveAdmin can be installed in a separated application in a cluster environment but such advanced setup is not covered in this guide.
- Install Elixir v1.14 or later
Check out the official Elixir install guide for more info.
- Update Hex
mix local.hex
If that command fails or Elixir version is outdated, please follow the Elixir Install guide to set up your environment correctly.
- Install Phoenix v1.7 or later
mix archive.install hex phx_new
Check out the official Phoenix install guide for more info.
- Setup a PostgreSQL database
We recommend using PostgreSQL that's officially supported, make sure it's installed and running.
- Generate a new Phoenix application
mix phx.new --install my_app
Note that Beacon supports Umbrella applications as well.
- Change the existing
:floki
dependency to make it available in all environments
- {:floki, ">= 0.30.0", only: :test},
+ {:floki, ">= 0.30.0"},
- Add
:beacon
and:beacon_live_admin
dependencies tomix.exs
+ {:beacon, "~> 0.1.0", override: true},
+ {:beacon_live_admin, ">= 0.0.0"},
- Add
:beacon
and:beacon_live_admin
into:import_deps
in file.formatter.exs
- import_deps: [:ecto, :ecto_sql, :phoenix],
+ import_deps: [:ecto, :ecto_sql, :phoenix, :beacon, :beacon_live_admin],
- Install deps
mix deps.get
Beacon is installed but you have no sites yet. Follow the Your First Site guide to setup one and get familiar with Beacon.