How to Install NeoVim and Tmux when you don't have Root Access
Technical
Motivation
I love (Neo)Vim + Tmux. I've been using the classic combination as my development environment full-time for more than a year and a half now and I have nothing but good things to say. It's increased my productivity, forced me to get more familiar with bash and the terminal, and made me much more confident when SSHing into servers. Not to mention, it just makes coding more fun.
Anyways, I'm sure I'll be making more posts about NeoVim + Tmux in the future and why they're so awesome, but I wanted to make a really quick post detailing how you can install both locally on a server in case you don't have root access. I recently had to do this as part of my work as a research assistant at the Ivey School of Business and installing NeoVim was easy enough but there was a little bit of a gotcha with Tmux. Pretty much every guide I found online explained how to build Tmux from source and although this should work, it's a bit of a tricky and arduous process that frankly I highly disliked doing.
Luckily for us, Tmux released a pre-built app image for version 3.0a. If you need the app image for the latest version, you can get that following the instructions here but that requires docker so I'll ignore it for now; besides, the chances you'd actually notice a difference between 3.0a and the lastest version (which is 3.1c at the time of writing this) are little to none. For the purposes of this guide, I'll assume you haven't configured anything in your profile yet. Let's get started!
Installing NeoVim
Installing the latest version of NeoVim is simple enough. I've found the easiest and most non-hassle way to be to use the pre-built app image. Just go to your home directory, download using curl
and grant yourself permission to execute.
cd ~
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
To confirm everything is working correctly, just run ./nvim.appimage
from your root directory and you should see NeoVim open up. Now all that's left to do is to rename the app image to nvim
and place it in a location that's on your $PATH
. I highly suggest creating a new directory /bin
in your home directory if you haven't already done so and adding it to your $PATH
to place local executables like nvim
in (this is the defacto linux standard, although there are alternatives like $HOME/.local/bin
that you can use too).
mkdir $HOME/bin
export PATH="$HOME/bin:$PATH"
Finally, just move nvim.appimage
from your home directory to the $HOME/bin
folder and rename it to nvim, and you should be good to go!
mv ~/nvim.appimage ~/bin/nvim
Now you should be able to open files under any directory with NeoVim using nvim <filename>
.
Installing Tmux
Getting Tmux setup from the app image should be really easy now, especially since we've already created our local ~/bin
folder and added it to our $PATH
. Let's download the app image directly to the ~/bin
folder.
cd ~/bin
curl -LO https://github.com/tmux/tmux/releases/download/3.0a/tmux-3.0a-x86_64.AppImage
chmod u+x tmux-3.0a-x86_64.AppImage
mv tmux-3.0a-x86_64.AppImage tmux
And that's it! You should be able to run tmux
from anywhere in your local file system now.
I hope this quick article was helpful to you or provided you what you were looking for. Be on the lookout for future articles where I detail my NeoVim + Tmux config and explain how I use both tools in tandem to improve my workflow.