Configuring and Using MinIO Object Storage Service in ServBay
MinIO is a high-performance, open-source object storage server compatible with the Amazon S3 API. It's an excellent solution for simulating cloud storage services in a local development environment, suitable for storing and managing unstructured data such as images, videos, log files, backups, and container images. With ServBay, you can easily deploy and manage a local MinIO instance on macOS.
Overview
ServBay offers one-click installation and a graphical configuration interface for MinIO, greatly simplifying the process of setting up S3-compatible storage locally. Developers can quickly have a fully featured object storage service for application development and testing, without dealing with complex command-line installation and configuration.
More importantly, ServBay automatically configures a secure and easily accessible web console for your MinIO instance at https://minio.servbay.host/
.
Prerequisites
- ServBay must already be installed and running on your macOS system.
- You should have a basic understanding of object storage concepts (such as Buckets and Objects).
Steps
1. Install the MinIO Package
First, you need to install MinIO in ServBay:
- Open the ServBay application.
- In the left navigation panel, click Packages.
- Find
Object Storage
-MinIO
in the package list. - Click the install button next to
MinIO
and wait for the installation to complete. - Click the enable button to start the
MinIO
service.
2. Configure the MinIO Service
After installation, you'll need to perform initial configuration for MinIO:
In the ServBay left navigation panel, click Object Storage.
From the dropdown menu, select MinIO to enter the configuration interface.
You will see the following configuration options, which can be modified as needed or left at their default values:
- Bind IP: The IP address that MinIO will listen on. The default
127.0.0.1
means the service is only accessible from the local machine, which is the safest and recommended setup for local development. - API Port: The communication port for the S3 API. Your application will interact with MinIO through this port. The default value is
9000
. - Root user: The administrator account username for MinIO. Default is
minio
. - Root password: The password for the administrator account. It is strongly recommended that you set a complex and unique password, and keep it safe. This is crucial for accessing and managing all your stored data.
- Data Path: The local filesystem path where MinIO stores all objects and metadata. The default path is
/Applications/ServBay/data/minio
. You can click the folder icon on the right to quickly open this directory in Finder.
- Bind IP: The IP address that MinIO will listen on. The default
3. Save Configuration and Start the Service
- After completing all configuration, click the Save button in the lower right corner.
- If everything is set up correctly, the service status indicator will turn green, indicating that MinIO is running successfully.
4. Access the MinIO Web Console
One of the greatest conveniences provided by ServBay is that it automatically configures the MinIO web management console for you:
Method 1: In the upper right corner of the MinIO configuration screen, click the browser icon (which looks like a compass). ServBay will automatically open the MinIO console in your default web browser.
Method 2: Manually enter
https://minio.servbay.host/
in your browser.Log in using the
Root user
andRoot password
you set up in Step 2.
After logging in, you can use this intuitive web interface to create buckets, upload and manage files (objects), set access policies, and more.
5. Using MinIO in Your Application
Your application (such as PHP, Node.js, Python, etc.) can connect to the MinIO instance in ServBay using any S3-compatible SDK. You will need the following key information for the connection:
- Endpoint:
http://127.0.0.1:9000
- Access Key ID: Your configured
Root user
(for example,minio
) - Secret Access Key: Your configured
Root password
- Use path style endpoint: It is highly recommended to set this to
true
.
PHP Code Example (Using AWS SDK for PHP)
First, install the SDK:
bash
composer require aws/aws-sdk-php
1
Then configure and use the S3 client in your code:
php
<?php
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\Exception\AwsException;
$s3Client = new S3Client([
'profile' => 'default',
'version' => 'latest',
'region' => 'us-east-1', // For MinIO, region can be any valid string
'endpoint' => 'http://127.0.0.1:9000',
'use_path_style_endpoint' => true,
'credentials' => [
'key' => 'minio', // Your Root user
'secret' => 'your-strong-password', // Your Root password
],
]);
try {
$buckets = $s3Client->listBuckets();
foreach ($buckets['Buckets'] as $bucket) {
echo $bucket['Name'] . "\n";
}
} catch (AwsException $e) {
// Output exception information
echo "Error: " . $e->getMessage() . "\n";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Frequently Asked Questions (FAQ)
- Q: I forgot the Root password for MinIO. How do I reset it?
- A: It's very easy to reset your password in ServBay. Simply enter a new password in the MinIO configuration interface, click Save, and then restart the MinIO service. ServBay will automatically update the configuration file for you.
- Q: The MinIO service failed to start. What should I do?
- A: Please check the following:
- Click the logs icon in the upper right of the MinIO configuration screen to view specific error details.
- Ensure that port
9000
is not being used by another application. - Verify that the specified
Data Path
exists and ServBay has permission to read and write to the directory.
- A: Please check the following:
- Q: Can I change MinIO's API port?
- A: Yes. Modify the
API Port
field in the MinIO configuration screen in ServBay, save, and restart the service. Make sure your application is updated to use the new port as well.
- A: Yes. Modify the
Summary
With ServBay, setting up and running a local MinIO object storage instance on macOS is easier than ever. This brings tremendous convenience to local application development and testing requiring S3-compatible storage, allowing developers to focus on business logic without spending excessive time on environment configuration.