How to Build Your Own S3-Compatible Object Storage with MinIO on Ubuntu 24.04

 


While storing data in public cloud object storage is relatively inexpensive, data transfer, cross-region traffic, and internet egress charges can become a massive burden as workloads grow. With the continuous rise of AI datasets, LLM training, RAG pipelines, and Kubernetes clusters in 2026, many organizations are realizing the cost-efficiency of moving their large datasets back to private infrastructure.

The ultimate solution? Self-hosted Object Storage.

By running MinIO on a dedicated server, you get full Amazon S3-compatible API support for the vast majority of applications—without the unpredictable cloud egress fees.

In this step-by-step guide, we will walk you through deploying a secure MinIO server on Ubuntu 24.04 that provides a solid foundation for production deployments.

Prerequisites

Before starting your installation, ensure you have the following:

  • A Linux storage server running Ubuntu 24.04.

  • Root or sudo privileges on the server.

  • A registered domain name (optional, but recommended for production HTTPS).

Update your system first to ensure all packages are up to date:

Bash sudo apt update && sudo apt upgrade -y

Step 1: Download and Install MinIO

MinIO is shipped as a single binary, making the installation process incredibly simple. Download the latest 64-bit Linux executable:

Bashwget https://dl.min.io/server/minio/release/linux-amd64/minio

Make the downloaded file executable and move it to your system’s binaries directory:

Bashchmod +x minio
sudo mv minio /usr/local/bin/

Step 2: Create a Secure User and Directory

Running services as the root user is a major security risk. We will create a dedicated system user with no login privileges, along with a directory for your data.

Bash

sudo groupadd -r minio-user sudo useradd -r -s /usr/sbin/nologin -g minio-user minio-user

Create the data directory (e.g., /mnt/data) and set the correct permissions:

Bashsudo mkdir -p /mnt/data
sudo chown -R minio-user:minio-user /mnt/data
sudo chmod 750 /mnt/data

Step 3: Configure the UFW Firewall

MinIO uses port 9000 for the S3-compatible API and port 9001 for the Web Console. If you are using UFW (Uncomplicated Firewall), allow these ports before starting the service:


Bashsudo ufw allow 9000/tcp
sudo ufw allow 9001/tcp
sudo ufw reload

Step 4: Create the Systemd Service

To manage MinIO like a standard background service, create a systemd configuration file:

Bashsudo nano /etc/systemd/system/minio.service

Paste the following configuration into the file.

Security Warning: Replace the MINIO_ROOT_PASSWORD with a long, random password generated by a password manager. Do not use default or weak passwords!

Ini, TOML[Unit]
Description=MinIO High Performance Object Storage
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target

[Service]
User=minio-user
Group=minio-user
WorkingDirectory=/mnt/data

# Environment Variables for easy configuration
Environment="MINIO_VOLUMES=/mnt/data"
Environment="MINIO_OPTS=--console-address :9001"
Environment="MINIO_ROOT_USER=admin"
Environment="MINIO_ROOT_PASSWORD=ReplaceWithYourSecurePassword!"

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

Restart=always
RestartSec=5

# Security restrictions
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

Step 5: Start and Verify the Service

Reload systemd to detect the new service, then start and enable MinIO to launch on boot:

Bashsudo systemctl daemon-reload
sudo systemctl start minio
sudo systemctl enable minio

Check if the service is running without errors:

Bashsudo systemctl status minio

To confirm that MinIO is actively listening on the correct ports (9000 and 9001), run:

Bashsudo ss -tulpn | grep minio

Step 6: Access the MinIO Console & Set Policies

  1. Open your web browser and navigate to: http://YOUR_SERVER_IP:9001
  2. Log in with your configured Root User and Password.
  3. Navigate to Buckets -> Create a Bucket.
  4. Access Control: By default, buckets are Private. In the console, you can configure Anonymous Rules (for public read access) or generate Access Keys (for your applications to connect securely).


Step 7: Install the MinIO Client (mc)

For command-line management, the MinIO Client (mc) is an essential tool. It functions as a modern alternative to UNIX commands like ls, cat, and cp.

Install it using:

Bashwget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo mv mc /usr/local/bin/

Connect mc to your new local MinIO server:

Bashmc alias set local_s3 http://127.0.0.1:9000 admin ReplaceWithYourSecurePassword!

Now you can list your buckets or create a new one directly from the terminal:

Bashmc ls local_s3
mc mb local_s3/my-new-bucket

Production and Security Best Practices

If you are using this MinIO setup for production data, please implement the following:

  • Enable HTTPS (SSL): Never send API requests in plain text over the public internet. Use a reverse proxy like Nginx, Caddy, or Traefik with a free Let's Encrypt SSL certificate. 
  •  Remember, MinIO is Not a Backup: If your server's single hard drive fails, your data dies. Ensure you have proper backup strategies in place. 
  •  High Availability: For enterprise workloads, consider deploying MinIO in a distributed cluster across multiple drives (RAID) or multiple servers to ensure fault tolerance and data redundancy.


Ready to host your own data? If you need reliable, high-performance infrastructure to run your MinIO object storage, visit Servers99. We provide premium dedicated servers that can handle your heaviest AI and database workloads with zero unexpected egress fees!

Comments

Popular posts from this blog

VPS vs. Dedicated Servers: A Performance Analysis for Growing Businesses

Still on Shared Hosting in 2025? Why Your Australian Business is Hitting a Wall.

Why Every Digital Business Targeting Europe Should Host in Germany