Claude Desktop Arch
Builds an Arch Linux package for Claude Desktop by extracting and modifying the official Windows release. I
Ask AI about Claude Desktop Arch
Powered by Claude · Grounded in docs
I know everything about Claude Desktop Arch. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Debian/Ubuntu Linux users: For the DPKG/AppImage build script and Debian-specific instructions: https://github.com/aaddrick/claude-desktop-debian
This repo isn't maintained actively. Please checkout the links below for alternatives
https://github.com/jkoelker/claude-desktop-native
THIS IS AN UNOFFICIAL PKGBUILD FOR ARCH LINUX BASED SYSTEMS!
If you run into an issue with this build script, make an issue here. Don't bug Anthropic about it - they already have enough on their plates.
Claude Desktop for Linux (Arch PKGBUILD)
This project provides an Arch Linux PKGBUILD to install the Claude Desktop application. It was inspired by k3d3's claude-desktop-linux-flake and their Reddit post about running Claude Desktop natively on Linux.
Supports MCP! Location of the MCP-configuration file is: ~/.config/Claude/claude_desktop_config.json
Supports the Ctrl+Alt+Space popup!
Supports the Tray menu! (Screenshot of running on KDE)
Building & Installation (Arch Linux)
For Arch Linux and Arch-based distributions, you can build and install using the provided PKGBUILD:
# Clone this repository
git clone https://github.com/aaddrick/claude-desktop-arch.git
cd claude-desktop-arch
# Update checksums (needed once, or after PKGBUILD/install script changes)
updpkgsums
# Build and install the package
# This command automatically handles dependencies, builds, and installs
# Use makepkg -sci to automatically clean up build files afterwards
makepkg -si
The PKGBUILD will automatically:
- Detect your architecture (x86_64 or aarch64)
- Determine the latest application version
- Download the correct official Windows installer
- Check for and prompt to install required dependencies (using
pacman) - Extract application resources
- Apply Linux compatibility patches (native module stub, Wayland flags)
- Package Electron locally within the application
- Create and install an Arch Linux package (
.pkg.tar.zst)
Uninstallation
If you installed the package using makepkg -si or pacman -U, you can uninstall it using pacman:
sudo pacman -R claude-desktop
To also remove user-specific configuration files (including MCP settings):
sudo pacman -Rns claude-desktop
# Or manually remove the config directory:
# rm -rf ~/.config/Claude
Troubleshooting
Window Scaling Issues
If your window isn't scaling correctly the first time or two you open the application, right-click on the claude-desktop panel (taskbar) icon and choose "Quit". When doing a safe shutdown like this, the application saves window state information to ~/.config/Claude/ which should resolve the issue on subsequent launches. Force quitting the application (e.g., via kill) will not trigger these state updates.
Application Fails to Launch (Sandbox Issues)
The PKGBUILD attempts to configure the Electron sandbox correctly by packaging Electron locally and setting SUID permissions on chrome-sandbox via the .install script. This should work in most cases.
However, if the application installs but fails to launch (you might see errors related to sandboxing or zygote processes in the terminal when running claude-desktop), you could try launching it with the --no-sandbox flag as a last resort:
claude-desktop --no-sandbox
If this works, you could make it permanent by editing the launcher script /usr/bin/claude-desktop, but this is strongly discouraged as it reduces security isolation. It's better to investigate why the sandbox isn't working (e.g., kernel settings like kernel.unprivileged_userns_clone, filesystem mount options like nosuid on /usr/lib).
Editing the launcher (Use with caution):
- Open the launcher script with root privileges:
sudo nano /usr/bin/claude-desktop - Locate the line near the end that executes Electron. It will look like this:
"$ELECTRON_EXEC" "${ELECTRON_ARGS[@]}" - Modify that line by adding
--no-sandboximmediately after"$ELECTRON_EXEC":# Before: # "$ELECTRON_EXEC" "${ELECTRON_ARGS[@]}" # After: "$ELECTRON_EXEC" --no-sandbox "${ELECTRON_ARGS[@]}" - Save the file (Ctrl+O in nano, then Enter) and exit (Ctrl+X in nano).
How it works (Arch PKGBUILD)
Claude Desktop is an Electron application packaged as a Windows executable. The PKGBUILD performs several key operations to make it work natively on Arch Linux:
- Source Fetching: Downloads the official Windows installer (
.exe) appropriate for the target architecture ($CARCH). - Version Detection: The
pkgver()function extracts the version number from the downloaded installer's contents (specifically, the embedded.nupkgfilename). - Build Process (
build()):- Installs
electronandasarlocally usingnpmto ensure correct versions for packaging. - Extracts the Windows installer (
.exe) usingp7zip. - Extracts the application files from the embedded NuGet package (
.nupkg). - Extracts icons using
wrestoolandicotool. - Unpacks the
app.asararchive using the localasartool. - Replaces the Windows-specific native module (
claude-native) with a Linux-compatible JavaScript stub (in bothapp.asar.contentsandapp.asar.unpacked). This stub provides dummy functions for Windows APIs while keeping necessary parts likeKeyboardKey. - Downloads and applies assets for the main window title bar fix from emsi/claude-desktop.
- Repacks the modified
app.asar.
- Installs
- Packaging (
package()):- Installs the application files (
app.asar,app.asar.unpacked) into/usr/lib/claude-desktop/. - Installs the locally built
node_modules(containing Electron) into/usr/lib/claude-desktop/. - Installs icons into
/usr/share/icons/hicolor/. - Creates a
.desktopfile in/usr/share/applications/for menu integration. - Creates a launcher script
/usr/bin/claude-desktopthat:- Uses the packaged Electron executable.
- Detects Wayland sessions and adds necessary flags (
--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland). - Changes to the application directory before launching.
- Installs the application files (
- Post-Install (
claude-desktop.install):- Sets SUID permissions (
chown root:root,chmod 4755) on the packagedchrome-sandboxexecutable (/usr/lib/claude-desktop/node_modules/electron/dist/chrome-sandbox) to allow the sandbox to function correctly. - Updates the desktop file database (
update-desktop-database).
- Sets SUID permissions (
This process works because the core Claude Desktop application is largely cross-platform (being Electron-based). The main challenge is handling the Windows-specific native module and ensuring the Electron environment (including the sandbox) is set up correctly on Linux.
References & Alternatives
- NixOS: For NixOS users, please refer to k3d3's claude-desktop-linux-flake repository.
- Debian/Ubuntu/AppImage: For a build script targeting
.debor.AppImageformats, see aaddrick/claude-desktop-debian. - Emsi's Fork: emsi/claude-desktop contains related work and the title bar fix used here.
License
The PKGBUILD and .install script in this repository are provided under the Unlicense. See the LICENSE file.
The Claude Desktop application itself, downloaded by the PKGBUILD, is proprietary software developed by Anthropic and is subject to their terms of service. This project only provides a way to package and run it on Arch Linux.
