Skip to main content
This guide walks you through building Tabby AI Keyboard locally for production deployment.

Prerequisites

Before building, ensure you have:
  • Node.js 20 or higher
  • pnpm package manager (version 9)
  • All required environment variables configured in .env.local

Build Scripts Overview

The build process uses several npm scripts defined in frontend/package.json:12-19:

Building for Windows

1

Navigate to frontend directory

Open your terminal and change to the frontend directory:
2

Install dependencies

Install all required dependencies using pnpm:
3

Run the build command

Execute the dist command to create the production executable:
Or using npm:
This command:
  • Builds the Next.js application with Turbopack
  • Compiles the Electron main process using tsup
  • Packages everything into a Windows installer using electron-builder
4

Locate the executable

The resulting .exe installer will be created in:
The installer uses NSIS (Nullsoft Scriptable Install System) with the following configuration:
  • Allows user to choose installation directory
  • Creates desktop and start menu shortcuts
  • Supports per-machine installation

Building for Linux

1

Navigate to frontend directory

2

Run the Linux build command

To create a Debian package (.deb):
This creates a .deb package in the frontend/dist/ directory.
The Linux build is configured in package.json:197-203 to target the Development category and includes proper icon configuration.

Build Configuration

The electron-builder configuration in package.json includes:

Application Settings

  • Product Name: Tabby
  • App ID: com.tabby.ai-keyboard
  • ASAR Packaging: Enabled for code protection

Included Files

The build packages:
  • Electron build artifacts (build/)
  • Next.js standalone output (.next/standalone)
  • Static assets (.next/static)
  • Public files (public/)
  • Required native modules (*.node, *.dll)

Windows NSIS Installer

Make sure all environment variables from .env.local are properly set before building, especially:
  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • NEXT_PUBLIC_API_URL
  • NEXT_PUBLIC_MEMORY_API_URL

Troubleshooting

Build Fails on Windows

If the build fails, ensure:
  • You have the latest Windows Build Tools installed
  • Visual Studio C++ build tools are available
  • All dependencies installed successfully with pnpm install

Missing Dependencies

The postinstall script automatically runs electron-builder install-app-deps. If you encounter native module issues, try:

TypeScript Errors

Run type checking before building:
This runs tsc --noEmit to check for TypeScript errors without generating output files.