How To Install a Text Editor on a VPS or Dedicated Server

This tutorial will show you how to install a text editor on your server. You may be asking why one is necessary and why there isn’t one already installed. There may actually be one installed with your VPS… depending upon the particular version of the operating system you’re using. Some versions of CentOS, for example, may not come with one. Or they do come with one but it’s not abundantly clear which one it is. As for why you need a text editor? That’s because to make changes to most settings on the server you need to open a corresponding file in a text editor first. So if you were looking to edit Postfix’s mail server settings then you would need to edit main.cf in the etc/postfix directory.

If you already know that your server has a text editor and you know how to get it to open and edit files then feel free to skip this tutorial as it isn’t necessary for you to install another. (Installing another is likely just a waste of time/energy for you.)

The editor I recommend is nano. Like my suggestions with SSH clients Nano is fairly basic but it gets the job done and doesn’t take up much room at all. And on the plus side it’s name is pretty short so it makes typing and opening numerous files fairly quick. (Typing nano takes less time than typing say notepad plus it’s shorter and has less room for making a mistake in typing.)
So then to install it first log into your server with your SSH client of choice. Then what you enter to actually install the program will vary depending on what type of operating system you have. The most common Linux versions used for VPS are CentOS, Ubuntu and Debian.

– on a CentOS machine type:
“yum install nano”

– on a Ubuntu/Debian machine:
“sudo apt-get install nano”

After you enter the appropriate line (like mentioned before, ensure it’s spelled properly) this will tell the server to download the application from the repository of files associated with that operating system and then install the program for you. The process is automatic once you enter the appropriate command (so nothing more you need to do) and is generally very quick. Nano is not a very large program to begin with and most VPS have high speed internet connections anyway. Note that this tutorial is for Linux based VPS systems only, windows based VPS likely already have a built in text editor… notepad.

Now after you’ve installed the Nano text editor you can run it by typing nano and the path/filename. For example:
“nano /var/log/maillog” and it’ll open the file named maillog in the var/log directory. If there is no such file there then it’ll open a new file in that location.

If you want to remove nano for whatever reason then enter:

– For Centos:
“yum remove nano”

– Ubuntu / Debian:
“sudo apt-get remove nano”

After you press enter the program will be removed from your server.