Prerequisites
Each node runs a supported Linux distribution, and you have SSH access with appropriate privileges. The examples use four machines with IP addresses 192.168.8.171, 192.168.8.19, 192.168.8.179, and 192.168.8.168.
1. Create the MinIO System User and Data Directory
On every server, prepare a dedicated user and storage location:
sudo groupadd -r minio
sudo useradd -r -g minio -s /sbin/nologin -d /opt/minio minio
sudo mkdir -p /data/minio
sudo chown minio:minio /data/minio
2. Install the MinIO Binary
Download the official release and make it executable:
sudo wget -O /usr/local/bin/minio https://dl.min.io/server/minio/release/linux-amd64/minio
sudo chmod +x /usr/local/bin/minio
sudo chown minio:minio /usr/local/bin/minio
3. Define Environment Variables
Store credentials and cluster configuration in a dedicated file:
sudo mkdir -p /etc/minio
sudo tee /etc/minio/env <<EOF
# MinIO cluster identifiers
MINIO_ROOT_USER="accessKeyAdmin"
MINIO_ROOT_PASSWORD="ChangeMe123!"
# Node endpoint list
MINIO_VOLUMES="http://192.168.8.171/data/minio http://192.168.8.19/data/minio http://192.168.8.179/data/minio http://192.168.8.168/data/minio"
# Network bindings
MINIO_OPTS="--address :9000 --console-address :9001"
EOF
sudo chown minio:minio /etc/minio/env
sudo chmod 600 /etc/minio/env
4. Create the systemd Unit
Write a service unit that reads the environment file and runs MinIO directly:
sudo tee /etc/systemd/system/minio.service <<'EOF'
[Unit]
Description=MinIO Object Storage
Documentation=https://docs.min.io
After=network.target
[Service]
User=minio
Group=minio
EnvironmentFile=/etc/minio/env
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
Reload systemd and enable the service permanently:
sudo systemctl daemon-reload
sudo systemctl enable minio.service
5. Start and Verify the Cluster
Launch the service on each node and confirm it runs without errors:
sudo systemctl start minio.service
sudo systemctl status minio.service
Check the cluster logs for any startup issues:
sudo journalctl -u minio.service -f
Once all four nodes are online, access the web console at http://<any-node-ip>:9001 using the credentials set in /etc/minio/env. The distributed cluster is now ready for productino workloads.