Installing MinIO on CentOS Stream 9: Build Your Own S3 Storage with SELinux and Firewalld

CentOS tutorial - IT technology blog
CentOS tutorial - IT technology blog

The Problem: Why Build Your Own Object Storage When AWS S3 Exists?

Cloud storage costs like AWS S3 or Google Cloud Storage might seem cheap at first, but when your data reaches dozens of Terabytes and egress bandwidth increases, the monthly bill can be a shock. Moreover, for businesses in Vietnam, storing sensitive data on foreign servers sometimes violates data sovereignty regulations.

The best solution is to build an Object Storage system that is fully compatible with the S3 API. MinIO has emerged as a top candidate due to its high performance and flexible scalability. However, installing MinIO on a security-strict OS like CentOS Stream 9 isn’t just about running a single command. If you don’t handle SELinux and Firewalld correctly, you’ll constantly face ‘Permission Denied’ errors or be unable to access the Dashboard from outside.

When I was working on a project for a financial firm, they required that data absolutely never leave their on-premise infrastructure. At that point, AWS S3 was out of the question. I had to set up a MinIO cluster on CentOS Stream, and it has been running smoothly ever since. Here is the standard process I’ve refined.

Step 1: Prepare the Environment and System User

To ensure security, we never run MinIO as root. The first step is to create a separate user and prepare the data storage directory.

# Update the system
sudo dnf update -y

# Create a system user for MinIO
sudo useradd -r minio-user -s /sbin/nologin

# Create data and configuration directories
sudo mkdir -p /mnt/data /etc/minio
sudo chown minio-user:minio-user /mnt/data /etc/minio

Step 2: Download and Install the MinIO Binary

Instead of using complex distributions, I prefer using the binary directly from the MinIO website for easier version control.

Share: