What is Beacon?
Beacon is an open-source content management system built with Phoenix LiveView, the Elixir web framework's server-rendered real-time layer. The project is maintained and supported by DockYard, an Elixir consultancy, and the code lives in the BeaconCMS organization on GitHub under the MIT license. The project describes its goal as bringing Phoenix rendering speed to content-heavy pages, with faster render times to help search performance. Beacon is not a standalone server product: it is a set of Elixir packages added to a Phoenix application, which then serves one or more Beacon sites next to its own routes.
The project is split into two main packages published on Hex. beacon is the core, which stores layouts, pages, components, stylesheets and other resources in PostgreSQL, compiles them at runtime and renders them through LiveView. Beacon LiveAdmin (the beacon_live_admin package) is a LiveView web interface for editing those resources, and can run in the same application or in a separate node of an Erlang cluster. A sample application running the latest Beacon is kept in the beacon_demo repository. Installation uses the Igniter installer: mix igniter.new my_app --install beacon,beacon_live_admin --with phx.new creates a new Phoenix project, and mix igniter.install beacon,beacon_live_admin adds Beacon to an existing one.
The current release is Beacon v0.5.1, published on April 1, 2025, alongside Beacon LiveAdmin 0.4.3. According to the changelog, v0.5.1 gives the generated default home page a cleaner and responsive design, replaces the oembed dependency with req_embed, updates dynamic_tag for recent LiveView versions and fixes MDEx options in the Markdown compiler. Version 0.5.0 of March 2025 added a :session option to beacon_site, customizable delete callbacks in the Media Library and on_mount assigns in the visual editor's page context, and moved the generated site route to the end of the router. The main branch carries version 0.6.0-dev; its unreleased changelog section raises the minimum to LiveView 1.0.0.
The README states that features may be incomplete and breaking changes can occur before a stable v1.0. It lists three main components: the core, with which a functional site can be built by inserting resources into the database and running the server; the admin interface for managing layouts, pages and other resources; and a drag and drop page builder for non-technical users, which the project describes as being in the initial stages of development. The installation guide lists PostgreSQL as the only supported database and Elixir 1.14 or later as a requirement, and the LiveAdmin README lists Erlang/OTP 25.1, Elixir 1.14.1, Phoenix 1.7.0 and Phoenix LiveView 1.0.0 as minimums.
Beacon has no hosted or paid edition; sites run wherever the Phoenix application is deployed, and the official guides cover deployment to Fly.io and several deployment topologies. The published roadmap lists planned work such as visual controls for styles in the editor, a breakpoint manager, a redesigned Media Library, a plugin and theme system, and an importer. Discussion happens in the #beacon-cms channel of the Elixir Lang Slack and in GitHub issues. Other open-source CMSs that embed in an application framework include Payload CMS for Next.js and Umbraco and Orchard CMS for .NET.
Key capabilities
- Installation with Igniter The README installs the Phoenix and Igniter archives with
mix archive.install hex phx_newandmix archive.install hex igniter_new, then runsmix igniter.new my_app --install beacon,beacon_live_admin --with phx.new --beacon.site my_sitefor a new project. For an existing Phoenix LiveView application,mix igniter.install beacon,beacon_live_admin --beacon.site my_siteadds both packages and a first site. Unreleased code can be installed from the GitHub main branch with the same commands. - Phoenix application as host Beacon runs inside a regular Phoenix application and is mounted in its router with the
beacon_sitemacro, so Beacon pages and the application's own routes share one endpoint. The URL of a page is built from the endpoint host, the router scope path, the site prefix and the page path, as described in the deployment topologies guide. - PostgreSQL storage Layouts, pages, components, live data, event handlers and other resources are stored in the database through Ecto. The installation guide states that PostgreSQL is currently the only supported database, and Beacon ships its own migrations. A recipe in the docs explains how to use a custom Ecto repo.
- Runtime compilation and rendering Resources stored in the database are compiled into modules at runtime and rendered by Phoenix LiveView, without redeploying the application when content changes. Beacon also builds the site's CSS at runtime with a Tailwind compiler and bundles JavaScript for the site, and the configuration supports a
safe_code_checkoption for code entered through the admin. - Template formats Pages, layouts and components are written in HEEx (HTML with Phoenix components) or Markdown, the two built-in formats. The
template_formatssetting lets a project register its own formats, and the Markdown renderer can be customized, as shown in the recipe on customizing Markdown rendering. - Layouts, components and stylesheets A site has layouts that wrap pages, reusable components with attributes and slots, and stylesheets, all managed as database resources. Components can be used in any page or layout template of the site, and layouts and pages each have their own publish step.
- Publishing and snapshots Pages and layouts are edited as drafts and made public with
publish_page,publish_layoutor the admin interface; each publish stores a snapshot. Lifecycle stages such asafter_publish_pageand, since v0.4.1,after_unpublish_pagerun custom code when content changes, and a recipe shows how to send a notification when a page is published. - Live Data Live Data defines assigns for a path at runtime, written as Elixir code or as plain text, that page templates read like normal LiveView assigns. The Your First Site guide uses it to show the current year in a footer, computed with
Date.utc_today().year. - Event and info handlers Event handlers respond to LiveView events from page forms and buttons, for example a newsletter form submitted with
phx-submit, and update the socket assigns. Info handlers are site-wide implementations of LiveViewhandle_info/2that react to messages from other Elixir processes. - JavaScript hooks JS hooks can be stored as Beacon resources and referenced from pages, layouts and components, a feature added in v0.4.0. Recipes cover JavaScript interoperability and loading third-party libraries inside hooks.
- Media Library The Media Library uploads and serves images and other files for a site, with providers per media type. The built-in providers store files in the database repo or in Amazon S3 through
ex_aws, image processing runs through theimagelibrary, and v0.5.0 added customizable callbacks when an asset is deleted. Pages reference uploaded images with theimagecomponent. - Page variants A page can have variants: alternate templates with a weight from 0 to 100 that sets the percentage of renders using that template. Beacon picks a variant at random according to these weights, which allows serving alternative versions of the same page.
- Error pages, sitemap and robots.txt Error pages are stored per HTTP status code with their own template and layout, so each site can define its own 404 or 500 page. Beacon also serves a generated sitemap.xml and robots.txt for each site, and v0.5.0 added a check in the proxy endpoint when host or port do not match.
- Custom page fields Projects can add extra fields to pages by implementing the
Beacon.Content.PageFieldbehaviour. The Create a Blog recipe adds a type field and a tags field to distinguish blog posts from regular pages and to list recent posts on an index page. - Multiple sites and domains One application can host several Beacon sites, each with its own prefix, and Phoenix scopes with the
:hostoption map sites to domains or subdomains. Beacon boots only the sites that can be reached on the current host, and the proxy endpoint generated bymix beacon.gen.proxy_endpointroutes requests between site endpoints. - Beacon LiveAdmin LiveAdmin is the browser interface for managing sites, mounted at a path such as
/admin. It has sections for pages, layouts, components, live data, event handlers, the Media Library and more, and finds Beacon sites running in the cluster, so it can run on a separate node connected through Erlang distribution. - Mix tasks Beacon ships Mix tasks including
beacon.install,beacon.gen.siteto create a site with its route,beacon.gen.proxy_endpointandbeacon.gen.tailwind_config. Since v0.4.3,gen.siteaccepts--host-devto set the host used in local development. - Documentation and testing helpers Guides, recipes and API reference are published on HexDocs, with upgrade guides for each minor version. A testing recipe and the
Beacon.Testmodules help applications test their Beacon sites, and the repository includes adev.exsscript that starts a self-contained Phoenix app with sample data.
Where Beacon fits
Adding a CMS to an existing Phoenix application
The installation guide covers teams that already run Phoenix LiveView and want editors to manage pages inside the same application. mix igniter.install beacon,beacon_live_admin adds the dependencies, configuration and migrations, and mix beacon.gen.site --site my_site --path / creates a site and its route. The guide points out that route order in router.ex matters and that the generated changes should be reviewed in the router file.
Building a first marketing site
The Your First Site guide starts the server with mix setup and mix phx.server, opens the default home page on port 4000 and the admin at /admin. It then creates a Live Data assign for the current year, an event handler for a waitlist form, uploads an image to the Media Library and rewrites the home page template in HEEx with Tailwind classes to use all three.
Running a blog
The Create a Blog recipe mounts a second site at /blog, adds custom page fields for post type and tags, renders posts with the Tailwind typography plugin and builds an index page that lists the most recent posts. Posts can be written in Markdown or HEEx and go public through the publish step.
Hosting several domains from one application
The multiple domains recipe and the deployment topologies guide show sites matched to hosts with Phoenix scopes, for example one site per domain and the admin under a prefix on the root domain. The endpoint's :check_origin option has to list the allowed origins, and Beacon starts only the sites reachable on each host, so nodes do not boot sites they never serve.
Separating admin and public nodes
Because LiveAdmin discovers Beacon sites across connected Erlang nodes, the admin can run in its own application while public sites run on other nodes. The LiveAdmin README describes the local version of this setup: start the admin node, start a Beacon node and connect them with Node.connect/1. Clustering on platforms such as Fly.io or Gigalixir is left to the platform documentation.
Deploying to Fly.io
The Fly.io guide generates a Dockerfile with mix phx.gen.release --docker, edits it to install the npm assets and the Tailwind binary and copies files into the release, then runs fly launch, where the guide answers yes to setting up a PostgreSQL database, and deploys with the fly CLI. Media can stay in the database or move to S3 by registering the S3 provider for the relevant media types in the site configuration.
Install
mix igniter.new my_app --install beacon,beacon_live_admin --with phx.new --beacon.site my_siteReviews of Beacon
Be the first to share your experience with Beacon.
Write a review
Loading review form…
Found Beacon useful? Upvote it todayYour vote helps other IT teams find it in the daily ranking.
