How to Build Claude Desktop Debian Packages from a Windows Installer
You can convert the official Claude Desktop Windows installer into a native .deb package by extracting the Electron app with 7-Zip, patching Windows-specific modules for Linux compatibility, and repackaging it using the build scripts in the aaddrick/claude-desktop-debian repository.
Claude Desktop is officially distributed only as a Windows .exe installer, but the open-source aaddrick/claude-desktop-debian project automates the process of repackaging it for Debian-based Linux distributions. The build pipeline downloads the Windows installer, extracts the underlying Electron application, replaces native Windows modules with Linux-compatible stubs, and generates a standard .deb package that integrates with your desktop environment.
How the Build Process Works
The conversion process follows a four-stage pipeline orchestrated by build.sh:
-
Download and extraction: The script fetches the official Windows installer (or accepts a local file) and extracts it using
7zto locate the.nupkgcontaining the Electron app andapp.asararchive. -
Patching: Windows-specific native modules—such as
node-pty, the cowork-VM service, and frame-management components—are replaced with Linux-compatible wrappers and stubs defined in thepatch_*functions withinbuild.sh. -
Staging: The patched application is assembled into a standard Linux directory layout under
/usr/lib/claude-desktop, including icons, desktop entries, and wrapper scripts. -
Packaging: The
scripts/build-deb-package.shutility creates the Debian control files, writes theDEBIAN/controlmetadata, and invokesdpkg-deb --buildto produce the final.debartifact.
Prerequisites
Before building, ensure your system has the following dependencies installed:
- Git to clone the repository
- 7-Zip (
p7zip-fullpackage) for extracting the Windows installer - Electron and Node.js tooling (handled automatically by the script)
- Standard build tools (
dpkg-debfor Debian systems)
sudo apt update
sudo apt install -y git p7zip-full dpkg-dev
Step-by-Step Build Instructions
1. Clone the Repository
git clone https://github.com/aaddrick/claude-desktop-debian.git
cd claude-desktop-debian
2. (Optional) Download the Windows Installer
If the auto-download URL in build.sh is outdated or you need a specific version, manually download the Windows installer:
wget -O Claude-Setup.exe https://claude.ai/download
3. Build the Debian Package
To build from a local installer file, specify the --exe flag and target format:
./build.sh --build deb --exe ./Claude-Setup.exe
The script performs the following actions defined in build.sh:
- Sets
local_exe_pathfrom the--exeargument - Copies the file to
work_dir/Claude-Setup.exe - Skips
download_claude_installerper the conditional logic - Proceeds through extraction (
7z x), patching, and delegates toscripts/build-deb-package.sh
4. Install the Package
Once complete, the .deb file appears in the build/ directory:
sudo apt install ./build/claude-desktop_<version>_<arch>.deb
To keep intermediate files for debugging (useful if patching fails), add the --clean no flag:
./build.sh --build deb --clean no --exe ./Claude-Setup.exe
Understanding the Patching Process
The build.sh script contains multiple patch_* functions that modify the extracted Electron application to function on Linux:
- Frame fixing: The
frame-fix-wrapper.jsand associated logic replace Windows-specific window frame management with Linux-compatible alternatives. - PTY replacement: The
node-ptymodule, which handles terminal emulation, is patched to use Linux native bindings instead of Windows conpty. - CoWork VM service: Windows-specific virtualization hooks are stubbed out or redirected to Linux equivalents.
- Protocol handling: Custom URL scheme handlers are adjusted for Linux desktop integration.
These patches are applied after the 7z extraction locates the .nupkg and app.asar files, but before scripts/build-deb-package.sh assembles the final directory structure.
Summary
Building Claude Desktop Debian packages from the Windows installer requires:
- Extracting the Windows
.exeusing7zto access the embedded.nupkgandapp.asar - Patching native Windows modules (
node-pty, frame management, VM services) using thepatch_*functions inbuild.sh - Repackaging via
scripts/build-deb-package.sh, which creates theDEBIANcontrol structure and runsdpkg-deb --build - Installing the resulting
.debfrom thebuild/directory usingapt
The ./build.sh --build deb --exe <path> command automates the entire pipeline, handling extraction, patching, and packaging in a single invocation.
Frequently Asked Questions
Can I build the Debian package without downloading the Windows installer manually?
Yes. If you omit the --exe flag, build.sh automatically downloads the latest Windows installer using the CLAUDE_DOWNLOAD_URL defined for your architecture. However, providing a local file with --exe ensures you can build when the auto-download URL is outdated or when working offline.
What architectures are supported for the Debian build?
The build.sh script supports amd64 (x86_64) and arm64 architectures. The download URL and build process automatically adjust based on the host architecture detected during execution, though you can manually specify target parameters by modifying the script variables.
Why does the build process need to patch node-pty and other native modules?
Claude Desktop is built for Windows and includes native Node.js modules like node-pty that rely on Windows-specific APIs (such as Windows ConPTY). When extracting the Windows installer, these modules must be replaced with Linux-compatible versions or stubs via the patch_* functions in build.sh to ensure the terminal integration and window management work correctly on Debian systems.
Where is the final .deb file located after the build completes?
The scripts/build-deb-package.sh script places the finished package in the build/ directory at the repository root. The filename follows the standard Debian convention: claude-desktop_<version>_<arch>.deb (for example, claude-desktop_0.7.7_amd64.deb).
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →