Install nano with Entware on Synology NAS (DSM6+)

I don't want to use VIM to edit files on my Synology NAS. I have no clue why the good people of Synology forgot to put the nano editor on the machine. There is no package manager nor a C compiler present on the system... so let's fix that by installing the Entware package manager.

These scripts only work on DSM 6+. I'm assuming that you already have a working SSH terminal to your NAS. If you break stuff, you are on your own. A lot of the scripts will run as root.

Nano as a package

When you only need Nano (and don't want to install Entware), you could install it as a SynoCommunity package.

  1. Open Package Center.
  2. Open Settings.
  3. Go to Package Sources.
  4. Click Add button.
  5. Name: SynoCommunity, location:
  6. Click OK button
  7. Type nano into the search bar and install the SynoCli File Tools. It contains the following tools: less, tree, ncdu, jdupes, fdupes, rhash, mc (midnight commander), nano, file, detox, pcre2, zstd, lzip, plzip, rmlint, rnm, micro (editor), fzf (fuzzy finder).

It is easier than installing all the scripts.

Nano is available in the Package Center as SynoCommunity Package. It is now part of the SynoCli File Tools.


Entware needs to land somewhere, this will create the right directory:

# create a home for Entware
mkdir -p /volume1/@Entware/opt
# go on as root
sudo -i
# remove a previous install
rm -rf /opt
# link the folders
ln -sf /volume1/@Entware/opt /opt
echo "Done!"

Determine architecture

Run the following script to discover your processor and architecture:

printf "\nProcessor:   "; \
cat /proc/cpuinfo | \
grep "model name" | \
grep "[^:]*$" -o  | \
uniq; \
printf "Architecture: "; \
uname -m; \
printf "\n"

I'm using a DS218+, so the script shows that the processor is an Intel(R) Celeron(R) CPU J3355 @ 2.00GHz and the architecture is x86_64 - something I would expect with this processor. (My Raspberry Pi 3 returns ARMv7 Processor rev 4 (v7l) / armv7l)

Install Entware by script

Now that you have the architecture figured out, you know what script you'll need to run. These script need to run as root.

  • armv5: wget -O - | /bin/sh
  • armv7: wget -O - | /bin/sh
  • armv8: wget -O - | /bin/sh
  • x64: wget -O - | /bin/sh

If you install the wrong link, don't worry. Just run the previous step and the right script.

Start Entware at startup

Let's write the startup file using a script. This startup file is only for DS6+ installations.

# leave root
# remove previous file
rm 2> /dev/null
# write the startup file
printf "#!" >>
echo "/bin/sh" >>
echo "" >>
echo "case $1 in" >>
echo "    start)" >>
echo "    mkdir -p /opt" >>
echo "    mount -o bind /volume1/@Entware/opt /opt" >>
echo "    /opt/etc/init.d/rc.unslung start" >>
echo "    ;;" >>
echo "    stop)" >>
echo "    ;;" >>
echo "esac" >>
# copy the startup file
sudo mv /usr/local/etc/rc.d/
echo "Done!"

Add to profile and reboot

Before we are done, we need to add some stuff to the profile. This makes sure the package manager is part of your PATH when you use the terminal. We will also reboot the machine.

sudo -i
echo "" >> /etc/profile;
echo ". /opt/etc/profile" >> /etc/profile

And finally... it's installation time!

Now we can install all the packages we want. Let's install nano:

sudo opkg install nano

Easy peasy!


2021-03-27 Updated the name of the package, as nano is now part of the SynoCli File Tools package.

  1. crouchpotato says:

    Very very helpful, thanks Kees! Finally free of the VI shackles ;)

  2. Arkadiusz Sworobowicz says:

    Thanks a lot for hints :)

  3. toudidel says:

    works like a charm. thanks a lot

  4. Cristian Rodríguez Gutiérrez says:

    Muchas gracias, me ha funcionado.