Cyberithub

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux

Advertisements

In this article, we will see how to install and setup MinIO Object Storage on Ubuntu or Debian Linux. MinIO is a free and open source object storage solution compatible with Amazon S3 (Simple Storage Service) API and support all its core S3 features, thus making it easy to integrate into applications that already use AWS S3. MinIO is built for unstructured data storage, such as photos, videos, log files, backups, and container images, and is widely used for cloud-native applications. Even with larger volumes of data, it provides high throughput and low latency. It is high scalable and an ideal choice for handling large amount of data.

If you are worried about security then it provides end-to-end encryption for secure data transfer and storage. It is available in both free and commercial license. You can use either of them depending on your requirements. MinIO can be easily deployed in both private as well public cloud environment, bare metal infrastructure, orchestrated environments, and edge infrastructure. Check more on official website.

 

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux

Also Read: How to Install bunzip2 on Ubuntu or Debian Linux

Step 1: Prerequisites

a) You should have a running Ubuntu or Debian based Linux Server.

b) You should have sudo or root access to run privileged commands.

c) You should have wget and dpkg utility installed in your Server.

 

Step 2: Update Your Server

Before installing any new packages in your system, it is important to check for latest feature updates and bugfixes and install them by using sudo apt update && sudo apt upgrade command as shown below. This will keep your system stable and secure.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade

 

Step 3: Download MinIO Debian Package

You can visit MinIO official installation page and look for latest step to download debian package in your ubuntu or debian based linux system. As of yet, we see below wget command to download latest version of MinIO package as minio.deb in current working directory. To know more about wget utility, check What is wget and How to use wget command in Linux(20 Popular wget examples)

cyberithub@ubuntu:~$ wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20241107005220.0.0_amd64.deb -O minio.deb
--2024-11-29 02:26:46-- https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20241107005220.0.0_amd64.deb
Resolving dl.min.io (dl.min.io)... 138.68.11.125, 178.128.69.202
Connecting to dl.min.io (dl.min.io)|138.68.11.125|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 37426422 (36M) [application/vnd.debian.binary-package]
Saving to: ‘minio.deb’

minio.deb 100%[=================================================================>] 35.69M 2.42MB/s in 18s

2024-11-29 02:27:04 (2.03 MB/s) - ‘minio.deb’ saved [37426422/37426422]

 

Step 4: Install MinIO 

To install MinIO from downloaded debian package, run sudo dpkg -i minio.deb command as shown below. To know more about usage of dpkg utility, check 21+ Practical dpkg Command Examples for Linux Beginners

cyberithub@ubuntu:~$ sudo dpkg -i minio.deb
[sudo] password for cyberithub:
Selecting previously unselected package minio.
(Reading database ... 241336 files and directories currently installed.)
Preparing to unpack minio.deb ...
Unpacking minio (20241107005220.0.0) ...
Setting up minio (20241107005220.0.0) ...

 

Step 5: Launch MinIO

Before launching MinIO, you have to create a folder from where server can operate. Here we are creating a folder called minio under user's home directory using mkdir ~/minio command as shown below.

cyberithub@ubuntu:~$ mkdir ~/minio

Then launch minio server by using minio server ~/minio --console-address :9001 command as shown below.

cyberithub@ubuntu:~$ minio server ~/minio --console-address :9001
INFO: Formatting 1st pool, 1 set(s), 1 drives per set.
INFO: WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
MinIO Object Storage Server
Copyright: 2015-2024 MinIO, Inc.
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Version: RELEASE.2024-11-07T00-52-20Z (go1.23.3 linux/amd64)

API: http://192.168.0.105:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin

WebUI: http://192.168.0.105:9001 http://127.0.0.1:9001
RootUser: minioadmin
RootPass: minioadmin

CLI: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
$ mc alias set 'myminio' 'http://192.168.0.105:9000' 'minioadmin' 'minioadmin'

Docs: https://docs.min.io
WARN: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables

 

Step 6: Access MinIO Console 

To access MinIO console through GUI, go to your favorite web browser and open url http://127.0.0.1:9000 as shown below. If you have any firewall running on your system then make sure to allow Port 9000 through it or login page will not open.

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux 2

You will get credentials from output screen to login. After fresh installation, you will notice on output that user given is minioadmin and password is minioadmin. Provide these credential and click on Login.

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux 3

After successful login, you should see MinIO Console opened like below.

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux 4

 

Step 7: Create a Bucket(Using GUI)

You can create your first bucket by using both GUI as well as command line interface. Let's see how to create using GUI Interface. Under Buckets, you will see an option to Create a Bucket as shown below. Click on it on proceed.

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux 5

As you notice, below page will be opened where you have to provide your bucket name and then select the features you would like to enable or disable. In our case, we are providing bucket name as velero-cyberithub. Once done, click on Create Bucket.

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux 6

You would notice that a bucket with name velero-cyberithub getting created successfully as shown below.

How to Install and Setup MinIO Object Storage on Ubuntu or Debian Linux 7

 

Step 8: Install MinIO Client(Optional)

This is an optional step for those who would like to work on MinIO server through command line rather than through GUI. For this, you have to install MinIO client tool called mc on your system by downloading it first using below wget command.

cyberithub@ubuntu:~$ wget https://dl.min.io/client/mc/release/linux-amd64/mc
--2024-11-29 03:18:26-- https://dl.min.io/client/mc/release/linux-amd64/mc
Resolving dl.min.io (dl.min.io)... 138.68.11.125, 178.128.69.202
Connecting to dl.min.io (dl.min.io)|138.68.11.125|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27996312 (27M) [application/octet-stream]
Saving to: ‘mc’

mc 100%[=================================================================>] 26.70M 2.07MB/s in 14s

2024-11-29 03:18:40 (1.96 MB/s) - ‘mc’ saved [27996312/27996312]

Provide execute permission to this tool by using chmod +x mc command as shown below.

cyberithub@ubuntu:~$ chmod +x mc

Then move this utility to any of the location mentioned in global PATH environment variable such as /usr/local/bin.

cyberithub@ubuntu:~$ sudo mv mc /usr/local/bin/mc
[sudo] password for cyberithub:

Once it is moved, you can check its functionality by running mc --version command as shown below.

cyberithub@ubuntu:~$ mc --version
mc version RELEASE.2024-11-17T19-35-25Z (commit-id=bb4ff4951a3e54bbee6ac75cfaf387c521e98709)
Runtime: go1.23.3 linux/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>

This confirms that client tool is working as expected.

 

Step 9: Configure MinIO Client

To enable mc client interaction with MinIO server, you have to setup an alias for the server running at http://127.0.0.1:9000 using access key and secret key. For example, here we are setting up an alias called local for the MinIO server running at http://127.0.0.1:9000 using access key minioadmin and secret key minioadmin by running mc alias set local http://127.0.0.1:9000 minioadmin minioadmin command as shown below.

cyberithub@ubuntu:~$ mc alias set local http://127.0.0.1:9000 minioadmin minioadmin
mc: Configuration written to `/home/cyberithub/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/home/cyberithub/.mc/share`.
mc: Initialized share uploads `/home/cyberithub/.mc/share/uploads.json` file.
mc: Initialized share downloads `/home/cyberithub/.mc/share/downloads.json` file.
Added `local` successfully.

 

Step 10: Check info about an alias

After adding an alias, you can check information about this using mc admin info <alias> command. Since we created an alias called local, to check information about this alias, run mc admin info local command as shown below.

cyberithub@ubuntu:~$ mc admin info local
● 127.0.0.1:9000
  Uptime: 1 hour
  Version: 2024-11-07T00:52:20Z
  Network: 1/1 OK
  Drives: 1/1 OK
  Pool: 1

┌──────┬───────────────────────┬─────────────────────┬──────────────┐
│ Pool │ Drives Usage          │ Erasure stripe size │ Erasure sets │
│ 1st  │ 21.5% (total: 92 GiB) │          1          │      1       │
└──────┴───────────────────────┴─────────────────────┴──────────────┘

0 B Used, 1 Bucket, 0 Objects
1 drive online, 0 drives offline, EC:0

 

Step 11: Remove an alias

You can also remove an alias using mc alias remove <alias> command. For example, to remove alias local, you have to use mc alias remove local command as shown below.

cyberithub@ubuntu:~$ mc alias remove local
Removed `local` successfully.

 

Step 12: Create a Bucket(Using terminal)

We have seen earlier how to create a bucket using graphical user interface. Now let's see how to create a bucket using command line. To create a bucket in MinIO configured with an alias, use mc mb <alias>/<bucket-name> command. For example, in our case we would like to create a bucket called velero-cyberithub in MinIO server which is configured with an alias called local. To do this, run mc mb local/velero-cyberithub command as shown below.

cyberithub@ubuntu:~$ mc mb local/velero-cyberithub
Bucket created successfully `local/velero-cyberithub`.

 

Step 13: Remove a Bucket

Before removing a bucket, you have to make sure there are no contents in it. It is simply because MinIO does not allow us to remove bucket unless it is empty. To check the list of contents in bucket, use mc ls <alias>/<bucket_name> command. For example, in our case to check the contents in velero-cyberithub, run mc ls local/velero-cyberithub command as shown below.

cyberithub@ubuntu:~$ mc ls local/velero-cyberithub

If you find contents in your bucket, then to remove and empty the bucket run mc rm --recursive --force <alias>/<bucket_name> command. For example, in our case to remove all contents in bucket velero-cyberithub in MinIO server configured with alias local, run mc rm --recursive --force local/velero-cyberithub command as shown below.

cyberithub@ubuntu:~$ mc rm --recursive --force local/velero-cyberithub

Once the bucket is empty, you can remove it by using mc rb local/velero-cyberithub command as shown below.

cyberithub@ubuntu:~$ mc rb local/velero-cyberithub
Removed `local/velero-cyberithub` successfully.

Leave a Comment