Hey folks,
I've been working on a project to create self-contained, portable OpenEMR binaries and just added FreeBSD support. Thought the community might find it useful (or have feedback).
**What is it?**
OpenEMR is an open-source electronic health records system which I am a contributor to.
This project packages it into a portable distribution - PHP binary + PHAR archive + bundled shared libraries - that runs without needing to install PHP, Composer, npm, or any runtime dependencies.
**FreeBSD-specific approach:**
Unlike the Linux builds which use Docker, the FreeBSD build:
- Compiles PHP 8.5 directly from source with 35+ extensions
- Bundles required .so files (libiconv, libxml2, libssl, libicu*, etc.)
in a lib/ directory
- Sets LD_LIBRARY_PATH at runtime for true portability
- No containers, no jails - just native binaries
I went with bundled shared libs rather than fully static linking because the bundled approach seems cleaner for deployment anyway.
**Build environment:**
The build script uses QEMU to run a FreeBSD 15.0 VM - this lets anyone with a Mac build FreeBSD binaries without needing dedicated FreeBSD hardware. The entire process is automated via expect scripting (no manual VM interaction).
That said, the embedded build script can also run directly on a native FreeBSD system if you prefer.
The build script allows you to specify a FreeBSD version, an OpenEMR release tag and a PHP version as build arguments and it will auto-detect the CPU architecture you're currently running on to prepare a distribution specifically for that architecture. This should allow us to prepare portable distributions of OpenEMR for many different types of different FreeBSD installations.
**Links:**
- GitHub: https://github.com/Jmevorach/openemr-static-binary-forge/tree/main/freebsd
- FreeBSD build guide: https://github.com/Jmevorach/openemr-static-binary-forge/blob/main/freebsd/README.md
I've been working on a project to create self-contained, portable OpenEMR binaries and just added FreeBSD support. Thought the community might find it useful (or have feedback).
**What is it?**
OpenEMR is an open-source electronic health records system which I am a contributor to.
This project packages it into a portable distribution - PHP binary + PHAR archive + bundled shared libraries - that runs without needing to install PHP, Composer, npm, or any runtime dependencies.
**FreeBSD-specific approach:**
Unlike the Linux builds which use Docker, the FreeBSD build:
- Compiles PHP 8.5 directly from source with 35+ extensions
- Bundles required .so files (libiconv, libxml2, libssl, libicu*, etc.)
in a lib/ directory
- Sets LD_LIBRARY_PATH at runtime for true portability
- No containers, no jails - just native binaries
I went with bundled shared libs rather than fully static linking because the bundled approach seems cleaner for deployment anyway.
**Build environment:**
The build script uses QEMU to run a FreeBSD 15.0 VM - this lets anyone with a Mac build FreeBSD binaries without needing dedicated FreeBSD hardware. The entire process is automated via expect scripting (no manual VM interaction).
That said, the embedded build script can also run directly on a native FreeBSD system if you prefer.
The build script allows you to specify a FreeBSD version, an OpenEMR release tag and a PHP version as build arguments and it will auto-detect the CPU architecture you're currently running on to prepare a distribution specifically for that architecture. This should allow us to prepare portable distributions of OpenEMR for many different types of different FreeBSD installations.
**Links:**
- GitHub: https://github.com/Jmevorach/openemr-static-binary-forge/tree/main/freebsd
- FreeBSD build guide: https://github.com/Jmevorach/openemr-static-binary-forge/blob/main/freebsd/README.md