A private object storage with MinIO

0

In this short tutorial, we will show you how to set up your own object storage with MinIO. It’s short because there are really very few steps until the object storage can accept requests. So, if you don’t feel like sending heaps of your hard-earned coins to Amazon, Microsoft, and others, and have a bit of IT infrastructure at home, you can easily build your own S3-compatible object storage with MinIO.

But what exactly is object storage?

Object storage is a method of storing data that is particularly well-suited for large amounts of data, such as photos, videos, documents, and backups. Unlike traditional storage systems like file storage or block storage, object storage stores data in the form of objects.

Each object consists of three main components:

  1. Data: This is the actual content of the object, such as the text of a document or the pixels of an image.
  2. Metadata: These are additional data that contain information about the object. This can range from simple information like the creation date to custom data that further describes the content.
  3. A unique identifier: Each object receives a unique ID that can be used to identify and access it in the storage system.

A significant advantage of object storage is its scalability, as systems can reach sizes of petabytes and can scale even further. Additionally, the metadata allows for more flexible management and categorization of data.

Object storage is also very robust and reliable. Many systems replicate objects across multiple servers or even locations to prevent data loss and ensure high availability. This makes object storage ideal for cloud storage solutions and for businesses that need to store and manage large amounts of data efficiently. For our small tutorial here, we’ll skip the replication across additional servers.

MinIO Object Storage

MinIO differs from other object storage solutions through its simplicity and performance. It allows users to efficiently store and manage large amounts of unstructured data—such as photos, videos, and backups. MinIO is also known for its high performance and reliability, making it an excellent choice for businesses of all sizes.

One of the main advantages of MinIO is its user-friendliness and S3 compatibility. With a clear, web-based user interface, it allows even non-experts to use the platform effectively. Moreover, MinIO is highly scalable, meaning it can easily keep up with your business’s growth. Security is another important aspect of MinIO. With features like encryption and robust access controls, businesses can be sure their data is securely stored.

Installation on Ubuntu 22 or 24

Let’s assume we have a freshly installed Ubuntu system with some allocated storage space, and first, we’ll apply the latest updates:

sudo apt update
sudo apt upgrade -y

Next, we download the MinIO Debian file. This is easily done via wget:

wget https://dl.min.io/server/minio/release/linux-amd64/minio_20240922003343.0.0_amd64.deb

Now we can install MinIO using dpkg, which should be relatively quick:

sudo dpkg -i minio_20240922003343.0.0_amd64.deb

After that, we need a MinIO user and a corresponding group, which can be created with the following command:

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

Now we move on to creating a directory where the data will be stored, of course with the correct ownership:

sudo mkdir /usr/local/share/minio
sudo chown minio-user:minio-user /usr/local/share/minio

Using a small configuration file in /etc/minio, we can set the environment variables for MinIO. So, create the file and copy the content below. Be careful not to forget to enter your server IP or domain.

sudo mkdir /etc/minio
sudo chown minio-user:minio-user /etc/minio
sudo nano /etc/default/minio
MINIO_ACCESS_KEY="minio"
MINIO_VOLUMES="/usr/local/share/minio/"
MINIO_OPTS="-C /etc/minio --address "Your Server IP":9000"
MINIO_SECRET_KEY="miniostorage"

And off we go:

sudo systemctl start minio

That’s pretty much it. If you are using the server in production or want a bit more security, you can also secure the object storage using Let’s Encrypt.

Conclusion

In summary, MinIO is an excellent choice for businesses looking for a reliable, secure, and user-friendly object storage solution. With its strong performance, scalability, and compatibility with existing APIs, MinIO is a game changer in the world of data storage and management. The installation is also quite simple and done in no time.

Leave a Reply

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