In this tutorial, we will install and configure the Minio server.
What is Minio?
Minio is a self-hosted AWS S3 drop-in replacement/AWS S3-compatible, object storage server written in Go. It can be used to store objects such as photos, videos, log files, backups, etc.
Install Minio on Centos Linux
In this example, we’ll install Minio to /opt/minio, and will configure it to run as a systemd service.
1. Add a minio user
useradd -s /sbin/nologin -d /opt/minio minio
2. Set up directories
mkdir -p /opt/minio/bin mkdir /opt/minio/data # this will be your data partition
3. Install minio server binary and set it to executable. In this example we use the Linux x64 binary.
wget https://dl.minio.io/server/minio/release/linux-amd64/minio -O /opt/minio/bin/minio chmod +x /opt/minio/bin/minio
4. Create a minio config file
vim /opt/minio/minio.conf
:
MINIO_VOLUMES=/opt/minio/data
5. Ensure all files are owned by minio in /opt/minio:
chown -R minio:minio /opt/minio
6. Add minio systemd service files
Note: the systemd service file below has been adapted from: https://github.com/minio/minio-service/tree/master/linux-systemd
vim /etc/systemd/system/minio.service
:
[Unit] Description=Minio Documentation=https://docs.minio.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/opt/minio/bin/minio [Service] WorkingDirectory=/opt/minio User=minio Group=minio PermissionsStartOnly=true EnvironmentFile=-/opt/minio/minio.conf ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /opt/minio/minio.conf\"" ExecStart=/opt/minio/bin/minio server $MINIO_OPTS $MINIO_VOLUMES StandardOutput=journal StandardError=inherit # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=65536 # Disable timeout logic and wait until process is stopped TimeoutStopSec=0 # SIGTERM signal is used to stop Minio KillSignal=SIGTERM SendSIGKILL=no SuccessExitStatus=0 [Install] WantedBy=multi-user.target
7. Enable and start the minio service
systemctl enable minio && systemctl start minio
8. Check that minio has started
systemctl status minio
9. Take note of your Minio access and secret key:
grep -E 'accessKey|secretKey' /opt/minio/.minio/config.json
Configuration
Minio should now be installed, configured and running. You can access the Minio web interface by going to http://<server_ip>:9000/ – log in with the access and secret key recorded above in step 9.
Using Minio
As Minio is AWS S3-compatible, you can use the following tools to upload, browse and delete Minio storage data:
Final Notes
I would strongly recommend running Minio behind an HTTPS reverse proxy. This will ensure that all traffic to and from Minio will be encrypted. You can follow this simple tutorial on how to configure an Apache HTTPS reverse proxy.