Back to blog
GuidesSeptember 17, 2026ยท3 min read

How to Install Vim on Ubuntu

How to Install Vim on Ubuntu

How to Install Vim on Ubuntu

To install Vim on Ubuntu, run sudo apt install vim. The following instructions cover how to install Vim on Ubuntu, describe the differences between vim, vim-nox, and vim-gtk3, and show how to set vim as the default editor that other command-line tools can auto-open.

How do I install vim on Ubuntu?

Install vim by running sudo apt install vim. It will install the standard command-line editor, without any graphical capabilities being included.

$ sudo apt install vim

Ubuntu's package listing says that vim is simply "Vi IMproved - enhanced vi editor" โ€” and this plain description is correct, as it does provide just a standard text editor.

What's the difference between vim, vim-nox, and vim-gtk3?

vim is the basic enhanced vi editor. vim-nox adds support for scripting languages, and vim-gtk3 adds graphical interface based on GTK3.

$ sudo apt install vim-nox
$ sudo apt install vim-gtk3

The difference between these packages is described clearly in the Ubuntu's package listings: vim-nox is called "Vi IMproved - enhanced vi editor - with scripting languages support", while vim-gtk3 is "Vi IMproved - enhanced vi editor - with GTK3 GUI" โ€” same basic editor, with some additional capabilities added.

Do I need vim-gtk3 on Ubuntu Server?

No. vim-gtk3 provides a graphical gvim editor, but such an editor makes no sense on a headless server with no display.

This is clearly stated in the package description โ€” any package labeled "with GTK3 GUI" requires graphical libraries and has no use in a headless server install, and therefore installing the basic vim would avoid pulling unnecessary dependencies.

How do I check which version of vim I have installed?

Use the command vim --version. It shows both the version number and a long list of compiled-in features.

$ vim --version

According to vim's own man page, the --version flag's job is simply to "print version information and exit" โ€” it's a read-only operation that does nothing else but providing this information about your currently installed vim version.

How do I set vim as my default editor?

Use sudo update-alternatives --config editor, and select vim in the list. This way other command-line tools will check which editor to open by default.

$ sudo update-alternatives --config editor

As one Ubuntu vim setup guide explains, "some command line utilities allow you to edit their configuration files in the default text editor," and this command will present "all the text editors installed on your system" allowing you to set vim as a default editor.

Our VPS plans and Bare Metal servers both offer you full apt access, so vim installation and configuration is done just as described above from the very start.

Get started with Orbit Servers

Low-latency VPS, bare metal, and colocation across the US, EU, and APAC - provisioned instantly and built for performance-critical workloads.

Get started
J

Written by

Julius

Related posts