Linux

Build native Linux desktop applications with Bini.js.

Linux Overview

Bini.js allows you to build native Linux desktop applications using Tauri. Your React app is wrapped in a WebKitGTK binary, providing a native experience with full system access.

Native Binary

Linux executable (AppImage) with GPG signing

Code Signing

GPG signing support for trusted distribution

Native APIs

Full access to Linux APIs via Tauri

Linux desktop apps are built using Tauri's WebKitGTK backend. Your app runs in a native window with full system access.

Requirements

Before building Linux apps, make sure you have the following installed:

  • Node.js 20.19.0 or higher
  • WebKitGTK development libraries — Install via your package manager
  • GTK 3 development libraries — Required for building

Install WebKitGTK

# Debian/Ubuntu
sudo apt install -y libwebkit2gtk-4.0-dev build-essential libssl-dev libgtk-3-dev

# Fedora
sudo dnf install webkit2gtk4.0-devel openssl-devel gtk3-devel

# Arch
sudo pacman -S webkit2gtk base-devel openssl gtk3
The WebKitGTK libraries are required to compile the Tauri backend. Install them using your distribution's package manager.

Native Linux

Build natively on Linux using the CLI. The development and build commands run directly on your Linux machine.

# Create a Linux project
npx create-bini-app@latest my-app --platform linux

# Navigate to project
cd my-app

# Install dependencies
npm install

# Run in development mode
npm run tauri:dev

# Build the Linux AppImage
npm run tauri:build

The build output is a native Linux executable (.AppImage) ready for distribution.

Tip: Use --sign during scaffold to set up GPG signing.

Windows

Build Linux apps from Windows using GitHub Actions. This is the recommended approach for cross-platform builds.

GitHubGitHub Actions Workflow
.github/workflows/build-linux.yml
# .github/workflows/build-linux.yml
name: Build Linux App

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build-linux:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20'
          
      - name: Install dependencies
        run: npm install
        
      - name: Build Linux app
        run: npm run tauri:build
        
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        with:
          name: linux-build
          path: src-tauri/target/release/bundle/appimage/*.AppImage

Why GitHub Actions? Tauri recommends GitHub Actions for cross-platform builds because:

  • No local toolchain setup required
  • Consistent build environment
  • Automatic artifact generation
  • Works from any operating system
GitHub Actions runs on Ubuntu runners to build native Linux applications. This works from any OS.

macOS

Build Linux apps from macOS using GitHub Actions. This is the recommended approach and is used by Tauri for cross-platform builds.

GitHubGitHub Actions Workflow
.github/workflows/build-linux.yml
# .github/workflows/build-linux.yml
name: Build Linux App

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build-linux:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20'
          
      - name: Install dependencies
        run: npm install
        
      - name: Build Linux app
        run: npm run tauri:build
        
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        with:
          name: linux-build
          path: src-tauri/target/release/bundle/appimage/*.AppImage

Why GitHub Actions? Tauri recommends GitHub Actions for cross-platform builds because:

  • No local toolchain setup required
  • Consistent build environment
  • Automatic artifact generation
  • Works from any operating system
GitHub Actions with ubuntu-latest runners is the official Tauri-recommended approach for building Linux apps from macOS.

Creating a Linux App

Create a new Bini.js project targeting Linux:

npx create-bini-app@latest my-app --platform linux

Or use the interactive prompt and select linux:

Prompt: Which platform would you like to target?

web / windows / macos / linux / android / ios

Select linux and press Enter

npx create-bini-app@latest

Development

Run your Linux app in development mode:

npm run tauri:dev

This launches your app in a native Linux window with:

  • Hot reload for frontend changes
  • Native window with system tray support
  • Access to Linux APIs
  • Devtools for debugging

Building

Build a distributable Linux application:

npm run tauri:build

This creates a signed Linux AppImage in the src-tauri/target/release/bundle/appimage/ directory.

Output Files

  • my-app.AppImage — The main executable
  • my-app.deb — Debian package (if configured)
  • my-app.rpm — RPM package (if configured)
The build output is a native Linux binary that runs without any additional dependencies.

Code Signing

Bini.js supports GPG signing for Linux binaries. Configure signing in src-tauri/tauri.conf.json:

src-tauri/tauri.conf.json
{
  "tauri": {
    "bundle": {
      "linux": {
        "signing": {
          "gpg": {
            "key": "your-gpg-key-id",
            "password": "your-gpg-password"
          }
        }
      }
    }
  }
}

For GitHub Actions, you can use secrets for secure credential storage:

# In GitHub Actions workflow
- name: Build Linux app
  env:
    GPG_KEY: ${{ secrets.GPG_KEY }}
    GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
  run: npm run tauri:build
For production distribution, GPG signing is recommended to establish trust with Linux users.