Linux

How to Install and Configure MinIO on Ubuntu

How to Install and Configure MinIO on Ubuntu

MinIO is an open-source object storage server compatible with Amazon S3, designed for large-scale data infrastructure. It allows users to manage unstructured data such as photos, videos, log files, backups, and container images. Its lightweight, high-performance architecture makes it ideal for use in cloud, edge, and on-premise environments. This guide will walk you through installing and configuring MinIO on an Ubuntu server.

Prerequisites
Before you begin, ensure you have the following:

  • Ubuntu 18.04 or later installed.
  • A user with sudo privileges.
  • At least 4 GB of RAM (recommended for production environments).
  • A static IP address or DNS configured for your server.

Step 1: Update the System
Before installing any new software, it’s good practice to update the system’s package list to ensure you have the latest versions of all packages.

sudo apt update && sudo apt upgrade -y

Step 2: Install MinIO Server
MinIO can be installed on your Ubuntu machine using a binary file. Follow the steps below:

Download the MinIO binary:

First, you need to download the latest MinIO binary from the official MinIO releases.

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

Make the binary executable:

Once downloaded, make the binary executable using the following command:

chmod +x minio

Move the MinIO binary to a system path:

Move the binary to /usr/local/bin so that it can be accessed from anywhere.

sudo mv minio /usr/local/bin/

Verify the installation:

To confirm MinIO has been installed correctly, check the version:

minio –version

You should see output confirming the MinIO version installed.

Step 3: Create Directories for Data and Configuration
Before starting MinIO, you need to set up directories to store data and configuration files.

Create a directory for MinIO data:

Choose a location for your data directory. For example:

sudo mkdir /mnt/data

Set proper permissions:

Make sure the user running MinIO has access to the data directory:

sudo chown -R $USER:$USER /mnt/data

Step 4: Run MinIO as a Systemd Service
Running MinIO as a system service ensures that it starts automatically when your server boots up. To do this, you’ll need to create a Systemd unit file.

Create the Systemd service file:

Use the following command to create a service file for MinIO:

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

Add the following content to the file:

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

[Service]
User=minio-user
Group=minio-user
ExecStart=/usr/local/bin/minio server /mnt/data
Restart=on-failure
RestartSec=5
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Create the MinIO user:

It’s good practice to create a dedicated user to run MinIO. Run the following commands:

sudo useradd -r minio-user -s /sbin/nologin
sudo chown -R minio-user:minio-user /mnt/data

Reload the systemd daemon:

After creating the service file, reload the systemd daemon to recognize the new service.

sudo systemctl daemon-reload

Enable and start the MinIO service:

Enable the service to start on boot and start the MinIO server:

sudo systemctl enable minio
sudo systemctl start minio

Check the status of the MinIO service:

To ensure the service is running correctly, use the command:

sudo systemctl status minio

Step 5: Configure Firewall
By default, MinIO listens on port 9000. To access the MinIO dashboard or API, you need to open this port on your server’s firewall.

Open port 9000:

Use the following command to allow traffic on port 9000:

sudo ufw allow 9000

Verify the firewall status:

Check the firewall status to confirm the changes:

sudo ufw status

Step 6: Access MinIO Web Interface
Once the service is up and running, you can access the MinIO web interface.

Open your browser and navigate to:

http://:9000

Login with default credentials:

The MinIO service will generate access and secret keys when it first starts. You can find these in the MinIO logs by running:

sudo journalctl -u minio

Use the access key and secret key provided to log in to the web interface.

Step 7: Secure MinIO with Let’s Encrypt SSL (Optional)
To secure your MinIO instance, you can use Let’s Encrypt to enable HTTPS.

Install Certbot:

Certbot is a tool that automatically handles SSL certificates for Let’s Encrypt.

sudo apt install certbot

Obtain a certificate:

Run the following command to generate a certificate for your domain:

sudo certbot certonly –standalone -d your-domain.com

Configure MinIO for HTTPS:

After obtaining the certificate, modify the MinIO service file to use it:

ExecStart=/usr/local/bin/minio server –address “:443” –certs-dir /etc/letsencrypt/live/your-domain.com /mnt/data

Restart the MinIO service:

Apply the changes by restarting MinIO:

sudo systemctl restart minio

You can now access MinIO securely via HTTPS.

We appreciate your visit to our page! If you’re interested in exploring more articles on Linux systems and GitKraken, feel free to check out the links below.

How to Install and Use GitKraken on Ubuntu 

Furthermore, by renting a server from our site, you can conduct your tests freely in a reliable and efficient environment, allowing you to enhance your skills more quickly. Great job! 🙂

Germany Location Virtual Dedicated Server

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button