VlkrS

VlkrS

Note: This is a HOWTO, not a question. I hope this is an appropriate place to share this, so it can be found by others who might run into problems getting Phoenix to work fully on OpenBSD.

Recent versions of Phoenix are tightly integrated with both TailwindCSS and esbuild, and mix phx.new installs binary distributions of both.
Unfortunately that doesn’t work out of the box on OpenBSD, and needs a few extra steps to be carried out right after initializing a project.

Tailwind

The automatically installed Linux binary obviously will never work on OpenBSD. Therefore we will need to manually install tailwind:

First install NodeJS:

$ doas pkg_add node

then Tailwind and the Forms plugin:

$ npm install -D tailwindcss
$ npm install -D @tailwindcss/forms

It’s possible that this creates a version mismatch between the version of tailwind installed by npm and the version from the default configuration. If that’s the case, just adjust the version in config/config.exs:

...
# Configure tailwind (the version is required)
config :tailwind,
  version: "<your version here>",
...

now all that’s left is to replace the binary _build/tailwind_linux_x64:

$ > _build/tailwind_linux_x64

with a small shell script

#!/bin/sh

npx tailwindcss "$@"

At this point we’re done. All the Tailwind integrations will now work on OpenBSD in the same way as on Linux.

esbuild

Those working with 11th gen or later Intel CPUs will notice that the esbuild binaries released by the esbuild team will crash on OpenBSD.
(see Install fails on OpenBSD · Issue #3523 · evanw/esbuild · GitHub for details)

Fortunately that’s also easy to fix by building esbuild with OpenBSDs patched go compiler and copying the resulting binary over _build/esbuild_openbsd_x64.

Showing Posts 8 to 1

VlkrS

VlkrS OP

The OpenBSD version is irrelevant here. More recent versions of Phoenix use Tailwind v4, Tailwind v4 uses Parcel, Parcel wants to install a binary but doesn’t provide said binary for OpenBSD.

Phoenix itself works, but Tailwind version 4 doesn’t.

Slesa

Slesa

It sounds very good at the start. It seems to work with the tailwind script. But on OpenBSD 7.8, I get the error

No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-openbsd-x64.
krasenyp

krasenyp

I think it’s time to sit down and write a tutorial on packaging Elixir releases as FreeBSD ports. It allows installation as just another program and one can easily distribute them with a custom port repository.

VlkrS

VlkrS OP

The BSDs share common ancestry and the tailwind issue. Unfortunately, the solution that (I believe) @dch built for FreeBSD doesn’t easily translate to OpenBSD.
Having said all that, Horizon is a seriously cool project! :grinning:

linusdm

linusdm

This made me think of the horizon library by @jimfreeze GitHub - jfreeze/horizon: Horizon deployment · GitHub

He also made an effort to run Phoenix apps on FreeBSD (to be honest, I don’t even know the exact relation between OpenBSD and FreeBSD, so this might not even be relevant).

LostKobrakai

LostKobrakai

VlkrS

VlkrS OP

Update: Starting with OpenBSD 7.7-current, esbuild is provided as port.

Therefore, esbuild problems can be solved as simply as

$ doas pkg_add esbuild
$ ln -s /usr/local/bin/esbuild _build/esbuild-openbsd-x64

on affected systems.

krasenyp

krasenyp

Run all the things on *BSD! Thank you for the guide!

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
thiagogsr
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews