Cursor is an AI-powered code editor built as a fork of Visual Studio Code, bringing advanced AI capabilities directly into your coding workflow. If you're running Ubuntu or any Debian-based Linux distribution, this guide will walk you through the complete installation process.
Prerequisites
- Ubuntu 22.04 or any Debian-based Linux distribution
- Terminal access with sudo privileges
- Basic familiarity with command-line operations
Step 1: Download Cursor
First, visit cursor.com/downloads and download the Linux version. The download will be an AppImage file (approximately named Cursor-1.4.5-x86_64.AppImage
).
Step 2: Make the AppImage Executable
Navigate to your downloads directory and make the AppImage executable:
chmod a+x Cursor-1.4.5-x86_64.AppImage
Why this step? AppImage files need executable permissions to run. By default, downloaded files don't have execute permissions for security reasons.
Step 3: Install FUSE Library
Install the required FUSE library that AppImages need to function:
sudo apt install libfuse2t64
Why this step? AppImages use FUSE (Filesystem in Userspace) to mount and run applications. Without this library, the AppImage won't execute properly.
Step 4: Move Cursor to a Permanent Location
Move the AppImage to a system directory for easier access:
sudo mv Cursor-1.4.5-x86_64.AppImage /opt/cursor.AppImage
Why this step? Placing the application in /opt/ follows Linux conventions for optional software packages and ensures it's available system-wide rather than cluttering your downloads folder.
Step 5: Create a Desktop Entry (Optional but Recommended)
Create a desktop entry so Cursor appears in your applications menu:
sudo vi /usr/share/applications/cursor.desktop
We're using Vim here (the terminal text editor that's either your best friend or your worst nightmare). Add the following content to the file:
[Desktop Entry]
Name=Cursor
Exec=/opt/cursor.AppImage
Icon=/path/to/cursor/logo.png
Type=Application
Categories=Development;
First time using Vim? Here's your survival guide:
Press i to enter Insert mode (now you can type)
Press Esc to exit Insert mode
Type :wq and press Enter to save and quit
If you mess up, type :q! to quit without saving
Why this step? Desktop entries allow you to launch applications from your desktop environment's application menu instead of always using the terminal.
Note: You can download a Cursor logo or use any icon you prefer. Just update the Icon path accordingly, or omit this line if you don't want a custom icon.
Step 6: Create a Wrapper Script
Create a convenient command-line launcher:
sudo vi /usr/local/bin/cursor
Add this content:
#!/bin/bash
/opt/cursor.AppImage "$@" > /dev/null 2>&1 &
Make the script executable:
sudo chmod +x /usr/local/bin/cursor
Why this step? This wrapper script allows you to launch Cursor from anywhere in your terminal by simply typing cursor. It also runs the application in the background and suppresses output to keep your terminal clean.
Step 7: Configure AppArmor Security Profile
Create a security profile for AppArmor (Ubuntu's security system):
sudo vi /etc/apparmor.d/cursor-appimage
Add this content:
#include <tunables/global>
profile cursor /opt/cursor.AppImage flags=(unconfined) {
#include <abstractions/base>
/opt/cursor.AppImage mr,
owner @{HOME}/** rw,
/tmp/** rwk,
/proc/sys/kernel/yama/ptrace_scope r,
/sys/devices/system/cpu/cpufreq/policy*/cpuinfo_max_freq r,
}
Load the security profile:
sudo apparmor_parser -r /etc/apparmor.d/cursor-appimage
Why this step? This creates a security profile that defines what system resources Cursor can access. Recent Ubuntu versions may block AppImages without proper AppArmor profiles, so this prevents potential security errors.
Step 8: Launch Cursor
Now you can launch Cursor in several ways:
- From terminal: Simply type cursor . (the dot opens current directory)
- From applications menu: Look for Cursor in your development applications
- Direct execution: Run /opt/cursor.AppImage
Troubleshooting Tips
- If you encounter permission issues, ensure all files have correct permissions
- For older Ubuntu versions, you might need libfuse2 instead of libfuse2t64
- If AppArmor blocks execution, verify the security profile is correctly loaded
Installing Cursor on Ubuntu is straightforward once you understand each step's purpose. The installation process might seem involved, but each step serves a specific purpose in creating a robust, secure, and user-friendly setup.
Have you tried Cursor on Linux? Share your experience in the comments below! If this guide helped you, please give it a like and share it with other developers.
Top comments (2)
much needed...
Well explained