Installing MinIO to the budget model Synology NAS

Problem

For the budget models, Synology NAS (DS218j, etc.) is absent official/unofficial packages for installing MinIO service, and one option for installing MinIO on these devices is hand installing across SSH connection.

After upgrading firmware, need reinstallation.

1. Enabling SSH

Control Panel -> Terminal & SNMP -> checked “Enable SSH service” -> Apply

2. Connect to the NAS over SSH

ssh ADMIN_USER@NAS_IP

ADMIN USER - Local user with administrative privileges, a generally first user registered at installing NAS

3. Download the MinIO from the official site

The model Synology NAS DS218j is based on the ARM architecture Marvell Armada 385 88F682 processor.

cd /tmp
wget https://dl.min.io/server/minio/release/linux-arm/minio

set flag on the file and copy to /usr/bin

chmod +x minio
mv minio /usr/bin/

4. Create the config file

Create a new config file. Recommended choose a path on the persistent storage /volume{1-9999}, otherwise, you will lose your configs when you update the Firmware

cat <<EOT > /volume1/minio_environments
# Volume to be used for MinIO server.
MINIO_VOLUMES="/volume1/minio"
# Use if you want to run MinIO on a custom port.
MINIO_OPTS="--address :9000 --console-address :9001"
# Root user for the server (MINIO_ACCESS_KEY is deprecated).
MINIO_ROOT_USER="YOU_MINIO_USER_MINIO"
# Root secret for the server (MINIO_SECRET_KEY is deprecated).
MINIO_ROOT_PASSWORD="YOU_PASSWORD_FOR_MINIO_USER"
EOT

MINIO_VOLUMES - set path to you directory for store MinIO files To this file you can add additional options/environment variables for MinIO

5. Add the new Service to Systemd

cat <<\EOT > /etc/systemd/system/minio.service
[Unit]
Description=MinIO
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/bin/minio

[Service]
WorkingDirectory="${MINIO_VOLUMES}"

User={{{ YOU_USER }}}
Group={{{ YOU_USER_GROUP }}}

EnvironmentFile=/volume1/minio_environments
ExecStartPre=/bin/bash -c "if [ -z "${MINIO_VOLUMES}" ]; then echo \"Variable MINIO_VOLUMES not set in /volume1/minio_environments\"; exit 1; fi"

ExecStart=/usr/bin/minio server $MINIO_OPTS $MINIO_VOLUMES

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
EOT

{{{ YOU_USER }}} and {{{ YOU_USER_GROUP }}} replace with your system user and the group on behalf of which the daemon will run, this user needs access to the MinIO data store dir MINIO_VOLUMES env in the configuration file from step 4

6. Enable service

systemctl daemon-reload && systemctl enable minio && systemctl start minio

7. Test

You need use mcli or WEB interface on the port nas_ip:9001

{
    "version": "10",
	"aliases": {
		"nas": {
			"url": "http://YOU_NAS_IP:9000",
			"accessKey": "YOU_USER",
			"secretKey": "YOU_USER_PASSWORD",
			"api": "s3v4",
			"path": "auto"
		}
	}
}