Skip to content

Instantly share code, notes, and snippets.

@hosni
Last active June 2, 2025 08:57
Show Gist options
  • Save hosni/1b9475ddc9c4ebdb90c98269ecf86ffd to your computer and use it in GitHub Desktop.
Save hosni/1b9475ddc9c4ebdb90c98269ecf86ffd to your computer and use it in GitHub Desktop.
Install Cursor AI editor on Ubuntu with Desktop Icon, This will adds desktop shortcut and icon of Cursor IDE

🖥️ How to Install Cursor IDE via Script

You can install Cursor IDE easily by downloading and running the installation script provided in this Gist:

📦 Step-by-Step Instructions

  1. Open a terminal.

  2. Download the installation script:

curl -L https://gist.githubusercontent.com/hosni/1b9475ddc9c4ebdb90c98269ecf86ffd/raw/install-cursor.sh -o install-cursor.sh
  1. Make the script executable:
chmod +x install-cursor.sh
  1. Run the script with root privileges:
sudo ./install-cursor.sh

💡 This script will:

  • Download the latest Cursor IDE AppImage
  • Move it to /opt/cursor/
  • Set up a desktop entry and icon so you can launch Cursor from your app menu

📄 Manual Installation Guide

🖥️ How to Install Cursor IDE on Linux (Manual Guide)

Follow these steps to manually install Cursor IDE on a Linux system.

1. Fetch the Download URL

Use curl and jq to get the download URL for the AppImage:

curl -s "https://www.cursor.com/api/download?platform=linux-x64&releaseTrack=stable" | jq -r .downloadUrl

2. Create Installation Directory

Create a directory for Cursor:

sudo mkdir -p /opt/cursor

3. Download Cursor AppImage

Use the URL from Step 1 to download the AppImage to /opt/cursor:

curl -L "YOUR_DOWNLOADED_URL_HERE" -o /opt/cursor/cursor.AppImage

4. Make it Executable

sudo chmod +x /opt/cursor/cursor.AppImage

5. Add to Applications Menu

Download the .desktop file:

sudo curl -L "https://gist.githubusercontent.com/hosni/1b9475ddc9c4ebdb90c98269ecf86ffd/raw/cursor.desktop" -o /usr/share/applications/cursor.desktop

Download the url-handler .desktop file:

sudo curl -L "https://gist.githubusercontent.com/hosni/1b9475ddc9c4ebdb90c98269ecf86ffd/raw/cursor-url-handler.desktop" -o /usr/share/applications/cursor-url-handler.desktop

Register cursor url-handler:

xdg-mime default cursor-url-handler.desktop x-scheme-handler/cursor

6. Install the App Icon

sudo mkdir -p /usr/share/icons/hicolor/scalable/apps
sudo curl -L "https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/logo/app-logo.svg" -o /usr/share/icons/hicolor/scalable/apps/cursor.svg

7. 🧹 Refresh the Icon Cache (Optional but Recommended)

If the Cursor IDE icon doesn’t appear in your application menu immediately:

Option 1: Refresh GTK icon caches manually

sudo update-icon-caches /usr/share/icons/*

Option 2 (GNOME only): Restart the shell

Press ALT + F2, type r, and press Enter.

ℹ️ This restarts GNOME Shell and refreshes icons without logging out.


✅ That’s it! You should now see Cursor IDE in your application launcher.

✅ Done!

You can now find Cursor IDE in your application menu or launch it using:

/opt/cursor/cursor.AppImage
[Desktop Entry]
Name=Cursor IDE - URL Handler
Comment=AI-powered code editor. Redefined.
GenericName=Text Editor
Exec=/opt/cursor/cursor.AppImage --open-url %U
Icon=cursor
Type=Application
NoDisplay=true
StartupNotify=true
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/cursor;
Keywords=cursor;
[Desktop Entry]
Name=Cursor IDE
Comment=AI-powered code editor
Exec=/opt/cursor/cursor.AppImage
Icon=cursor
Type=Application
Categories=Development;IDE;
Terminal=false
Actions=new-empty-window;
Keywords=cursor;
#!/bin/bash
set -e
echo "Fetching the latest Cursor IDE download URL..."
DOWNLOAD_URL=$(curl -s "https://www.cursor.com/api/download?platform=linux-x64&releaseTrack=stable" | jq -r .downloadUrl)
echo "Creating directory /opt/cursor..."
sudo mkdir -p /opt/cursor
echo "Downloading Cursor IDE AppImage..."
curl -L "$DOWNLOAD_URL" -o /opt/cursor/cursor.AppImage
echo "Making AppImage executable..."
sudo chmod +x /opt/cursor/cursor.AppImage
echo "Downloading .desktop entry..."
sudo curl -L "https://gist.githubusercontent.com/hosni/1b9475ddc9c4ebdb90c98269ecf86ffd/raw/cursor.desktop" -o /usr/share/applications/cursor.desktop
echo "Downloading url-handler .desktop entry..."
sudo curl -L "https://gist.githubusercontent.com/hosni/1b9475ddc9c4ebdb90c98269ecf86ffd/raw/cursor-url-handler.desktop" -o /usr/share/applications/cursor-url-handler.desktop
echo "Register cursor url-handler..."
xdg-mime default cursor-url-handler.desktop x-scheme-handler/cursor
echo "Downloading Cursor IDE icon..."
sudo mkdir -p /usr/share/icons/hicolor/scalable/apps
sudo curl -L "https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/logo/app-logo.svg" -o /usr/share/icons/hicolor/scalable/apps/cursor.svg
echo "Updating icon cache..."
sudo update-icon-caches /usr/share/icons/*
echo "Cursor IDE has been installed successfully!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment