#cloud-config package_update: true package_upgrade: true packages: - wget users: - name: minio system: true shell: /bin/false home: /opt/minio write_files: - path: /etc/default/minio content: | MINIO_ROOT_USER=minioadmin MINIO_ROOT_PASSWORD=SecureMinIOPassword123! MINIO_OPTS="--console-address :9001" MINIO_VOLUMES="/opt/minio/data" permissions: '0640' owner: minio:minio - path: /etc/systemd/system/minio.service content: | [Unit] Description=MinIO Documentation=https://docs.min.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/bin/minio [Service] WorkingDirectory=/opt/minio/ User=minio Group=minio 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 # Specifies the maximum number of threads this process can create TasksMax=infinity # Disable timeout logic and wait until process is stopped TimeoutStopSec=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target runcmd: # Download and install MinIO - cd /tmp - wget https://dl.min.io/server/minio/release/linux-amd64/minio - chmod +x minio - mv minio /usr/local/bin/ # Create directories - mkdir -p /opt/minio/data - chown -R minio:minio /opt/minio # Enable and start MinIO - systemctl enable minio - systemctl start minio # Configure firewall - ufw allow 9000/tcp - ufw allow 9001/tcp # Display access information - sleep 10 - echo "MinIO Console: http://localhost:9001" - echo "MinIO API: http://localhost:9000"