Anthropic(アンソロピック)社が開発した対話型生成AI Claude(クロード)
の公式デスクトップアプリ Claude Desktop を Linux GUI 上で使いたいなと思って、公式サイトを見ると Windows と macOS はあるけど Linux がない...
How to install the Claude app on desktop
Step 2: Tap "Download" for Windows or MacOS, depending on your device.
概要
Linux 用の変換ツール claude-desktop-debian
が有志により公開されていたので拝借しました。
for Debian-based Linux distributions
と記載ある通り、ビルド作業自体は Debian 系である必要がありますが、変換形式は .deb と AppImage を選べるので(AppImage を出力すれば)Debian 系以外でも動作させることが可能です。
※リポジトリに案内がありますが、Arch 系のツールも存在します。
GitHub - aaddrick/claude-desktop-debian: Claude Desktop for Debian-based Linux distributions
THIS IS AN UNOFFICIAL BUILD SCRIPT FOR DEBIAN/UBUNTU BASED SYSTEMS (produces .deb or .AppImage)!
これは、DEBIAN/UBUNTU ベースのシステム用の非公式ビルド スクリプトです (.deb または .AppImage を生成します)。
変換
AppImage 作成
AppImage を作成します。
(README.md には リポジトリクローンの手順が記載されてますが、wget しています)。
# download this repository
$ wget https://github.com/aaddrick/claude-desktop-debian/archive/refs/heads/main.zip
$ unzip main.zip
$ cd claude-desktop-debian-main/
# build
$ ./build.sh --build appimage
# info.
$ ls -lh ./claude-desktop-0.9.2-amd64.AppImage
\-rwxr-xr-x 1 xxx xxx 113M 4月 13 18:51 ./claude-desktop-0.9.2-amd64.AppImage
$ file ./claude-desktop-0.9.2-amd64.AppImage
./claude-desktop-0.9.2-amd64.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=xxx, for GNU/Linux 2.6.32, stripped
node / npm バージョンアップ
ちなみに、初回 build の際は、npm バージョンが低いためエラーになりました。
作業に使ったマシンの OS が Ubuntu 22.04.5 LTS
と古かったため、npm のバージョンアップしたら成功しました。
$ sudo apt update -y && sudo apt upgrade -y
# LTS npm remove
$ sudo apt purge -y nodejs npm
$ sudo apt autoremove -y
# LTS latest install
$ sudo apt install npm
$ sudo npm install n -g
added 1 package in 783ms
$ sudo n stable
installing : node-v22.14.0
mkdir : /usr/local/n/versions/node/22.14.0
fetch : https://nodejs.org/dist/v22.14.0/node-v22.14.0-linux-x64.tar.xz
copying : node/22.14.0
installed : v22.14.0 (with npm 10.9.2)
Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
If "node --version" shows the old version then start a new shell, or reset the location hash with:
hash -r (for bash, zsh, ash, dash, and ksh)
rehash (for csh and tcsh)
$ sudo node -v
v22.14.0
$ sudo npm -v
10.9.2
使い方
作成された AppImage ファイル claude-desktop-0.9.2-amd64.AppImage
を適当な場所において実行権限を付与すれば、ダブルクリックで起動できます。
初回は、アカウント登録が必要になります。
登録したメールアドレスに届いた確認コードを Debian 12 の Thunderbird では開くことができなかったのですが、Android スマホで開いて取得した確認コードを Claude Desktop に入力して認証できました。
設定
claude_desktop_config
Claude Desktop の設定ファイル claude_desktop_config.json
はホームディレクトリに配置できます。
aaddrick/claude-desktop-debian: Claude Desktop for Debian-based Linux distributions
Location of the MCP-configuration file is:~/.config/Claude/claude_desktop_config.json