How to Deploy MinIO - An Opensource Object Storage Solution
Introduction
MinIO is an open-source high-performance object storage solution that provides an S3-compatible API to manage and share files as objects on a server. MinIO uses a server and console architecture to support multiple access methods using the web-based file management interface, mc
utility, and S3-compatible client tools such as S3 Browser, Cyberduck, s3cmd
, among others.
This article explains how to deploy MinIO on Ubuntu 22.04 to share and manage files on the server. You will install and configure the MinIO server to use a Single Node Single Drive
architecture. Then, configure the application to use Vultr Block Storage to store files on the server.
Prerequisites
Before you begin:
Deploy an Ubuntu 22.04 server instance on Vultr.
Set up a new domain A record pointing to your server IP address. For example,
minio.example.com
.Create a Vultr Block Storage volume and attach it to your server using the
/mnt/blockstorage
mount point.Access the server using SSH as a non-root user with sudo privileges.
Install MinIO
MinIO is not available in the default APT repositories on Ubuntu 22.04 but can be installed using the official Debian package release file. Follow the steps below to download the latest release file and install MinIO on your server.
Download the latest MinIO Debian package file.
console$ wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20240604192008.0.0_amd64.deb -O minio.deb
The above command downloads the latest MinIO
.deb
release file and saves it asminio.deb
. Visit the official releases directory to verify the latest version to install on your server.Install MinIO using the
minio.deb
fileconsole$ sudo dpkg -i minio.deb
View the installed MinIO version on your server.
console$ minio --version
Output:
minio version RELEASE.2024-06-04T19-20-08Z (commit-id=17fe91d6d162b3ad372760726d29f1f348dbdb09) Runtime: go1.22.3 linux/amd64 License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html Copyright: 2015-2024 MinIO, Inc.
Configure MinIO
MinIO uses the minio
command to run and manage the application server. It supports multiple options you can use to define the listening port, storage volumes, and default administrator user details on your server without saving changes when your session ends. Follow the steps below to configure MinIO with permanent options and enable it to run automatically on your server.
Create a new MinIO configuration file.
console$ sudo nano /etc/default/minio
Add the following configurations to the file. Replace
minio_admin
andstrong-password
with your desired administrator details.iniMINIO_VOLUMES="/mnt/blockstorage" MINIO_OPTS="-C /etc/minio --address :9000 --console-address :9001" MINIO_ROOT_USER="minio_admin" MINIO_ROOT_PASSWORD="strong-password"
Save and close the file.
The above configuration enables the MinIO server to run on your server using the API port
9000
and the console web interface port9001
. In addition, MinIO reads and stores files to the specified Vultr Block Storage volume path/mnt/blockstorage
.Enable the MinIO system service to automatically start at boot time.
console$ sudo systemctl enable minio
Output:
Created symlink /etc/systemd/system/multi-user.target.wants/minio.service → /usr/lib/systemd/system/minio.service.
The MinIO system service uses the
minio-user
andminio-user
group to run on your server. Create the new user and assign privileges to specific directories to access using MinIO.Create a new
minio-user
user without login privileges on the server.console$ sudo useradd -m -s /usr/sbin/nologin minio-user
Grant the
minio-user
and group ownership privileges to your data storage directory. For example, your Vultr Block Storage volume path/mnt/blockstorage
.console$ sudo chown minio-user:minio-user /mnt/blockstorage
Start the MinIO system service.
console$ sudo systemctl start minio.service
View the MinIO service status and verify that it's running on your server.
console$ sudo systemctl status minio.service
Secure MinIO
MinIO listens for connection requests on the API port 9000
and the web console port 9001
by default. Securely run and expose MinIO by enabling a domain name and enable the application to run on secure ports such as the HTTPS port 443
. In addition, generate trusted SSL certificates using Let's Encrypt to enable HTTPS connections and access to the API using S3 client tools. Follow the sections below to generate SSL certificates and configure MinIO to run on your domain.
Generate Let's Encrypt SSL Certificates to use with MinIO
MinIO supports HTTP connections by default when the --certs-dir
is not enabled in your configuration options. When enabled, MinIO uses your SSL certificate public.crt
file and the private key private.key
. Follow the steps below to generate Let's Encrypt certificates to use with MinIO and enable network connections on the server.
Allow the HTTP port
80
through the default firewall to allow Let's Encrypt verifications.console$ sudo ufw allow 80/tcp
Install the Certbot Let's Encrypt client application.
console$ sudo apt install certbot -y
Request a new SSL certificate using your domain. Replace
minio.example.com
andhello@example.com
with your actual details.console$ sudo certbot certonly --standalone -d minio.example.com -m hello@example.com --agree-tos
When successful, your output should be similar to the one below:
Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/minio.example.com.conf/fullchain.pem Key is saved at: /etc/letsencrypt/live/minio.example.com.conf/privkey.pem This certificate expires on 2024-09-21. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background.
Test that Certbot auto-renews your SSL certificate upon expiry.
console$ sudo certbot renew --dry-run
Create a new directory in a system-wide location such as
/opt
to store the SSL certificate files for use with MinIO. For example,minio-certs
console$ sudo mkdir -p /opt/minio-certs
Copy your SSL certificate as
public.crt
to the/opt/minio-certs
directory.console$ sudo cp /etc/letsencrypt/live/minio.example.com/fullchain.pem /opt/minio-certs/public.crt
Copy your certificate's private key as
private.key
.console$ sudo cp /etc/letsencrypt/live/minio.example.com/privkey.pem /opt/minio-certs/private.key
Grant the
minio-user
full privileges to the directory.console$ sudo chown -R minio-user:minio-user /opt/minio-certs/
Open your MinIO configuration file to apply the new SSL options.
console$ sudo nano /etc/default/minio
Replace the MinIO console address port
:9001
with the HTTPS port443
.iniMINIO_OPTS="-C /etc/minio --address :9000 --console-address :443"
- Add the
--certs-dir /opt/minio-certs
option to yourMINIO_OPTS
directive.
iniMINIO_OPTS="-C /etc/minio --address :9000 --console-address :443 --certs-dir /opt/minio-certs"
- Add a new
MINIO_DOMAIN
with your domain URL at the end of your configuration file.
iniMINIO_DOMAIN="https://minio.example.com"
Save and close the file.
Your modified MinIO configuration should look like the one below.
iniMINIO_VOLUMES="/mnt/blockstorage" MINIO_OPTS="-C /etc/minio --address :9000 --console-address :443 --certs-dir /opt/minio-certs" MINIO_ROOT_USER="minio_admin" MINIO_ROOT_PASSWORD="strong-password" MINIO_DOMAIN="minio.example.com"
- Add the
Restart MinIO to apply your configuration changes.
console$ sudo systemctl restart minio
Allow connections to the HTTPS port
443
through the default firewall.console$ sudo ufw allow 443/tcp
Allow S3 connections to the MinIO API port
9000
.console$ sudo ufw allow 9000/tcp
Reload the Firewall to apply changes.
console$ sudo ufw reload
Access MinIO
Access your MinIO domain using a web browser such as Chrome.
https://minio.example.com
Verify that the MinIO interface displays in your web browser. Then, Log in to the MinIO console using the following administrator user details you enabled in the
/etc/default/minio
configuration file.USERNAME:
minio_admin
PASSWORD:strong-password
Click Buckets on the main navigation menu to set up a new storage bucket on your server.
Click Create a Bucket to set up the new bucket information.
Enter your desired bucket name in the Bucket Name field. For example,
vultr_test
.Enable extra bucket features and click Create Bucket to apply it on your server.
Verify that the new bucket is available. Then, click the bucket name to access the properties configuration.
Navigate to Object Browser on the main navigation menu to upload files on your server.
Click your new bucket to open the object browser. Then, click Upload and select Upload File from the list of options to upload new files from your device.
Verify that your upload is complete and the new file is available in your object browser. Then, click your desired file and select Share to generate a new shareable encrypted URL.
Set the link duration and click the copy symbol to share your generated link to download the file.
Access MinIO using an S3 Client
S3 client applications offer a secure way to upload and manage object storage files. The MinIO API runs on port 9000
and accepts S3 connections on your server to create and manage files. Follow the steps below to use an S3 client application such as S3 Browser to establish a connection and upload files on your server.
Navigate to Access Keys within your MinIO console interface to set up new authentication keys.
Click Create access key to generate a new access and secret key with random values.
Set your desired expiry date and name. Then, click Create to apply the new keys on your server.
Copy the generated keys or click Download for Import to save the keys to a file on your device.
Download and install an S3 client application on your device. For example, S3 Browser.
Open the S3 Browser application on your device and click Add new account within the Accounts menu.
Select S3 Compatible Storage or Amazon S3 as the account type. Then, enter your MinIO API URL in the REST ENDPOINT field.
https://minio.example.com:9000
Click Connect to save the new S3 storage account and connect to your MinIO server.
Verify that your MinIO buckets display in the S3 client application. Then, click any bucket to view the available objects.
Conclusion
You have deployed MinIO on your Ubuntu 24.04 server and configured the application to manage files using the main console web interface. MinIO is compatible with most applications and uses the S3 API to integrate with other services on your server. For more configuration options, please visit the official MinIO documentation.