Nodetool can be packaged and distributed as a Flatpak application for Linux systems. Flatpak provides a sandboxed environment with consistent dependencies across different Linux distributions.
Important: As of the latest release, Flatpak builds are independent from the main release workflow and are built through a dedicated CI pipeline that does not block releases.
Flatpak packages are automatically built by the Flatpak CI workflow which:
- Runs on every push to
mainbranch - Can be manually triggered via workflow_dispatch
- Does NOT block GitHub releases
- Produces downloadable artifacts for testing
- Runs in isolation from AppImage and macOS builds
- Non-blocking: Build failures do not affect releases
- Independent: No dependencies on other build workflows
- Containerized: Runs in Flatpak-capable container (
ghcr.io/flathub-infra/flatpak-github-actions) - Cached: SDKs, runtimes, and node_modules are cached for faster builds
- Secure: No signing keys required for CI builds
- Go to Actions tab
- Click on a successful workflow run
- Download the artifact (e.g.,
nodetool-abc12345-x86_64.flatpak) - Install locally:
flatpak install --user nodetool-abc12345-x86_64.flatpak flatpak run ai.nodetool.NodeTool
- Flatpak and flatpak-builder installed
- Required runtimes:
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install --user -y flathub org.freedesktop.Platform//24.08 flatpak install --user -y flathub org.freedesktop.Sdk//24.08 flatpak install --user -y flathub org.electronjs.Electron2.BaseApp//24.08
# Clone the repository
git clone https://github.com/nodetool-ai/nodetool.git
cd nodetool
# Build Flatpak
flatpak-builder \
--user \
--install-deps-from=flathub \
--force-clean \
--repo=flatpak-repo \
build-dir \
electron/ai.nodetool.NodeTool.flatpak.yml
# Create bundle
flatpak build-bundle flatpak-repo nodetool.flatpak ai.nodetool.NodeTool stable
# Install
flatpak install --user nodetool.flatpakThe Flatpak manifest (electron/ai.nodetool.NodeTool.flatpak.yml) defines:
- Runtime: org.freedesktop.Platform 24.08
- SDK: org.freedesktop.Sdk 24.08
- Base: org.electronjs.Electron2.BaseApp 24.08
- Architecture: x86_64 (aarch64 support planned)
The manifest explicitly declares minimum required permissions:
--share=ipc- Inter-process communication--socket=x11- X11 display server--socket=wayland- Wayland display server--device=dri- GPU acceleration for AI workloads
--socket=pulseaudio- Audio input/output--device=all- Camera and microphone access for multimedia features
--share=network- API calls, model downloads, backend communication--filesystem=home- User projects, workflows, and configuration files
--talk-name=org.freedesktop.Notifications- Desktop notifications--talk-name=org.kde.StatusNotifierWatcher- System tray (KDE)--talk-name=com.canonical.AppMenu.Registrar- Menu bar (Ubuntu)--talk-name=org.freedesktop.portal.Desktop- Desktop portals
The manifest builds NodeTool from source:
- Checks out the repository
- Installs workspace dependencies from the monorepo root (
npm ci) - Builds the backend packages (
npm run build:packages) - Builds the web frontend (
npm run build --workspace=web) - Builds the Electron main/preload bundles (
npm run vite:build --workspace=electron) - Packages everything into
/app/nodetool - Installs the launcher script, desktop entry, AppStream metadata, and icons
electron/ai.nodetool.NodeTool.flatpak.yml: Main Flatpak manifestelectron/flatpak-wrapper.sh: Launcher scriptelectron/resources/ai.nodetool.NodeTool.desktop: Desktop entryelectron/resources/ai.nodetool.NodeTool.metainfo.xml: AppStream metadata
# Run the application
flatpak run ai.nodetool.NodeTool
# Run with verbose logging
flatpak run --verbose ai.nodetool.NodeTool
# Check logs
journalctl --user -xe | grep nodetoolThe current setup is build-only. To publish to Flathub in the future:
-
Create Flathub repository
- Fork the Flathub repository
- Create a new repository for
ai.nodetool.NodeTool
-
Submit manifest
- Copy
electron/ai.nodetool.NodeTool.flatpak.ymlto the Flathub repo - Update sources to point to release tarballs
- Add GPG signing configuration
- Copy
-
Follow submission guidelines
- Review Flathub submission guidelines
- Submit pull request to Flathub
- Address review feedback
-
Set up signing
- Generate GPG key for signing
- Add signing configuration to CI workflow
- Store GPG key in GitHub Secrets
Problem: Flatpak build fails with permission errors
# Solution: Run in privileged container or with sudo
sudo flatpak-builder --user ...Problem: Missing dependencies
# Solution: Install all required runtimes
flatpak install --user -y flathub org.freedesktop.Platform//24.08
flatpak install --user -y flathub org.freedesktop.Sdk//24.08
flatpak install --user -y flathub org.electronjs.Electron2.BaseApp//24.08Problem: Build fails on manifest validation
# Solution: Validate manifest syntax
flatpak-builder --show-manifest electron/ai.nodetool.NodeTool.flatpak.ymlProblem: Application doesn't start
# Check if runtime is installed
flatpak list --runtime
# Reinstall if needed
flatpak install --user -y flathub org.freedesktop.Platform//24.08
# Run with verbose logging
flatpak run --verbose ai.nodetool.NodeToolProblem: Permission denied errors
# Check current permissions
flatpak info --show-permissions ai.nodetool.NodeTool
# Override permissions if needed (not recommended)
flatpak override --user --filesystem=home ai.nodetool.NodeToolProblem: CI workflow fails
- Check the Actions tab for logs
- Workflow failures do NOT block releases or other builds
- Review build logs for specific errors
Problem: Artifacts not found
- Ensure workflow completed successfully
- Check retention period (default: 30 days)
- Look for artifacts in the workflow run page
# Make changes to the manifest
vim electron/ai.nodetool.NodeTool.flatpak.yml
# Test build locally
flatpak-builder --force-clean build-dir electron/ai.nodetool.NodeTool.flatpak.yml
# Install and test
flatpak-builder --user --install --force-clean build-dir electron/ai.nodetool.NodeTool.flatpak.yml
flatpak run ai.nodetool.NodeTool# Validate syntax
flatpak-builder --show-manifest electron/ai.nodetool.NodeTool.flatpak.yml
# Check for common issues
flatpak run --command=sh org.freedesktop.Sdk//24.08- Non-blocking: Flatpak builds can fail without affecting releases
- Faster releases: No need to wait for Flatpak build
- Independent testing: Flatpak builds can be tested separately
- Easier maintenance: Changes to Flatpak don't affect other platforms
- Flexible cadence: Flatpak can be built on every commit to main
- Multi-architecture: Add aarch64 support
- Flathub publishing: Automate submission to Flathub
- Repository signing: Add GPG signing for security
- Auto-updates: Integrate with Flatpak update mechanism
- Beta channel: Separate stable/beta builds