Skip to content

Instantly share code, notes, and snippets.

@evgenyneu
Last active February 27, 2025 18:27
Show Gist options
  • Save evgenyneu/5c5c37ca68886bf1bea38026f60603b6 to your computer and use it in GitHub Desktop.
Save evgenyneu/5c5c37ca68886bf1bea38026f60603b6 to your computer and use it in GitHub Desktop.
Install Cursor AI code editor on Ubuntu 24.04 LTS

Install Cursor AI editor on Ubuntu 24.04

  1. Use the Download button on www.cursor.com web site. It will download the NAME.AppImage file.

  2. Copy the .AppImage file to your Applications directory

cd ~/Downloads
mkdir -p ~/Applications
mv NAME.AppImage ~/Applications/cursor.AppImage
  1. Install libfuse2
sudo apt update
sudo apt install libfuse2
  1. Make it an executable
chmod +x ~/Applications/cursor.AppImage
  1. Run
~/Applications/cursor.AppImage --no-sandbox
  1. Add cursor shortcut

Add to .bashrc or .zshrc

alias cursor='~/Applications/your-app.AppImage --no-sandbox'
@sradforth
Copy link

sradforth commented Nov 19, 2024

Thanks for sharing this, might be worth adding...

If you want a shortcut on your taskbar like any normal application, add this file

In terminal type

$ nano ~/.local/share/applications/cursor.desktop

Then add the link to your application. You will need the cursor.png icon file you can either extract from the AppImage or take a snapshot of it.

Would love the cursor team to sort this out though. It's unnecessarily difficult to install/update on ubuntu plus rather unsafe with the --no-sandbox flag that is recently needed.

[Desktop Entry]
Name=cursor
Exec=/home/HOMEDIRHERE/Apps/your-app.AppImage --no-sandbox
Icon=/home/HOMEDIRHERE/.local/share/icons/cursor.png
Type=Application
Terminal=false

@verystrongjoe
Copy link

Is it working for Ubuntu 22.04?

@evgenyneu
Copy link
Author

@verystrongjoe should work on any version

@ki11e6
Copy link

ki11e6 commented Dec 21, 2024

works great. If anyone need script use following (i copied from another guy in comminity)

`
#!/bin/bash

installCursor() {
if ! [ -f /opt/cursor.appimage ]; then
echo "Installing Cursor AI IDE..."

    # URLs for Cursor AppImage and Icon
    CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
    ICON_URL="https://raw.githubusercontent.com/rahuljangirwork/copmany-logos/refs/heads/main/cursor.png"

    # Paths for installation
    APPIMAGE_PATH="/opt/cursor.appimage"
    ICON_PATH="/opt/cursor.png"
    DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"

    # Install curl if not installed
    if ! command -v curl &> /dev/null; then
        echo "curl is not installed. Installing..."
        sudo apt-get update
        sudo apt-get install -y curl
    fi

    # Download Cursor AppImage
    echo "Downloading Cursor AppImage..."
    sudo curl -L $CURSOR_URL -o $APPIMAGE_PATH
    sudo chmod +x $APPIMAGE_PATH

    # Download Cursor icon
    echo "Downloading Cursor icon..."
    sudo curl -L $ICON_URL -o $ICON_PATH

    # Create a .desktop entry for Cursor
    echo "Creating .desktop entry for Cursor..."
    sudo bash -c "cat > $DESKTOP_ENTRY_PATH" <<EOL

[Desktop Entry]
Name=Cursor AI IDE
Exec=$APPIMAGE_PATH --no-sandbox
Icon=$ICON_PATH
Type=Application
Categories=Development;
EOL

    echo "Cursor AI IDE installation complete. You can find it in your application menu."
else
    echo "Cursor AI IDE is already installed."
fi

}

installCursor

`
run the script by giving chmod +x ./install_script.sh and run ./install_script.sh

@malachany
Copy link

malachany commented Jan 5, 2025

Edit from @ki11e6

Adding cursor alias as well. If you prefer the code alias, you can always update accordingly. Tested and working on Ubuntu.

#!/bin/bash

installCursor() {
if ! [ -f /opt/cursor.appimage ]; then
echo "Installing Cursor AI IDE..."

    # URLs for Cursor AppImage and Icon
    CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
    ICON_URL="https://raw.githubusercontent.com/rahuljangirwork/copmany-logos/refs/heads/main/cursor.png"

    # Paths for installation
    APPIMAGE_PATH="/opt/cursor.appimage"
    ICON_PATH="/opt/cursor.png"
    DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"

    # Install curl if not installed
    if ! command -v curl &> /dev/null; then
        echo "curl is not installed. Installing..."
        sudo apt-get update
        sudo apt-get install -y curl
    fi

    # Download Cursor AppImage
    echo "Downloading Cursor AppImage..."
    sudo curl -L $CURSOR_URL -o $APPIMAGE_PATH
    sudo chmod +x $APPIMAGE_PATH

    # Download Cursor icon
    echo "Downloading Cursor icon..."
    sudo curl -L $ICON_URL -o $ICON_PATH

    # Create a .desktop entry for Cursor
    echo "Creating .desktop entry for Cursor..."
    sudo bash -c "cat > $DESKTOP_ENTRY_PATH" <<EOL
[Desktop Entry]
Name=Cursor AI IDE
Exec=$APPIMAGE_PATH --no-sandbox
Icon=$ICON_PATH
Type=Application
Categories=Development;
EOL

    echo "Adding cursor alias to .bashrc..."
    bash -c "cat >> $HOME/.bashrc" <<EOL

# Cursor alias
function cursor() {
    /opt/cursor.appimage --no-sandox "\${@}" > /dev/null 2>&1 & disown
}
EOL

    source $HOME/.bashrc

    echo "Cursor AI IDE installation complete. You can find it in your application menu."
else
    echo "Cursor AI IDE is already installed."
fi
}

installCursor

@yuchenli-sony
Copy link

~/Applications/cursor.AppImage --no-sandbox

@Kinyugo
Copy link

Kinyugo commented Jan 11, 2025

This script installs or updates the Cursor AI IDE on Linux systems. It downloads the AppImage, sets up an application menu entry, and adds a shell alias (cursor) for easy usage. The script supports multiple shells (bash, zsh, fish) and gracefully handles updates.

@tenneseecox
Copy link

Step-by-Step Beginner Guide To Using and Running This Script To Install Cursor On Ubuntu (Updated Feb 2025 - Fixed Typos + Replaced Old Icon)

Step 1: Save the Script
First, you need to save this script to a file on your Ubuntu system:

  • Open a text editor like nano or gedit: nano install_cursor.sh
  • Copy and paste the corrected script below
  • Save the file and exit the editor (in nano: Ctrl+O, Enter, then Ctrl+X)

Step 2: Make the Script Executable

  • chmod +x install_cursor.sh
  • This command gives the script permission to run as a program.

Step 3: Run the Script

  • sudo ./install_cursor.sh
  • Using sudo ensures the script has the permissions it needs to install software in system directories.

Step 4: Apply the Alias

  • After the script completes, you'll need to refresh your shell to use the new alias:
  • source ~/.bashrc
  • You can also skip this by restarting your shell

Step 5: Using Cursor AI IDE
Now you can launch Cursor AI in two ways:

  • From the application menu: Look for "Cursor AI IDE" in your applications
  • From the terminal: Simply type cursor to launch it

Corrected Script:

#!/bin/bash

installCursor() {
if ! [ -f /opt/cursor.appimage ]; then
    echo "Installing Cursor AI IDE..."

    # Check for sudo privileges
    if [ "$(id -u)" -ne 0 ]; then
        echo "This script needs sudo privileges to install Cursor AI."
        echo "Please run with: sudo $0"
        return 1
    fi

    # URLs for Cursor AppImage and Icon
    CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
    ICON_URL="https://registry.npmmirror.com/@lobehub/icons-static-png/latest/files/dark/cursor.png"

    # Paths for installation
    APPIMAGE_PATH="/opt/cursor.appimage"
    ICON_PATH="/opt/cursor.png"
    DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"

    # Install curl if not installed
    if ! command -v curl &> /dev/null; then
        echo "curl is not installed. Installing..."
        apt-get update
        apt-get install -y curl
    fi

    # Download Cursor AppImage
    echo "Downloading Cursor AppImage..."
    if ! curl -L $CURSOR_URL -o $APPIMAGE_PATH; then
        echo "Failed to download Cursor AppImage. Please check your internet connection."
        return 1
    fi
    chmod +x $APPIMAGE_PATH

    # Download Cursor icon
    echo "Downloading Cursor icon..."
    if ! curl -L $ICON_URL -o $ICON_PATH; then
        echo "Failed to download Cursor icon, but continuing installation."
    fi

    # Create a .desktop entry for Cursor
    echo "Creating .desktop entry for Cursor..."
    cat > $DESKTOP_ENTRY_PATH <<EOL
[Desktop Entry]
Name=Cursor AI IDE
Exec=$APPIMAGE_PATH --no-sandbox
Icon=$ICON_PATH
Type=Application
Categories=Development;
EOL

    echo "Adding cursor alias to .bashrc..."
    if [ -f "$HOME/.bashrc" ]; then
        cat >> $HOME/.bashrc <<EOL

# Cursor alias
function cursor() {
    /opt/cursor.appimage --no-sandbox "\${@}" > /dev/null 2>&1 & disown
}
EOL
        echo "Alias added. To use it in this terminal session, run: source $HOME/.bashrc"
    else
        echo "Could not find .bashrc file. Cursor can still be launched from the application menu."
    fi

    echo "Cursor AI IDE installation complete. You can find it in your application menu."
else
    echo "Cursor AI IDE is already installed."
fi
}

installCursor

@jagannath-p-s
Copy link

Edit from @ki11e6

Adding cursor alias as well. If you prefer the code alias, you can always update accordingly. Tested and working on Ubuntu.

#!/bin/bash

installCursor() {
if ! [ -f /opt/cursor.appimage ]; then
echo "Installing Cursor AI IDE..."

    # URLs for Cursor AppImage and Icon
    CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
    ICON_URL="https://raw.githubusercontent.com/rahuljangirwork/copmany-logos/refs/heads/main/cursor.png"

    # Paths for installation
    APPIMAGE_PATH="/opt/cursor.appimage"
    ICON_PATH="/opt/cursor.png"
    DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"

    # Install curl if not installed
    if ! command -v curl &> /dev/null; then
        echo "curl is not installed. Installing..."
        sudo apt-get update
        sudo apt-get install -y curl
    fi

    # Download Cursor AppImage
    echo "Downloading Cursor AppImage..."
    sudo curl -L $CURSOR_URL -o $APPIMAGE_PATH
    sudo chmod +x $APPIMAGE_PATH

    # Download Cursor icon
    echo "Downloading Cursor icon..."
    sudo curl -L $ICON_URL -o $ICON_PATH

    # Create a .desktop entry for Cursor
    echo "Creating .desktop entry for Cursor..."
    sudo bash -c "cat > $DESKTOP_ENTRY_PATH" <<EOL
[Desktop Entry]
Name=Cursor AI IDE
Exec=$APPIMAGE_PATH --no-sandbox
Icon=$ICON_PATH
Type=Application
Categories=Development;
EOL

    echo "Adding cursor alias to .bashrc..."
    bash -c "cat >> $HOME/.bashrc" <<EOL

# Cursor alias
function cursor() {
    /opt/cursor.appimage --no-sandox "\${@}" > /dev/null 2>&1 & disown
}
EOL

    source $HOME/.bashrc

    echo "Cursor AI IDE installation complete. You can find it in your application menu."
else
    echo "Cursor AI IDE is already installed."
fi
}

installCursor

thanks dude

@websperoops
Copy link

@tenneseecox a command like cursor ./project won't work though correct. Which opens the specific project folder directly in cursor.

@websperoops
Copy link

For anyone running into issues for cursor terminal command in ubuntu adding following into .bashrc file worked for me which Removing / from "${@}"

function cursor() {
    /opt/cursor.appimage --no-sandbox "${@}" > /dev/null 2>&1 & disown
}

@websperoops
Copy link

websperoops commented Feb 25, 2025

Corrected Script:

#!/bin/bash

installCursor() {
if ! [ -f /opt/cursor.appimage ]; then
echo "Installing Cursor AI IDE..."

    # URLs for Cursor AppImage and Icon
    CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
    ICON_URL="https://raw.githubusercontent.com/rahuljangirwork/copmany-logos/refs/heads/main/cursor.png"

    # Paths for installation
    APPIMAGE_PATH="/opt/cursor.appimage"
    ICON_PATH="/opt/cursor.png"
    DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"

    # Install curl if not installed
    if ! command -v curl &> /dev/null; then
        echo "curl is not installed. Installing..."
        sudo apt-get update
        sudo apt-get install -y curl
    fi

    # Download Cursor AppImage
    echo "Downloading Cursor AppImage..."
    sudo curl -L $CURSOR_URL -o $APPIMAGE_PATH
    sudo chmod +x $APPIMAGE_PATH

    # Download Cursor icon
    echo "Downloading Cursor icon..."
    sudo curl -L $ICON_URL -o $ICON_PATH

    # Create a .desktop entry for Cursor
    echo "Creating .desktop entry for Cursor..."
    sudo bash -c "cat > $DESKTOP_ENTRY_PATH" <<EOL
[Desktop Entry]
Name=Cursor AI IDE
Exec=$APPIMAGE_PATH --no-sandbox
Icon=$ICON_PATH
Type=Application
Categories=Development;
EOL

    echo "Adding cursor alias to .bashrc..."
    bash -c "cat >> $HOME/.bashrc" <<EOL

# Cursor alias
function cursor() {
    /opt/cursor.appimage --no-sandbox "${@}" > /dev/null 2>&1 & disown
}
EOL

    source $HOME/.bashrc

    echo "Cursor AI IDE installation complete. You can find it in your application menu."
else
    echo "Cursor AI IDE is already installed."
fi
}

installCursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment