How to Install Neovim on Ubuntu Linux

Neovim is a modernized fork of Vim that extends the classic text editor with asynchronous plugins, a built-in terminal emulator, and Lua scripting capabilities. Unlike traditional Vim, Neovim delivers non-blocking operations that keep the editor responsive during heavy plugin activity, built-in LSP (Language Server Protocol) support for IDE-like features without external dependencies, and first-class Lua integration for faster, more maintainable configuration. The editor preserves Vim’s modal editing and keybindings while modernizing the plugin ecosystem and improving performance.

This guide covers installing Neovim on Ubuntu through the default APT repository, the Neovim Team PPA for latest releases, universal packages (Snap, Flatpak, AppImage), pre-built tarballs, and building from source. You’ll learn how to choose the right installation method, launch Neovim, manage updates, and remove it when needed.

Choose Your Neovim Installation Method

Compare Neovim Installation Paths

To begin, Ubuntu offers multiple Neovim installation paths that balance stability, update frequency, and isolation. Understanding the differences helps you choose the method that matches your development needs and update preferences.

MethodVersion/ChannelStabilityBest For
Ubuntu RepositoryStable, older versionsHigh stability, tested by Ubuntu maintainersProduction systems, users who prioritize stability over features
Neovim Team PPA (Stable)Latest stable releaseBalanced stability with recent featuresDevelopment workstations needing current stable releases
Neovim Team PPA (Unstable)Nightly builds, pre-releaseLower stability, cutting-edge featuresPlugin developers, early adopters testing new features
SnapLatest stable, automatic updatesModerate stability, sandboxed environmentUsers wanting automatic updates and quick rollback capability
FlatpakLatest stable, sandboxedModerate stability, isolated from systemMulti-distribution users, security-focused environments
AppImageLatest stable, portableHigh stability, self-containedUsers without root access, portable installations, testing on multiple systems
Pre-built TarballLatest stable or specific versionHigh stability, manual controlUsers wanting full control over installation location, avoiding package managers
Build from SourceAny branch or commitVariable, depends on branchDevelopers needing custom builds, contributing to Neovim, testing unreleased features

Pick the Right Release Strategy

First, the Ubuntu default repository provides the most conservative option with thorough testing but lags behind upstream releases. Next, the Neovim Team PPAs deliver faster updates; the stable PPA tracks official releases within days, while the unstable PPA provides nightly builds for testing new features. Additionally, Snap and Flatpak offer automatic updates with sandboxed environments that isolate Neovim from system libraries, though they consume more disk space and may have slower startup times than native packages. Likewise, AppImage and pre-built tarballs provide portable installations without system integration, useful when you lack root access or need version control. Finally, building from source offers maximum flexibility for developers and users needing custom compilation options.

Overall, the stable PPA strikes the best balance between current features and reliability. Production systems should favor the default repository for maximum stability, while plugin developers benefit from the unstable PPA’s early access to API changes. Advanced users who need portability or custom builds can use AppImage, tarballs, or compile from source.

Update Ubuntu Before Installing Neovim

First, update your Ubuntu system before installing Neovim to ensure package compatibility. Run the following command in the terminal:

sudo apt update && sudo apt upgrade

In turn, this command updates your package list and installs any available system updates.

Install Neovim with APT (Ubuntu Repository or PPA)

Install Neovim from the Ubuntu Repository

First, the simplest method to install Neovim is through the standard Ubuntu repository. Run the following command:

sudo apt install neovim

However, this method installs the version available in the official Ubuntu repository, which may lag behind the latest Neovim release. For cutting-edge features and recent updates, use the Neovim Team PPA instead.

Install Neovim from the Neovim Team PPA

Alternatively, users wanting the latest features can import either the stable or unstable (nightly) version directly from the Neovim Launchpad PPA. Choose one of the following commands based on your needs:

Import Neovim stable PPA:

sudo add-apt-repository ppa:neovim-ppa/stable -y

Import Neovim unstable PPA:

sudo add-apt-repository ppa:neovim-ppa/unstable -y

After importing the PPA, update your package index:

sudo apt update

Next, install Neovim with this command:

sudo apt install neovim

After installation completes, verify the PPA version was installed by checking the package policy:

apt-cache policy neovim

The output displays the installed version and confirms the PPA source. The example below shows the unstable PPA version:

Install Neovim with Snap Packages

Similarly, Snap provides an alternative installation method for Neovim on Ubuntu. Your Ubuntu desktop should already have Snap installed unless you removed it.

However, Snap is less popular than Flatpak across Linux distributions even though it comes from Canonical (Ubuntu’s developers) and integrates tightly with Ubuntu systems. Update frequency depends on the package maintainer, though Snap’s automatic update mechanism keeps applications current without manual intervention.

Prepare Snap Support

If you’ve uninstalled snapd from your system, reinstall it so the Snap daemon can manage packages:

sudo apt install snapd

Additionally, ensure the system-wide /snap mount point exists before Classic snaps attempt to bind to it. This script checks if /snap exists and creates a symbolic link to the actual snap directory if missing:

if [ ! -e /snap ]; then
  sudo ln -s /var/lib/snapd/snap /snap
fi

The -e flag checks for file existence, and ln -s creates a symbolic link (similar to a Windows shortcut) that points from /snap to where snapd stores packages.

Next, install the Snap core files to prevent conflicts and guarantee base runtimes are available:

sudo snap install core

Install the Neovim Snap

After the prerequisites finish, install Neovim with classic confinement so the editor can access your entire filesystem:

sudo snap install nvim --classic

Snap will now refresh the package automatically in the background, reducing manual upkeep.

Install Neovim from Flatpak on Ubuntu

Likewise, Flatpak provides another installation option with a sandboxed application environment that isolates Neovim from system libraries. First, add the Flathub repository that hosts the Neovim package.

If Flatpak isn’t installed on your system, refer to How to Install Flatpak on Ubuntu for instructions on obtaining the latest supported version through the Flatpak Team PPA.

Open the terminal and add the Flathub repository with this command:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Next, install Neovim system-wide with this Flatpak command:

sudo flatpak install flathub io.neovim.nvim

These steps complete the Neovim installation via Flatpak.

Run Neovim via AppImage (Portable)

Alternatively, AppImage provides a portable, distribution-agnostic package that runs on most Linux systems without installation. This method works well for systems where you lack root access or need to run Neovim without affecting the system. The AppImage contains all dependencies and runs in isolation.

Download and Test the AppImage

First, download the latest stable AppImage from the official Neovim releases. The -L flag follows redirects (GitHub redirects to the actual file), and -O saves the file with its original name:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage

Next, make the AppImage executable. The u+x syntax grants execute permission to the file owner (you) so the system can run it as a program:

chmod u+x nvim.appimage

Then launch the AppImage to confirm it runs correctly:

./nvim.appimage

If the AppImage fails to run at this stage (older systems or FUSE issues), extract the contents manually and run the binary directly. The --appimage-extract flag unpacks the AppImage into a squashfs-root directory, and AppRun is the actual executable inside:

./nvim.appimage --appimage-extract
./squashfs-root/AppRun --version

Enable System-wide Access to the AppImage

Afterward, once the AppImage passes basic testing, move it to a standard directory and create a consistent command path:

sudo mkdir -p /opt/nvim
sudo mv nvim.appimage /opt/nvim/nvim

Next, Bash users can append the directory once and reload the shell. This script checks if the PATH export already exists in ~/.bashrc to prevent duplicate entries. The grep -q command searches quietly (no output), 2>/dev/null suppresses errors if the file doesn’t exist, and the ! negates the result so the command only runs when the path isn’t found:

if ! grep -q "/opt/nvim" ~/.bashrc 2>/dev/null; then
  cat <<'EOF' >> ~/.bashrc
if [[ ":$PATH:" != *":/opt/nvim:"* ]]; then
  export PATH="$PATH:/opt/nvim"
fi
EOF
fi
source ~/.bashrc

The source command reloads your shell configuration immediately so the new PATH takes effect without logging out.

Likewise, Zsh users should add the same export to ~/.zshrc and reload the configuration:

if ! grep -q "/opt/nvim" ~/.zshrc 2>/dev/null; then
  cat <<'EOF' >> ~/.zshrc
if [[ ":$PATH:" != *":/opt/nvim:"* ]]; then
  export PATH="$PATH:/opt/nvim"
fi
EOF
fi
source ~/.zshrc

After reloading your shell, running nvim launches the AppImage from any directory.

AppImage packages may not work on Linux distributions older than 4 years. If you encounter compatibility issues, use one of the package manager methods instead.

Install Neovim from a Pre-built Tarball

Alternatively, pre-built tarballs offer a manual installation method that gives you control over the installation location without requiring package managers. This approach works when you need specific versions or want to isolate Neovim from system package management.

Download and Extract the Tarball

Begin by downloading the latest stable release tarball for your architecture using curl:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz

Afterward, remove any existing installation to avoid conflicts:

sudo rm -rf /opt/nvim-linux64

Then extract the tarball to /opt. The -C /opt flag changes to that directory before extracting, -x extracts files, -z decompresses gzip archives, and -f specifies the filename:

sudo tar -C /opt -xzf nvim-linux64.tar.gz

Add the Tarball Build to PATH

Next, add Neovim to your PATH by editing the shell configuration file only once. Bash users can run:

if ! grep -q "/opt/nvim-linux64/bin" ~/.bashrc 2>/dev/null; then
  cat <<'EOF' >> ~/.bashrc
if [[ ":$PATH:" != *":/opt/nvim-linux64/bin:"* ]]; then
  export PATH="$PATH:/opt/nvim-linux64/bin"
fi
EOF
fi
source ~/.bashrc

Likewise, Zsh users should add the same export to ~/.zshrc:

if ! grep -q "/opt/nvim-linux64/bin" ~/.zshrc 2>/dev/null; then
  cat <<'EOF' >> ~/.zshrc
if [[ ":$PATH:" != *":/opt/nvim-linux64/bin:"* ]]; then
  export PATH="$PATH:/opt/nvim-linux64/bin"
fi
EOF
fi
source ~/.zshrc

Finally, verify the installation:

nvim --version

The output confirms the installed version:

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068

For ARM64 systems, replace nvim-linux64.tar.gz with nvim-linux-arm64.tar.gz in the download command.

Build Neovim from Source

For maximum control, building from source gives you complete command over compilation options, allows testing development versions, and enables custom configurations for specific needs. This method requires build tools and is primarily for developers or users needing bleeding-edge features not yet in releases.

Install Build Prerequisites

Beforehand, install the required development tools and libraries. The build process requires CMake for configuration management:

sudo apt install ninja-build gettext cmake unzip curl build-essential

Clone and Build Neovim

Next, clone the Neovim repository from GitHub using Git:

git clone https://github.com/neovim/neovim.git
cd neovim

Then, check out the stable branch for the latest stable release. The git checkout command switches your working directory to the specified branch, giving you the tested stable code instead of development versions:

git checkout stable

Afterward, build Neovim with release optimizations. The CMAKE_BUILD_TYPE=Release flag enables compiler optimizations that produce faster code by removing debugging symbols and applying performance tuning:

make CMAKE_BUILD_TYPE=Release

Finally, install Neovim system-wide to /usr/local:

sudo make install

Alternatively, install to a custom location under your home directory to avoid requiring root privileges and simplify removal. The CMAKE_INSTALL_PREFIX flag tells the build system where to install files (default is /usr/local), and $HOME expands to your home directory path:

rm -rf build/
make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install

The rm -rf build/ command removes the previous build directory to ensure a clean build with the new installation prefix.

Next, Bash users can add the new directory to their PATH with:

if ! grep -q "$HOME/neovim/bin" ~/.bashrc 2>/dev/null; then
  cat <<'EOF' >> ~/.bashrc
if [[ ":$PATH:" != *":$HOME/neovim/bin:"* ]]; then
  export PATH="$HOME/neovim/bin:$PATH"
fi
EOF
fi
source ~/.bashrc

Likewise, Zsh users should mirror the change inside ~/.zshrc:

if ! grep -q "$HOME/neovim/bin" ~/.zshrc 2>/dev/null; then
  cat <<'EOF' >> ~/.zshrc
if [[ ":$PATH:" != *":$HOME/neovim/bin:"* ]]; then
  export PATH="$HOME/neovim/bin:$PATH"
fi
EOF
fi
source ~/.zshrc

Finally, verify the installation shows the built version:

nvim --version

The output displays the version and build information:

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Compilation: /usr/bin/cc -O3 -DNDEBUG

Building from the master branch provides development features but may contain bugs. Production systems should use the stable branch or tagged releases.

Launch Neovim via CLI or GUI

Afterward, launch Neovim using commands specific to your installation method.

Launch Neovim from APT or PPA Installation

If you installed Neovim using the Ubuntu repository or PPA, launch it with the standard command:

nvim

If you prefer typing neovim, create an alias in your shell configuration. This script works identically to the PATH modification commands shown earlier, checking if the alias exists before adding it to prevent duplicates (swap ~/.bashrc with ~/.zshrc when needed):

if ! grep -q "alias neovim='nvim'" ~/.bashrc 2>/dev/null; then
  echo "alias neovim='nvim'" >> ~/.bashrc
fi
source ~/.bashrc

Launch Neovim from Snap Installation

Similarly, Snap installations use the snap-provided command:

nvim

Launch Neovim from Flatpak Installation

Likewise, Flatpak installations launch through the application ID:

flatpak run io.neovim.nvim

Launch Neovim from AppImage, Tarball, or Source Installation

In these cases, AppImage, tarball, or source installations where you added the binary to your PATH launch with the standard command:

nvim

If you prefer to skip the PATH export, launch Neovim from the binary path that matches your installation.

AppImage builds live at /opt/nvim/nvim after you relocate the file:

/opt/nvim/nvim

Tarball extractions place the binary inside /opt/nvim-linux64/bin:

/opt/nvim-linux64/bin/nvim

Source installations default to /usr/local/bin/nvim. Use the custom prefix path if you installed to your home directory:

$HOME/neovim/bin/nvim

Launch Neovim from Desktop GUI

Alternatively, desktop users can locate the Neovim application icon by navigating to Activities > Show Applications > Neovim. Add Neovim to your favorites for quick access.

Update and Remove Neovim

Update Neovim

To stay current, keep Neovim updated by checking for new releases regularly. While some installation methods provide automatic updates, manual checks ensure you have the latest features and security fixes. Use the appropriate command for your installation method:

Update Neovim Installed via APT

For APT installations (Ubuntu repository or PPA), update the package list and upgrade packages:

sudo apt update && sudo apt upgrade

Update Neovim Installed via Flatpak

Meanwhile, Flatpak installations update all Flatpak applications system-wide:

sudo flatpak update

Update Neovim Installed via Snap

Likewise, Snap installations refresh all snap packages:

sudo snap refresh

Update Neovim Installed via AppImage

Instead, AppImage installations require manual updates. Download the latest version and replace the existing file. The mv command moves and renames the new AppImage to overwrite the old one in /opt/nvim/nvim:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
sudo mv nvim.appimage /opt/nvim/nvim

Update Neovim Installed via Pre-built Tarball

Similarly, tarball installations download the latest release and extract it to replace the existing version:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim-linux64
sudo tar -C /opt -xzf nvim-linux64.tar.gz

Update Neovim Built from Source

For source builds, navigate to your Neovim repository, check out the desired branch, pull the latest changes, and rebuild. The git pull command downloads and merges the latest commits from the remote repository into your local branch, ensuring you have the newest stable code:

cd neovim
git checkout stable
git pull
make CMAKE_BUILD_TYPE=Release
sudo make install

When necessary, adjust the installation command if you installed to a custom location. Ensure you check out the correct branch before pulling updates:

cd neovim
git checkout stable
git pull
rm -rf build/
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install

Ultimately, regular updates ensure you benefit from the latest features, improvements, and bug fixes.

Remove Neovim

When you no longer need Neovim, uninstall it using the method that matches your original installation. These steps remove the application and clean up leftover files.

Remove Neovim Installed via APT

For APT installations, uninstall Neovim with this command:

sudo apt remove neovim

When necessary, if you installed Neovim using one of the PPAs, remove them with these commands:

Remove Neovim Stable PPA:

sudo add-apt-repository --remove ppa:neovim-ppa/stable -y

Remove Neovim Unstable PPA:

sudo add-apt-repository --remove ppa:neovim-ppa/unstable -y

Remove Neovim Installed via Flatpak

Meanwhile, Flatpak installations uninstall Neovim and its data:

sudo flatpak remove --delete-data io.neovim.nvim -y

Remove Neovim Installed via Snap

Likewise, Snap installations remove Neovim with this command:

sudo snap remove nvim

Remove Neovim Installed via AppImage

For AppImage builds, remove the AppImage file and clean up PATH modifications:

sudo rm -rf /opt/nvim

Afterward, remove the PATH export from your shell configuration file by editing it. For bash, edit ~/.bashrc; for zsh, edit ~/.zshrc. Delete this line:

export PATH="$PATH:/opt/nvim"

Remove Neovim Installed via Pre-built Tarball

Similarly, tarball installations remove the extracted directory and clean up PATH modifications:

sudo rm -rf /opt/nvim-linux64

Next, remove the PATH export from your shell configuration file by editing it. For bash, edit ~/.bashrc; for zsh, edit ~/.zshrc. Delete this line:

export PATH="$PATH:/opt/nvim-linux64/bin"

Remove Neovim Built from Source

For source installations to /usr/local, use the CMake uninstall target from the build directory. The --build build/ flag specifies the build directory, and --target uninstall runs the uninstall rules defined by the build system:

cd neovim
sudo cmake --build build/ --target uninstall

Alternatively, manually remove the installation artifacts. The binary lives in /usr/local/bin/nvim, and support files (runtime files, documentation, syntax definitions) reside in /usr/local/share/nvim/:

sudo rm /usr/local/bin/nvim
sudo rm -r /usr/local/share/nvim/

Otherwise, if you installed to a custom location like $HOME/neovim, simply remove that directory and clean up your PATH:

rm -rf ~/neovim

Lastly, remove the PATH export from your shell configuration file by editing it and deleting the relevant line.

Conclusion

Ultimately, Neovim delivers a modernized Vim experience with asynchronous plugins, Lua scripting, and a built-in terminal emulator. The installation methods range from Ubuntu’s default repository for stable versions to the Neovim Team PPA for cutting-edge releases, with Snap and Flatpak providing sandboxed alternatives, AppImage and tarballs offering portable deployments, and source builds enabling custom configurations. Choose the method that matches your technical requirements and update preferences to maintain access to the latest features for terminal-based development.

Leave a Comment