1 – Setup MINIO Block Storage Server
MINIO is an opensource object storage server with AWS S3 compatible APIs. We’ve already implemented AWS S3 and DigitalOcean Spaces Backups. With MINIO you can self host a block storage server for automated backups.
Create MINIO Configuration File
This guide works on Centos 7.x and Ubuntu 18.xx. We need to create Systemd service for minio so that it can run in background.
First create new file at /etc/default/minio
and paste following in it:
# Volume to be used for Minio server. MINIO_VOLUMES="/tmp/minio/" # Use if you want to run Minio on a custom port. MINIO_OPTS="--address :9000" # Access Key of the server. MINIO_ACCESS_KEY=Server-Access-Key # Secret key of the server. MINIO_SECRET_KEY=Server-Secret-Key
- MINIO_VOLUMES -> Is where MINIO will store your objects.
- MINIO_OPTS -> You can set address and various options here.
- MINIO_ACCESS_KEY -> Access Key that we will need later to authenticate to this storage server.
- MINIO_SECRET_KEY -> Secret key works as password for above Access Key.
Create Systemd service for MINIO
Download MINIO binary and make it executable.
wget https://dl.minio.io/server/minio/release/linux-amd64/minio cp minio /usr/local/bin/ chmod +x /usr/local/bin/minio
Create new file at /etc/systemd/system/minio.service
and paste:
[Unit] Description=Minio Documentation=https://docs.minio.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/bin/minio [Service] WorkingDirectory=/usr/local/ User=minio-user Group=minio-user EnvironmentFile=-/etc/default/minio ExecStartPre=/bin/bash -c "if [ -z "${MINIO_VOLUMES}" ]; then echo "Variable MINIO_VOLUMES not set in /etc/default/minio"; exit 1; fi" ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES # Let systemd restart this service always Restart=always # 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=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target # Built for ${project.name}-${project.version} (${project.name})
Replace User=minio-user
and Group=minio-user
as required. (Make sure that this user have write access to your volume path)
Generate SSL for MINIO:
openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout ~/.minio/certs/private.key -out ~/.minio/certs/public.crt
Enable and start MINIO:
systemctl enale minio.service systemctl start minio
Now you should be able to access MINIO at https:// IP Address :9000/
. You can login using your MINIO_ACCESS_KEY and MINIO_SECRET_KEY that you set above in configuration file.
Next: Configure MINIO Node