MinIO is an open-source distributed storage facility that provides high performance in storing unstructured type data like AWS S3. One can compare this with AWS S3 but there are some differences. It is built considering private cloud as target and it is perfectly compatible with S3 APIs as well.
Like AWS S3 it also an object storage which stores unstructured data (files, images, videos, log file, etc) and it also has buckets. To interact with MinIO buckets HTTP methods are used like PUT to store data, GET to access, and DELETE to remove data. We can use different ways to deploy MinIO on a server. There is GUI to manage buckets and data through a browser.
Here we will learn some different methods to setup MinIO on a server.
Method 1. Setup on Linux server.
Step 1. Download the MinIO Server Package
$ wget https://dl.minio.io/server/minio/release/linux-amd64/minio
Step 2. Make the File Executable
$ chmod +x minion
Step 3. Start the Minio Server
$ sudo ./minio server /minio
Note: We can change the default Access key and Secret key we want by mention in the MinIO configuration file.
Step 4. Access the MinIO GUI at 9000 Default Port
Enter the access and secret key retrieved in previous step and login in GUI.
Step 5. Now Create Buckets and Upload Files From GUI
Click on PLUS (+) icon at bottom right to create buckets.
Method 2. Deploy on Docker.
Step 1. Run the MinIO Container Simply
$ docker run -p 9000:9000 \ -e "MINIO_ACCESS_KEY=<Any Access key>" \ -e "MINIO_SECRET_KEY=<Any secret key>" \ minio/minio server /data
Step 2. Access the GUI.
Use the Access and Secret keys provided in previous step and login in MinIO GUI and start using it.
Note: To attach a persistent volume just add -v path-to-directory:/data
Method 3. Deploy on Kubernetes.
The Simplest way to deploy MinIO in Kubernetes cluster is using helm chart.
Step 1. Make Sure Helm is Installed in cluster.
Install helm if not installed already.
Step 2. Deploy MinIO From Helm Chart
$ helm install --set accessKey=myaccesskey,secretKey=mysecretkey \ stable/minio
Step 3. Access MinIO from a Browser.
We are using port forwarding for simple demo. (You can use a service like nodeport)
$ kubectl get pod
Get the name of MinIO pod and forward the port to 9000.
$ kubectl port-forward <POD_NAME> 9000 --namespace default
Step 4. Access Minio on Port 9000.
You can modify and change various configuration before or after deployment. For that please refer to the official GitHub repository here.
There is a MinIO Client (Command Line Interface) which can be handy for automation. We can use the various command for MinIO Client “mc” to control and manage MinIO.
MinIO Client Installation
Step 1. Download MinIO Client Package on the server.
$ wget https://dl.minio.io/client/mc/release/linux-amd64/mc
Step 2. Make the file executable
$ chmod +x mc
You can also move the file to /usr/local/bin/ access it anywhere on server.
Check different options and flags by
$ ./mc help
Step 3. Configure the MinIO Client With MinIO
$ ./mc config host add minio http://127.0.0.1:9000 Your_Access_key YourSecret_key
Some basic commands to:
create a bucket
$ ./mc mb <server-Name>/<bucket-Name>
list all buckets
$ ./mc ls <server-name>
cat a file
$ ./mc cat <server-Name>/<bucket-Name>/<file-Name>
We have learnt different methods to deploy and install MinIO on different platforms. These are the simplest way to start with MinIO on different platforms.