
How to Install MinIO Object Storage on Ubuntu 24.04
MinIO is a high-performance, S3 compatible object storage solution that is ideal for various applications, including cloud-native architectures and microservices. In this guide, we will walk you through the process of installing MinIO on Ubuntu 24.04, configuring it correctly, and ensuring it runs smoothly as a service.
Prerequisites
- Ubuntu 24.04 server installed and running.
- Root access or sudo privileges on the server.
- Basic knowledge of Linux command line.
Main Steps
1. Install Dependencies
Before installing MinIO, ensure that your system is up-to-date and has the necessary dependencies.
sudo apt update && sudo apt upgrade -y
2. Create User for MinIO
It is a good practice to run services under a dedicated user for security reasons. Let's create a user named minio-user.
sudo useradd -r minio-user -s /sbin/nologin
3. Download MinIO Binary
Download the MinIO binary from the official MinIO website.
curl -O https://dl.min.io/server/minio/release/linux-amd64/minio
4. Move and Set Permissions
Move the downloaded binary to /usr/local/bin/ and set the appropriate permissions.
sudo mv minio /usr/local/bin/
sudo chmod +x /usr/local/bin/minio
5. Create Configuration Files
MinIO uses a two-file configuration system. Letβs create these files.
/etc/default/minio
sudo bash -c 'cat >> /etc/default/minio <Volume to be used for MinIO server.
MINIO_VOLUMES="/mnt/data"
Run MinIO on a custom port.
MINIO_OPTS="--address :9000 --console-address :9001"
Pointer to the main configuration file.
MINIO_CONFIG_ENV_FILE=/etc/minio/config.env
EOT'
/etc/minio/config.env
sudo mkdir -p /etc/minio
sudo bash -c 'cat >> /etc/minio/config.env <
Root credentials
MINIO_ROOT_USER=Root-User
MINIO_ROOT_PASSWORD=Root-Password
EOT'
6. Set Permissions on Configuration Files
Ensure that the configuration files have the correct permissions for security.
sudo chmod 600 /etc/minio/config.env
sudo chown minio-user:minio-user /etc/minio/config.env
7. Create a Systemd Service File
We will create a systemd service file to manage the MinIO service.
sudo bash -c 'cat > /lib/systemd/system/minio.service <[Unit]
Description=MinIO
Documentation=ISG
Wants=network-online.target
After=network-online.target
[Service]
User=minio-user
ExecStart=/usr/local/bin/minio server --config-dir /etc/minio $MINIO_VOLUMES $MINIO_OPTS
Restart=always
AmbientCapabilities=CAP_NET_BIND_SERVICE,CAP_SYS_ADMIN,CAP_DAC_OVERRIDE
[Install]
WantedBy=multi-user.target
EOT'
8. Enable and Start MinIO Service
Now that we have the service file ready, let's enable and start the MinIO service.
sudo systemctl daemon-reload
sudo systemctl enable minio.service
sudo systemctl start minio.service
Advanced Configuration
Once MinIO is installed and running, you may want to explore additional configuration options to optimize its performance or integrate it with other services.
1. Configuring Environment Variables
You can edit the /etc/minio/config.env file to include other configuration options such as identity management, storage class configurations, or others according to your needs.
2. Setting Up Network Security
To secure your MinIO server, consider enabling TLS encryption. You will need to generate SSL certificates and modify the service file accordingly to include them.
Best Practices
- Always run MinIO as a non-root user.
- Regularly back up your data and configuration files.
- Secure your MinIO server using TLS to encrypt data in transit.
- Monitor your MinIO logs and performance metrics to identify potential issues early.
Troubleshooting
If you encounter issues while setting up or running MinIO, consider the following troubleshooting tips:
- Service Fails to Start: Check the status of the service with
systemctl status minio.servicefor any error messages. - Permission Issues: Ensure that the
minio-userhas the necessary permissions on the data directory and configuration files. - Configuration Errors: Validate your configuration syntax in
/etc/minio/config.envfor any typos or incorrect values.
Conclusion
Installing MinIO on Ubuntu 24.04 is a straightforward process that involves setting up the prerequisites, downloading and configuring the MinIO server, and running it as a service. By following the steps outlined in this guide, you should have a functional MinIO object storage solution that can be further customized based on your requirements.
For further assistance, feel free to Konsultasi Jasa Setup Sekarang.
Verifikasi Teknis
Panduan ini disusun berdasarkan referensi teknis terbaru. Namun, konfigurasi server dapat bervariasi. Lihat sumber referensi asli β
