Building from source
Build the LibrePortal website and this guide on your own computer, preview them, and where to look for the Android apps, LibreAdmin and the main product.
On this page
This page is for people who want to read, change or help with the code. You don't need any of it to run LibrePortal.
The main product#
LibrePortal itself is not built. It installs with the one-line installer on Install LibrePortal, and its source, the apps' definitions and the issue tracker are in the LibrePortal repository. Pull requests are welcome there. The guide's app pages are made from it, as described below.
The website and this guide#
Both are plain Eleventy sites. They need Node 20 or newer, and nothing else.
Keep the three repositories in folders next to each other:
LibrePortal/ the product
LibrePortal-Website/ libreportal.org
LibrePortal-Wiki/ this guide
The app grid, the version and the install command are read from the product's files when the site is built, as text. Nothing in the product is run. That is also why the product folder has to be there.
The website#
cd LibrePortal-Website
npm install
npm run build
The finished site is in dist/. For a live preview that rebuilds when you save a file, run npm start instead and open http://localhost:8777. npm run clean removes dist/.
This guide#
The guide shares the website's stylesheet and header, so it needs both of the other folders. Tell it where they are, then build:
cd LibrePortal-Wiki
export LP_PRODUCT_DIR=../LibrePortal
export LP_SITE_DIR=../LibrePortal-Website
npm install
npm run build
The build reads the app data, makes the pages with Eleventy and then makes the search index with Pagefind. The result is in dist/. To look at it, serve that folder with any static web server, for example python3 -m http.server 8778 --directory dist. Search works from the built pages, so run a full build before you test it.
The build stops with a message when something is wrong: a page in the navigation that doesn't exist, a page with no icon, or an app page that mentions something it shouldn't. Fix what it names and run it again.
To write a page, read STYLE.md in the guide's folder first. It covers the voice, the page format and how to add a page to the navigation.
The Android apps#
LibreSync and the LibrePortal phone app build inside Docker, so you need nothing on the computer except Docker. Each repository has a tools folder with a Dockerfile and a run.sh. Build the image once, then run Gradle through run.sh. For LibreSync:
docker build -t libresync-build:1 -f tools/Dockerfile tools
tools/run.sh ./gradlew --no-daemon testDebugUnitTest assembleDebug
That makes a debug APK you can install on your own phone. The phone app uses the same two steps with its own image name; its repository's docs/privacy-and-build.md has the exact commands. How LibreSync works inside is in its docs/DESIGN.md.
LibreAdmin#
LibreAdmin, the desktop app for looking after your servers, is early work in progress and has no download yet. It also builds inside Docker, the same way:
docker build -t libreadmin-build:1 -f tools/Dockerfile tools
tools/run.sh ./gradlew --no-daemon :shared:desktopTest :desktopApp:packageDeb
That runs the tests and makes a .deb package for Debian or Ubuntu under desktopApp/build/compose/binaries/. Install it with sudo apt install ./libreadmin_*.deb. The source is in the LibreAdmin repository.
Other repositories: LibreSync, LibrePortal Connect (a Go program with its own tests) and the Website and Wiki. Please never post passwords or keys in an issue.