Skip to content

Instantly share code, notes, and snippets.

@OndrejValenta
Last active March 4, 2024 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OndrejValenta/ec9671db95e5794e64b4395cce684a8b to your computer and use it in GitHub Desktop.
Save OndrejValenta/ec9671db95e5794e64b4395cce684a8b to your computer and use it in GitHub Desktop.
Install Minio.io on RockyLinux

Install standards

Installs also firewalld !!

You can skip this step completely.

sudo dnf -y update sudo yum install -y epel-release sudo dnf install -y tar wget curl nano mc firewalld htop git

Prepare minio folder in /mnt/data

Pick your own folder.

mkdir /mnt/data/minio -p

Install minio server

groupadd -r minio-user
useradd -m -r -g minio-user minio-user
chown minio-user:minio-user /mnt/data/minio

mkdir /home/minio-user/.minio/certs -p

wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio-20231106222608.0.0.x86_64.rpm -O minio.rpm
dnf install minio.rpm -y

Install minio console

curl https://dl.min.io/client/mc/release/linux-amd64/mc \
  --create-dirs \
  -o $HOME/minio-binaries/mc

chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/

After install configuration

Update .bashrc

mco alias - to avoid collision with Midnight Commander

export PATH=$PATH:$HOME/minio-binaries/

alias mc=$HOME/minio-binaries/mc
alias mco=/usr/bin/mc

Refresh bash

source ~/.bashrc

For development purposes, download certgen to create self-signed SSL certificates - FIX TO YOUR IPs

wget https://github.com/minio/certgen/releases/latest/download/certgen-linux-amd64
chmod u+x certgen-linux-amd64
./certgen-linux-amd64 --host "127.0.0.1,localhost,192.168.1.5"

mv public.crt /home/minio-user/.minio/certs/
mv private.key /home/minio-user/.minio/certs/

Copy certificates to /home/minio-user/.minio/certs

Change owner of the certificates

chown minio-user:minio-user /home/minio-user/.minio/certs/*

Create configuration file

nano /etc/default/minio

Paste in the configuration file and update MINIO_SERVER_URL

# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment

MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=Password3000!!

# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.

MINIO_VOLUMES="/mnt/data/minio"

# MINIO_SERVER_URL sets the hostname of the local machine for use with the MinIO Server
# MinIO assumes your network control plane can correctly resolve this hostname to the local machine

# Uncomment the following line and replace the value with the correct hostname for the local machine and port for the MinIO server (9000 by default).

MINIO_SERVER_URL="https://192.168.1.5:9000"
MINIO_CONSOLE_ADDRESS="192.168.1.5:5555"

Start service and update it

Enable and start Minio service

systemctl enable --now minio.service

Update permissions for minio-user in `/usr/local/bin/minio

Updates are not possible without this step.

setfacl -R -m d:u:minio-user:rwx /usr/local/bin
setfacl -R -m u:minio-user:rwx /usr/local/bin

Create an alias in Minio Console

Use password from config file and replace your IP address

mc alias set minio https://192.168.1.5:9000 minioadmin

Update Minio service

mc admin update minio -y

Allow 5555/tcp and 9000/tcp in firewall.d

You can skip this step if you have different setup

Since firewalld is installed in [Install standards](#Install standards), we have to enable port 5555/tcp for the Minio console, and 9000/tcp for service endpoint

firewall-cmd --zone=public --add-port=5555/tcp --add-port=9000/tcp --permanent
firewall-cmd --reload

All done

Open Minio Console at https://192.168.1.5:5555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment