> ## Documentation Index
> Fetch the complete documentation index at: https://desktopcommander.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Bash Script Installation (macOS)

> One-command installation for macOS users with automatic setup

# Bash Script Installation (macOS)

For macOS users, we provide a convenient bash script that handles the entire installation process automatically, including Node.js installation if needed.

## One-Command Installation

The easiest way to install Desktop Commander on macOS:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
```

> [!WARNING]
>
> Only run scripts from trusted sources. You can review the installation script at the GitHub repository before running it.

## What the Script Does

The bash installer automatically handles:

> **Prerequisites Check**
>
> Verifies system requirements and installs missing components

> **Node.js Installation**
>
> Installs Node.js using Homebrew if not already present

> **Desktop Commander Setup**
>
> Downloads and configures Desktop Commander with optimal settings

> **Claude Integration**
>
> Automatically updates your Claude Desktop configuration

## Prerequisites

The script will check for and install if needed:

* **Claude Desktop** (you should install this manually first)
* **Claude Pro or Max subscription** (required for Desktop Commander)
* **Homebrew** (installed automatically if missing)
* **Node.js** (installed via Homebrew if missing)

## Installation Process

**1. Open Terminal**

Press `Cmd + Space`, type "Terminal", and press Enter

**2. Run Installation Command**

Copy and paste the installation command:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
```

**3. Follow Interactive Prompts**

The script will guide you through:

* System requirements check
* Component installation confirmations
* Security settings selection
* Configuration verification

**4. Restart Claude Desktop**

Close Claude Desktop completely and reopen it

## Script Output Example

Here's what you'll see during installation:

```bash theme={null}
🍎 Desktop Commander macOS Installer
=====================================

🔍 Checking system requirements...
✓ macOS detected (version 14.0)
✓ Claude Desktop found
⚠ Node.js not found - will install via Homebrew

🍺 Installing Homebrew (this may take a few minutes)...
✓ Homebrew installed successfully

📦 Installing Node.js...
✓ Node.js v20.10.0 installed

🚀 Installing Desktop Commander...
✓ Downloaded Desktop Commander MCP
✓ Updated Claude Desktop configuration
✓ Security settings configured

🎉 Installation completed successfully!

Next steps:
1. Restart Claude Desktop
2. Test with: "Can you list files in my Documents folder?"

Configuration saved to: ~/Library/Application Support/Claude/claude_desktop_config.json
```

## What Gets Installed

The bash script installs and configures:

### System Components

* **Homebrew** (if not already installed)
* **Node.js** (via Homebrew if not present)
* **Desktop Commander** (latest stable version)

### Configuration Files

* **Claude Desktop config** updated with Desktop Commander settings
* **Security defaults** configured for safe usage
* **Auto-update** enabled for future versions

### Default Security Settings

* **Directory access**: Limited to home directory and common work folders
* **Command blocking**: Dangerous system commands blocked by default
* **Process isolation**: Each terminal session runs separately

## Customizing the Installation

### Security Levels

The script offers different security configurations:

```bash theme={null}
🔒 Choose security level:
1. Strict (home directory only) - Recommended for beginners
2. Moderate (common work directories) - Good for most users  
3. Relaxed (full system access) - Advanced users only

Select option (1-3): 1
```

### Installation Location

Default locations work for most users, but you can customize:

```bash theme={null}
📁 Configuration locations:
Claude config: ~/Library/Application Support/Claude/claude_desktop_config.json
Desktop Commander: Managed by npm

Use default locations? (Y/n): Y
```

## Intel vs Apple Silicon Macs

The script works on both architectures:

**Apple Silicon (M1/M2/M3)**

**Homebrew Location**: `/opt/homebrew`

**Node.js**: Native ARM64 binaries for optimal performance

**Compatibility**: Full native support, no Rosetta required

**Performance**: Excellent performance with native ARM64 compilation

**Intel Macs**

**Homebrew Location**: `/usr/local`

**Node.js**: x86\_64 binaries with full compatibility

**Compatibility**: Complete support for all features

**Performance**: Good performance with mature x86\_64 optimization

## Manual Review of Script (Recommended)

Before running the script, you can review it:

```bash theme={null}
# Download and review the script first
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh > install.sh

# Review the contents
cat install.sh

# Run after review
chmod +x install.sh
./install.sh
```

## Script Safety Features

The installation script includes several safety measures:

### Permission Checks

* Never requests or uses `sudo` unnecessarily
* Validates file permissions before making changes
* Creates backups of existing configurations
* Provides rollback options if installation fails

### Error Handling

* Comprehensive error checking at each step
* Automatic cleanup on installation failure
* Clear error messages with suggested solutions
* Graceful handling of network interruptions

### System Integrity

* No modification of system files
* User-space installation only
* Preserves existing configurations when possible
* Easy uninstallation process

## Troubleshooting Bash Installation

> **Homebrew installation fails**
>
> This can happen on systems with restrictions:
>
> 1. Check your internet connection
> 2. Ensure you have admin privileges (for Homebrew)
> 3. Try installing Homebrew manually first
> 4. Check for corporate firewall restrictions

> **Node.js installation fails**
>
> If Node.js installation via Homebrew fails:
>
> 1. Update Homebrew: `brew update`
> 2. Try manual Node.js installation from [nodejs.org](https://nodejs.org)
> 3. Check available disk space
> 4. Restart terminal after installation

> **Claude configuration not found**
>
> The script expects Claude Desktop to be installed:
>
> 1. Install Claude Desktop from [claude.ai/download](https://claude.ai/download)
> 2. Run Claude Desktop at least once to create config
> 3. Verify config location: `~/Library/Application Support/Claude/`
> 4. Check for non-standard Claude installation paths

> **Permission denied errors**
>
> Usually related to file permissions:
>
> 1. Ensure you own your home directory files
> 2. Don't run the script with `sudo`
> 3. Check Claude Desktop app permissions
> 4. Verify disk permissions with Disk Utility

## Post-Installation Verification

After running the bash installer:

**1. Verify Node.js**

```bash theme={null}
node --version
npm --version
```

Should show version numbers for both

**2. Check Claude Configuration**

```bash theme={null}
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json
```

Should contain Desktop Commander configuration

**3. Test Desktop Commander**

Open Claude Desktop and try:

```
Can you show me what's in my Documents folder?
```

## Updating via Bash Script

The bash script can also be used for updates:

```bash theme={null}
# Run with update flag
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash -s -- --update
```

This will:

* Update Desktop Commander to the latest version
* Preserve your existing configuration
* Update system dependencies if needed
* Verify the update was successful

## Comparison with Other Methods

| Feature | Bash Script | Smithery | NPX |
| - | - | - | - |
| **macOS Optimization** | Excellent | Good | Good |
| **Homebrew Integration** | Yes | No | No |
| **Node.js Auto-Install** | Yes | No | No |
| **One Command Setup** | Yes | Yes | No |
| **System Integration** | Excellent | Good | Basic |

## Next Steps

> **[Quick Start](https://desktopcommander.mintlify.site/quickstart.md)**
>
> Learn how to use Desktop Commander with practical examples

> **[Security Settings](https://desktopcommander.mintlify.site/tools/system/get-config.md)**
>
> Review and customize your security configuration

> **[macOS Tips](https://desktopcommander.mintlify.site/use-cases/overview.md)**
>
> Discover macOS-specific use cases and workflows

> **[Community](https://desktopcommander.mintlify.site/support/discord.md)**
>
> Join other macOS users in our Discord community


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.