How to Install Claude Desktop with MCP Desktop Commander on Ubuntu/Debian Linux

If you’re a Linux user who wants to run Claude Desktop with powerful Model Context Protocol (MCP) (https://modelcontextprotocol.io/) tools, this guide will walk you through the entire process. We’ll install Claude Desktop and set up the Desktop Commander MCP server, which allows Claude to interact with your desktop environment.

This Linux-beginner-friendly guide is based on my experience installing it this week on Pop!_OS on an Asus Nvidia machine, and was of course created with help from Claude.

If you haven’t seen it in action, DesktopCommander MCP is a thing of beauty:

⚠️ Important Warnings and Prerequisites

Before you begin:

  • Backup any important data – always a good idea
  • System requirements: Ubuntu 20.04+ or Debian 11+/Debian-based distro (I’m running on Pop!_OS 22.04 LTS with Nvidia); Anthropic doesn’t publish RAM, disk space, or CPU requirements, but third-party online posts recommend 8GB ~ 32GB RAM
  • Terminal comfort: This guide involves using the terminal (https://ubuntu.com/tutorials/command-line-for-beginners), but all commands are provided step-by-step

What You’ll Install

  • Claude Desktop: The desktop application for Claude AI
  • Node.js via NVM: JavaScript runtime needed for MCP servers
  • Desktop Commander MCP: Allows Claude to interact with your desktop (take screenshots, run commands, etc.)

Step 1: Update Your System

First, let’s make sure your system packages are up to date.

  1. Open your terminal (https://help.ubuntu.com/community/UsingTheTerminal) by pressing Ctrl+Alt+T

  2. Update your package lists and upgrade existing packages:

sudo apt update && sudo apt upgrade -y

What this does: sudo (https://www.sudo.ws/about/) gives you administrator privileges, apt (https://ubuntu.com/server/docs/package-management) is Ubuntu/Debian’s package manager, and this ensures your system has the latest security updates.


Step 2: Install Essential Dependencies

Install tools we’ll need for the installation process:

sudo apt install -y curl wget gnupg2 software-properties-common

What these tools do:

  • curl (https://curl.se/): Downloads files from the internet
  • wget (https://www.gnu.org/software/wget/): Alternative download tool
  • gnupg2 (https://gnupg.org/): Handles cryptographic signatures for security
  • software-properties-common: Manages software repositories

Step 3: Install Node.js Using NVM

We need Node.js (https://nodejs.org/) to run MCP servers. We’ll use NVM (Node Version Manager) (https://github.com/nvm-sh/nvm) which makes managing Node.js versions easier.

  1. Download and install NVM if you don’t already have it installed:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
  1. Restart your terminal or reload your shell configuration:
source ~/.bashrc
  1. Verify NVM was installed:
nvm --version
  1. Install the latest LTS (https://nodejs.org/en/about/previous-releases) version of Node.js:
nvm install --lts
nvm use --lts
  1. Verify Node.js and npm (https://www.npmjs.com/) are working:
node --version
npm --version

You should see version numbers after both commands.


Step 4: Download and Install Claude Desktop

Note: We’re using a community-maintained package since Anthropic (https://docs.anthropic.com/en/docs/claude-code/getting-started) doesn’t officially support Linux yet.

  1. Visit the Claude Desktop for Debian GitHub repository (https://github.com/aaddrick/claude-desktop-debian) in your web browser. (Unfortunately this package is deprecated, BUT there are a couple of active forks, so if you’re reading this in later months and the package is broken, check the active forks.)

  2. Go to the “Releases” section and download the latest .deb file (https://en.wikipedia.org/wiki/Deb_(file_format))

  3. Navigate to your Downloads folder in the terminal:

cd ~/Downloads
  1. Install the downloaded package (replace filename.deb with the actual filename):
sudo dpkg -i claude-desktop_*.deb
  1. If you encounter dependency issues, fix them with:
sudo apt install -f

What this does: dpkg (https://wiki.debian.org/dpkg) is the low-level package installer for Debian/Ubuntu systems. The -f flag fixes broken dependencies.


Step 5: Create Claude Desktop Configuration Directory

Claude Desktop needs a configuration file to know about MCP servers.

  1. Create the configuration directory:
mkdir -p ~/.config/Claude

What this does: mkdir -p (https://www.gnu.org/software/coreutils/manual/html_node/mkdir-invocation.html) creates directories and any necessary parent directories. The ~ symbol represents your home directory (https://tldp.org/LDP/abs/html/special-chars.html).


Step 6: Test Desktop Commander MCP Server

Before configuring Claude Desktop, let’s make sure the Desktop Commander MCP server works.

  1. Test the MCP server directly:
npx @wonderwhy-er/desktop-commander@latest

You should see output like:

Loading schemas.ts
Loading server.ts
Setting up request handlers...
[desktop-commander] Initialized FilteredStdioServerTransport
  1. Press Ctrl+C to stop the test server.

What this does: npx (https://docs.npmjs.com/cli/v7/commands/npx) runs Node.js packages without permanently installing them. This tests that the MCP server can start properly.


Step 7: Configure Claude Desktop for MCP

Now we’ll create the configuration file that tells Claude Desktop about our MCP server.

  1. Create the configuration file:
nano ~/.config/Claude/claude_desktop_config.json

What this does: opens nano (https://www.nano-editor.org/) a text editor for the terminal.

  1. Copy and paste this configuration into the file:
{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": [
        "@wonderwhy-er/desktop-commander@latest"
      ]
    }
  }
}
  1. Save and exit nano:
    • Press Ctrl+X
    • Press Y to confirm saving
    • Press Enter to confirm the filename

Step 8: Launch Claude Desktop

  1. Start Claude Desktop from the graphical applications menu, or run from terminal:
claude-desktop
  1. Sign in with your Anthropic account when prompted

  2. Look for MCP indicators in the interface – you should see evidence that the Desktop Commander server is connected


Step 9: Test Your MCP Setup

  1. In Claude Desktop, try asking Claude to take a screenshot:

    “Can you take a screenshot of my current desktop?”

  2. Or ask Claude to check system information:

    “What’s my current working directory and what files are in my home folder?”

If Claude can respond to these requests with actual information about your system, congratulations! Your MCP setup is working.


Troubleshooting Common Issues

Issue: “Cannot find module” errors

Solution: This usually means there’s a problem with literal command substitution in your config file:

  1. Check your config file for any "$(which npx)" strings:
cat ~/.config/Claude/claude_desktop_config.json
  1. If you see "$(which npx)" anywhere, replace it with just "npx" – the simple form works when Node.js is properly installed via NVM

Issue: Claude Desktop won’t start

Solution: Check if all dependencies are installed:

sudo apt install -f
sudo apt update

Issue: MCP server not connecting

Solution: First, verify that Desktop Commander itself is working:

  1. Test the MCP server directly to confirm it’s functioning:
npx @wonderwhy-er/desktop-commander@latest

You should see output like:

Loading schemas.ts
Loading server.ts
Setting up request handlers...
[desktop-commander] Initialized FilteredStdioServerTransport
Loading configuration...
Configuration loaded successfully
Connecting server...
Server connected successfully
  1. If that works (press Ctrl+C to stop it), then the issue is with Claude Desktop’s configuration, not the MCP server itself

  2. Check Claude Desktop logs for connection errors – these are usually in the application’s output when started from terminal


Security Considerations

Important: The Desktop Commander MCP gives Claude significant access to your system, including:

  • Taking screenshots
  • Running terminal commands
  • Accessing files

Best practices:

  • Only use this setup on personal machines, not shared computers
  • Review what you’re asking Claude to do before confirming actions
  • Consider creating a separate user account for testing MCP functionality
  • Keep your system updated with security patches

Keeping Everything Updated

Update Node.js

nvm install --lts
nvm use --lts

Update MCP packages

The @latest tag in our configuration automatically uses the newest version, but you can manually update:

npm update -g @wonderwhy-er/desktop-commander

Update Claude Desktop

Check the project forks on GitHub periodically for new .deb package releases and install them using the same dpkg process.


Uninstalling (If Needed)

Remove Claude Desktop

sudo apt remove claude-desktop

Remove Node.js and NVM

nvm uninstall node
rm -rf ~/.nvm

Remove the NVM lines from your ~/.bashrc file using a text editor.

Remove configuration files

rm -rf ~/.config/Claude

Next Steps

Now that you have Claude Desktop with MCP working, you can:

  1. Explore other MCP servers: Check the MCP ecosystem (https://github.com/modelcontextprotocol) for additional tools
  2. Customize your setup: Add more MCP servers to your configuration
  3. Learn more about MCP: Read the official MCP documentation (https://modelcontextprotocol.io/docs)

Remember to always be cautious when giving AI systems access to your computer, and enjoy exploring the powerful combination of Claude AI with your Linux desktop.


Credits and Resources

  • Claude Desktop for Debian: Community package by aaddrick, deprecated recently but forked (https://github.com/aaddrick/claude-desktop-debian)
  • Desktop Commander MCP: Created by @wonderwhy-er (https://github.com/wonderwhy-er/desktop-commander) – Thanks, Dmitry, for your help on Discord confirming that it was indeed the config file
  • Model Context Protocol: Developed by Anthropic (https://modelcontextprotocol.io/)

This guide was created based on real troubleshooting experience and community feedback. If you encounter issues, check the GitHub repositories for these projects or ask for help in Discord/Linux communities.

Installing Linux on Asus ROG Strix, part 2

Well, I got the main partition resized thanks to this blog post. It was turning off things like hibernation and system restore. Then I shrank the Windows partition down to about 98 GB. Take that, Windows!

Still can’t get rid of the obnoxious logo

After a reboot, it was pretty smooth sailing. After installing the proprietary NVIDIA drivers and restarting with a special pin entered from the boot partition, I restarted again. However, I got the error “Nvidia kernel module missing, falling back to nouveau” no matter what I tried.

So I started thinking I would need to install Arch Linux, as it seems to support NVIDIA drivers well. But another contender emerged: Pop!_OS. Yes, of system76 fame. I had heard of it many times but never tried it.

I made another live USB stick and split the Fedora partition in half, installing Pop!_OS (Secure Boot needs to be shut off otherwise the live USB likely won’t start).

Lo and behold, it worked out of the box. The keyboard backlighting can be controlled with the function keys just fine, although I haven’t tried changing the colors yet. Pop!_OS even wakes from suspend after lid close, something that I’ve seen fail many times on other OSes.

So Pop!_OS, you have a new fan.

Installing Linux on Asus ROG Strix G16

How to lose your hair quickly

A trip to Microcenter is a candy store-like experience with good customer service and great selection. I bought a brand-new Asus ROG Strix, despite the exquisitely obnoxious branding and lighting, for my next Linux box.

I was told that for warranty purposes, should anything occur and I need to bring the machine in for service, I’d have to re-install Windows first. So while making the backup restore media and setting up (a local account) I decided perhaps it’s best to dual boot.

The Interwebs told me to go with Fedora, and who am I to argue. So I made a boot thumb drive and took it for a spin. I used to use Balena Etcher but this time I went with Fedora’s Media Writer tool which worked well (but for Windows 10 users, autoplay might need to be switched off before writing the drive). I was impressed that there was even some limited lighting control out of the box.

But the ASUS problems started coming fast and furious. Top priority had been to flash the BIOS in order to remove the hideous “Republic of Gamers” boot loading logo, but alas, the tool for that was not available for my specific motherboard. Oh well; I shall have to just avert my eyes during the boot sequence for now.

Next up, I couldn’t access the main partition from inside the Fedora live preview; in disk management there was a little padlock icon and the word “Bitlocker.”

What in tarnation. Pretty sure I toggled that off during Windows setup, so I was a tad confused. Booting back into Windows settings, there was a button which said, “Turn on Bitlocker”. Now I was even more confused, because it sure seemed to be on already.

Apparently Bitlocker encryption is default on Windows 11. Under Windows “Privacy & security”, there is a toggle to turn off Device Encryption. Once I shut that off, it said “decrypting” for a few minutes, and then I was able to go back into Fedora live OS and access the drive.

Another hurdle: Fedora tells me “Not enough free space on selected disks.” Microsoft hogs 5 partitions full of goodness-knows what. So I toddle off into Windows Disk Management to resize the main partition. Guess what — due to unmovable files, the partition could only be shrunk to about 800GB (leaving only about 200 for Fedora).

It’s bedtime, so tomorrow I will delete some expendable-looking things, run Disk Cleanup, and defragment to see if that will help. But I’m starting to think it’s not worth all this hassle to dual boot.

To be continued…

Mozilla’s NSS package on Windows 10 (when Chocolatey fails you)

I recently needed certificate handling for some CraftCMS development. Using Chocolatey, I tried installing mkcert and nss (Network Security Services) but got the following error:

nss not installed. The package was not found with the source(s) listed.
Source(s): 'https://chocolatey.org/api/v2/'

(Yes, I have still not fully switched back to 🐧Linux yet! Getting there, but I am still using Teams breakout rooms — not available on Linux — and Outlook for my teaching gig, until that ends in a few months.)

So you want to support Firefox, even though Firefox doesn’t support you, o Windows developer?

Yes, let’s be the ‘bigger man’! LOL

Heavily adapted version of Johann ‘Myrkraverk’ Oskarsson’s handy blog post follows, with just a bit of updating for 2024.

It’s gonna require a LOT of steps, including installing Visual Studio Installer and Python, in case you don’t already have it installed — you’ll need Python to install a package called gyp-next :

python3 -m pip install gyp-next

Next you’ll need to download the NSS package manually from Mozilla:

I also used 7-zip in the terminal to extract the package (you’ll need to extract the .gz file, then extract the resulting .tar ball once more). Your filename will be different depending on the newer version you may download:

7z x nss-3.101.1-with-nspr-4.35.tar.gz
...
7z x nss-3.101.1-with-nspr-4.35.tar

Now you can go into the Visual Studio Installer graphical application. Click the Launch button:

This will launch a new type of terminal inside that app, like this:

Now you can cd into

cd C:\mozilla-build\msys2

Then enter the command:

msys2_shell

ANOTHER shell will pop open (keep the old window open) — enter your SSH password (nothing will appear at the prompt as usual) then hit Enter. It should say, “Identity added” to your local hosts.

Almost there. Now return to the terminal window which was launched by Visual Studio Installer (the one we kept open). CD into the extracted directory for NSS ( cd nss\nss-3.101.1 or whatever folder you created for it). Make sure you further cd into ‘nss’.


Lastly, run

build.sh

Now if you back out one level, you will see you have a new folder called ‘dist’. I don’t think you actually need this folder when just developing frontend applications, but let’s see! UPDATE: no, I have not needed it and it’s been 2 months. 😉