[Tutorial] Install Cursor permanently when AppImage install didn't work on Linux

This is a user install. System-wide install is pretty similar, just different paths.

1. Create a new folder for cursor

mkdir -p ~/Applications/cursor

2. Get the latest version of cursor in that folder

wget -O ~/Applications/cursor/cursor.AppImage "https://downloader.cursor.sh/linux/appImage/x64"

3. Make sure AppImage is executable (should already be but still)

chmod +x ~/Applications/cursor/cursor.AppImage

4. Make a symlink to be able to launch cursor from command line

sudo ln -s ~/Applications/cursor/cursor.AppImage /usr/local/bin/cursor

5. Download this image and put it in ~/Applications/cursor/
cursor_icon

6. Create a desktop entry to make it accessible in your menus

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

7. Shift + Insert this code in the new file, then Ctrl + X, then Y, then Enter
Also, change your_username by your actual username.

[Desktop Entry]
Name=Cursor
Exec=/home/your_username/Applications/cursor/cursor.AppImage
Icon=/home/your_username/Applications/cursor/cursor-icon.png
Type=Application
Categories=Utility;Development;

8. Create an update script

nano ~/Applications/cursor/update-cursor.sh

9. Shift + Insert this code into the script, then Ctrl + X, then Y, then Enter

#!/bin/bash

APPDIR=~/Applications/cursor
APPIMAGE_URL="https://downloader.cursor.sh/linux/appImage/x64"

wget -O $APPDIR/cursor.AppImage $APPIMAGE_URL
chmod +x $APPDIR/cursor.AppImage

10. Make this script executable

chmod +x ~/Applications/cursor/update-cursor.sh

11. Create a service to update cursor at startup

nano ~/.config/systemd/user/update-cursor.service

12.Shift + Insert this code into the service, then Ctrl + X, then Y, then Enter
Also, change your_username by your actual username.

[Unit]
Description=Update Cursor

[Service]
ExecStart=/home/your_username/Applications/cursor/update-cursor.sh
Type=oneshot

[Install]
WantedBy=default.target

13. Enable and start the service

systemctl --user enable update-cursor.service
systemctl --user start update-cursor.service

That’s all, enjoy Cursor completely now. You won’t have to dabble with AppImages in your Downloads folder as well anymore.

Of course I could have put just files and all, but I guess it’s always funny to learn how to do it no?

9 Likes

This is great! Thank you!

1 Like

I followed the instructions on Ubuntu 22.04, but I still couldn’t open the AppImage. I want to know if there are any restrictions on Ubuntu regarding this.

I’ve gone through the whole process again, but now I’m stuck because clicking the cursor image doesn’t do anything. I even changed all the permissions to root with chown, but I still can’t start it directly. I have to click the mouse to get the program going. Any idea how to fix this?

As mentioned in the reference documentation, the problem is that Ubuntu 24.04 implemented new restrictions for AppImage apps, which restricts the use of sandboxes.

The solution is to lift the restrictions that Ubuntu 24.04 implements in the AppImages.

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

Reference resources

If you want to quickly start zsh, you can use the following command. Just replace ‘your_username’ with your own username, and you can start it directly through 'cursor.

echo "alias cursor='~/Applications/cursor/cursor.AppImage'"

Just update the script for updating Cursor.

#!/bin/bash
# Update Cursor AppImage

# Variables
APPDIR=/home/yourusername/Applications/cursor
APPIMAGE_URL="https://downloader.cursor.sh/linux/appImage/x64"
APPIMAGE_PATH="$APPDIR/cursor.AppImage"
LOGFILE=/home/yourusername/Applications/cursor/update-cursor.log

# Logging function
log() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOGFILE"
}

# Check for network connectivity
log "Checking network connectivity..."
if ping -c 1 google.com &> /dev/null; then
    log "Network connection successful."

    # Download the latest AppImage
    log "Downloading the latest AppImage..."
    if wget -O "$APPIMAGE_PATH" "$APPIMAGE_URL"; then
        log "AppImage downloaded successfully."

        # Make it executable
        log "Making the AppImage executable..."
        if chmod +x "$APPIMAGE_PATH"; then
            log "Cursor AppImage has been updated and made executable."
            exit 0
        else
            log "Failed to make the AppImage executable."
            exit 3
        fi
    else
        log "Failed to download the AppImage. Please check the URL or your network connection."
        exit 2
    fi
else
    log "No network connection. Please check your connection and try again."
    exit 1
fi

Hi, in order to run the application with this, you can create a file called start_cursor.sh with the content
`#!/bin/bash

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
~/Applications/cursor/cursor.AppImage
`
And then chmod +x start.sh

Worked like a charm,Thanks!

1 Like