MinIO has been a great alternative to services like S3 from AWS.
In this quick tutorial, you will learn how to install MinIO in a Rocky Linux (8 or 9) distribution from the scratch until the end.
Let’s Start.
First, let’s update your system packages.
sudo dnf update -y
And now, some necessary dependencies
sudo dnf install wget vim -y
Step 1 – Download using the wget command the latest available binary file for MinIO
Use the binary file for your architecture:
For amd64
wget https://dl.min.io/server/minio/release/linux-amd64/minio
For arm64
wget https://dl.min.io/server/minio/release/linux-arm64/minio
Once the binary for your architecture has been downloaded, copy it to /usr/local/bin/ and make it executable.
sudo cp minio /usr/local/bin/
sudo chmod +x /usr/local/bin/minio
Create a new directory to be used as MinIO storage.
sudo mkdir -p /data/minio
Create an environment file for MinIO as below.
sudo vim /etc/default/minio
Add info to the file
# Volume to be used for Minio server.
MINIO_VOLUMES="/data/minio/"
# Use if you want to run Minio on a custom port.
MINIO_OPTS="--address :9000 --console-address :9001"
# Root user
MINIO_ROOT_USER=admin
# Root secret
MINIO_ROOT_PASSWORD=admin
Create a System Service file for MinIO.
To be able to manage the MinIO storage server like any other systemd service, we need to create a system service file.
sudo useradd -s /sbin/nologin -d /minio minio
Set the required permissions:
sudo chmod 755 /usr/local/bin/minio
sudo chown minio:minio /usr/local/bin/minio
sudo chown minio:minio /etc/default/minio
Create the service file.
sudo vim /etc/systemd/system/minio.service
In the file, add the content below.
[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local/
User=minio
Group=minio
EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"
ExecStart=/usr/local/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
Save the file and reload system daemons.
sudo systemctl daemon-reload
Start and enable the MinIO service.
sudo systemctl enable minio.service
sudo systemctl start minio.service
Check the status of the service.
systemctl status minio.service
If you see “Active: active (running)”, the MinIo is running correctly.
Step 3 – Access the MinIO Storage Server Web Console.
The MinIO storage server web UI can be accessed using the URL http:// IP Address :9000/
That’s it!