How to install nano on FreeBSD O.S.


So here goes, firstly make sure your logged into the server as ‘root’ then make sure your ports tree is up to date like so:

portsnap fetch update

If you don’t have the ports tree installed on your server (maybe you are using an Amazon cloud image etc. or simply did not install the ports tree during the set-up process). you’ll need  to install the ports tree like so:

portsnap fetch extract update

If you are unsure if you do or don’t have the ports tree installed just try this command:

cd /usr/ports

If the above doesn’t work (ie. the folder doesn’t exsits then this means you don’t appear to have the ports installed… therefore run the above command to download and extract so we can continue on with this tutorial)

Now we are ready to actually install (compile) Nano on our FreeBSD server, we do it like so:

cd /usr/ports/editors/nano

make install clean

ln -s /usr/local/bin/nano /usr/bin/nano

Now you should be able to use Nano  🙂 . If when you execute the command:


doesn’t work, then type:


Then try again, this is because you are using ‘csh’ which requires you to reload the list of binarys available to execute from /usr/bin/X… Alternatively just logout and back in again and you should then have ‘nano’ fully added into the environmental variables path.

If you wanted too, you can also set Nano as the servers default text editor, to do this, whilst being logged in as ‘root’, run this command (assuming you use the Corn Shell which is the default on FreeBSD as opposed to bash,sh etc.):

nano .cshrc

Then change this line:

setenv  EDITOR ee


setenv  EDITOR nano

Save the changes (CTRL+O) and logout of your session and back in again, now running:

crontab -e

will now open and enable you to edit your crontab entries using Nano instead of ee.

Leave A Reply