GoAdmio

minio

Install MinIO (S3-compatible object storage) as a system service, with a root login, optional Let's Encrypt SSL, and data stored in /backup/s3

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/minio installs MinIO, a self-hosted object storage server that speaks the Amazon S3 API, and runs it as a systemd service. It:

Objects are stored in /backup/s3.

[!WARNING] With -s y, the command stops and disables Apache or Nginx so MinIO can use port 443. Every website on the server goes offline. See Port and web server behavior.


Quick start

# MinIO on port 3333 for a hostname that points to this server
/go/minio -h storage.example.com

Syntax

/go/minio [-u <username>] [-p <password>] [-h <hostname>] [-s y]

All options are optional. Run the command as root, because parts of it write to system folders without sudo.

An unrecognized option prints this usage line, but the install continues:

Usage: minio [-u] Username [-p] Password [-h] Hostname [-s] y/n (Enable SSL Certificate on Port 443)

Here -h means hostname, not help.


Options

Option Default Notes
-u <username> admin MinIO root user. At least 5 characters.
-p <password> Random 16-character alphanumeric MinIO root password. At least 8 characters. See Security.
-h <hostname> Reverse DNS of the server's public IPv4 address Used for the API address, the certificate, and virtual-host-style bucket URLs. Pass it explicitly if the server has no reverse DNS.
-s y Off Serve the API on port 443 and stop the web server. Any value other than y means off.

Output

The command prints plain text, not JSON. The details are printed before the certificate is requested, so they appear even if SSL setup fails later.

API: https://storage.example.com:3333
Username: admin
Password: <password>

MinIO Config File: /usr/local/goadmio/minio/minio.conf
To restart MinIO Run: systemctl restart minio
Outcome What you get
Installed The five lines above.
Username too short Error: Username must be at least 5 characters, exit code 1. Nothing is installed.
Password too short Error: Password must be at least 8 characters, exit code 1. Nothing is installed.
Unknown option The usage line, then the install continues.

Ports

Mode API port Console port URL shown
Default 3333 3334 https://<hostname>:3333
-s y 443 3334 https://<hostname>

The web console always runs on port 3334. The command does not open firewall ports; use allow.

Security

[!WARNING] The password is stored in plain text in several places: the command output, /usr/local/goadmio/minio/minio.conf, /usr/local/goadmio/minio/minio.sh, and the command log. If you pass -p, it is also visible in the process list and shell history, and it is written to /var/log/go/minio.log with the rest of the command line. Prefer the random default.


Examples

# Default install on port 3333, random password
/go/minio -h storage.example.com
# Chosen root login
/go/minio -h storage.example.com -u storageadmin -p 'S3cureP@ssw0rd'
# Serve on port 443 (stops Apache or Nginx, so use only on a dedicated server)
/go/minio -h storage.example.com -s y
# Open the ports in the firewall afterwards
/go/allow 3333
/go/allow 3334
# Create a bucket after installing
/go/bucket --help

Troubleshooting

Symptom Likely cause Fix
Username must be at least 5 characters Username too short. Pass a longer -u, or omit it to use admin.
Password must be at least 8 characters Password too short. Pass a longer -p, or omit it for a random one.
Usage line printed, install still ran Unknown option. Check the spelling against Options.
All websites went offline The install ran with -s y, which stops the web server. Reinstall without -s y (this restarts the web server), or run MinIO on a separate server.
Hostname is empty or odd in the output The server has no reverse DNS. Reinstall with -h <hostname>.
Browser or client reports a certificate error Certificate request failed, or it was not copied to MinIO. See Certificates, then run systemctl restart minio.
Unit minio.service not found The service file was not written where systemd looks. See Service file location.
Cannot reach ports 3333 or 3334 Firewall. Open the ports with allow.
Old password stopped working The command was run again and generated a new one. Read the current values in /usr/local/goadmio/minio/minio.conf.
Download step fails The server cannot reach dl.min.io. Check outbound access and network settings, then run again.

Details

Running it again

The command is safe to re-run, but it resets the installation:

Stored objects in /backup/s3 are kept. Only /backup/s3 itself is re-owned, not its contents, so if the recreated user gets a different ID, run chown -R minio:minio /backup/s3.

Port and web server behavior

The script reads the operating system and web server from /usr/local/goadmio/linux/os.db and ws.db.

Option Web server action
-s y Stopped and disabled (httpd or apache2, or nginx).
Not y Enabled and restarted.

Certificates

If /etc/letsencrypt/live/<hostname> does not exist, the command runs certbot --apache certonly for the hostname and copies fullchain.pem and privkey.pem to /usr/local/goadmio/minio/.minio/certs/ as public.crt and private.key. MinIO serves HTTPS when these files are present.

Things to know:

Service file location

The script writes the unit file to /lib/systemd/var/go/minio.service. That is not a standard systemd unit directory (the usual one is /lib/systemd/system/), so systemctl enable minio may not find the unit unless that path is mapped on your servers. If the service is missing, check where the file ended up.

Files and folders

Path Purpose
/usr/local/goadmio/minio/bin/minio MinIO server binary (latest linux-amd64 release, downloaded without a version pin or checksum check).
/usr/local/goadmio/minio/minio.conf Environment file the service reads: volumes, listen addresses, domain, root user, root password.
/usr/local/goadmio/minio/minio.sh Manual start script with the same credentials. The service does not use it.
/usr/local/goadmio/minio/.minio/certs/ public.crt and private.key.
/backup/s3 Object storage data.
/etc/minio Contains the hostname.
/usr/bin/mc MinIO client, installed only if missing.
/var/log/go/minio.log Log of every run, including its arguments.

MINIO_DOMAIN is set to the hostname, which enables virtual-host-style URLs such as bucket.storage.example.com. These need a wildcard DNS record pointing to the server.

What it does

flowchart TD
    A["minio ..."] --> B["Log the command, apply defaults"]
    B --> C{"Username 5+ and password 8+ characters?"}
    C -- "No" --> X["Error, exit 1"]
    C -- "Yes" --> D["Recreate minio user, folders, download binary"]
    D --> E["Write minio.conf, minio.sh, service file"]
    E --> F["Enable and restart minio"]
    F --> G["Print API URL and login"]
    G --> H{"Certificate for hostname exists?"}
    H -- "No" --> I["Request certificate, copy to MinIO certs"]
    H -- "Yes" --> J
    I --> J{"-s y?"}
    J -- "Yes" --> K["Stop and disable web server"]
    J -- "No" --> L["Enable and restart web server"]
    K --> M["Run cron, install mc if missing"]
    L --> M
  1. Appends the command line to /var/log/go/minio.log.
  2. Reads the OS and web server type, and looks up the server's public IPv4 address.
  3. Parses the options and applies defaults.
  4. Validates the username (5+ characters) and password (8+ characters).
  5. Deletes and recreates the minio user, with no login shell and /usr/local/goadmio/minio as its home.
  6. Creates bin and .minio/certs under /usr/local/goadmio/minio, and /backup/s3.
  7. Downloads the MinIO server binary and makes it executable.
  8. Writes minio.sh and minio.conf.
  9. Sets minio as the owner of the install folder and /backup/s3.
  10. Writes the systemd service file, then enables and restarts minio.
  11. Prints the API URL, username, password, and config file path.
  12. Requests a Let's Encrypt certificate and copies it to MinIO, if none exists for the hostname.
  13. Sets ownership of the certs folder and writes the hostname to /etc/minio.
  14. Stops and disables the web server (-s y), or enables and restarts it.
  15. Runs cron.
  16. Installs the mc client to /usr/bin/mc if it is missing.

Buckets and access keys are not created during installation. Use bucket for that.


See also

Command Description
miniossl Install an SSL certificate for MinIO
bucket Create a MinIO bucket, make it public or private, or create an S3 access key
s3 Mount an S3 bucket on a GoAdmio server
maria Incremental MariaDB backup to S3 or via Rclone
allow Open a TCP port in the server firewall
firewall Install and configure the server firewall