Geavanceerd
Zoeken inInstallatiegidsen
Zo zoek je
  • Plak een foutmelding tussen aanhalingstekens, bijv. "permission denied", om de oplossingstabel te vinden.
  • Kies een gebied en een deel van de gids (installeren, eerste instellingen, dagelijks gebruik, beveiliging, oplossingen) om direct naar de juiste stap te gaan.
  • "twee woorden" vindt precies die zin.
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken
Probeer:

Gids 87MinIO · Data

Install and set up MinIO (S3-compatible object storage)

MinIO is S3-compatible object storage you run yourself: buckets, objects, versioning, lifecycle rules and access keys that work with every S3 tool (AWS CLI, restic, Velero, Loki, Harbor, backups). It is a common target for backups and a local "S3" for labs and on-prem platforms. This guide installs a MinIO server on RHEL and Ubuntu with systemd and TLS, uses the mc client for buckets, users and policies, sets versioning and lifecycle rules, and explains what changed with the free edition.

  • 8 Lessen
  • 9 Commando's

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

87.1

Know it before you install

Buckets hold objects (files) with keys (paths). Clients use the S3 API with an access key and secret key. With 4+ drives MinIO uses erasure coding, so data survives lost drives; a single drive is fine for labs and small backup targets.

ItemValue
Serverminio (one binary)
Clientmc (MinIO Client — works with any S3 service)
Config/etc/default/minio (environment file for the service)
Datafor example /srv/minio/data (XFS recommended)
Ports9000 (S3 API), 9001 (web console)
TLScertificates in /etc/minio/certs/ (public.crt, private.key)

Notitie

In 2025 MinIO changed its free community edition a lot: the web console lost most admin features, and pre-built community binaries and images stopped being published (source only), with the project later in maintenance mode. Check the current status before you choose it for new production work. Alternatives for S3-compatible storage: Ceph RGW, Garage, SeaweedFS, or your cloud's object storage. The mc commands and S3 ideas below work with all of them.

Commando's in deze les

87.2

Install the server (RHEL and Ubuntu)

Get a minio server binary for your platform (official downloads where available, or build it from source with Go: go install github.com/minio/minio@latest), then install it with a service user:

install -m 0755 minio /usr/local/bin/minio
useradd --system --no-create-home --shell /sbin/nologin minio-user
mkdir -p /srv/minio/data /etc/minio/certs
chown -R minio-user: /srv/minio /etc/minio
minio --version

Install the client mc from dl.min.io (client/mc/release/linux-amd64/mc) or from source, as /usr/local/bin/mc. (On some systems mc is Midnight Commander — then name it mcli.)

87.3

First configuration: service, credentials, TLS

/etc/default/minio
MINIO_VOLUMES="/srv/minio/data"
MINIO_OPTS="--address :9000 --console-address :9001 --certs-dir /etc/minio/certs"
MINIO_ROOT_USER="minio-admin"
MINIO_ROOT_PASSWORD="a-very-long-random-root-password"
MINIO_SERVER_URL="https://s3.example.com:9000"
/etc/systemd/system/minio.service
[Unit]
Description=MinIO object storage
After=network-online.target
 
[Service]
User=minio-user
Group=minio-user
EnvironmentFile=/etc/default/minio
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
Restart=always
LimitNOFILE=1048576
 
[Install]
WantedBy=multi-user.target

Put the certificate for s3.example.com in /etc/minio/certs/public.crt and the key in private.key (owner minio-user, key mode 600). Then:

chmod 600 /etc/default/minio
systemctl daemon-reload
systemctl enable --now minio
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/16" port port="9000-9001" protocol="tcp" accept'
firewall-cmd --reload
curl -s https://s3.example.com:9000/minio/health/live -o /dev/null -w '%{http_code}\n'
200
SettingWhy
Long root user/passwordThe root account can do everything — use it only to create admins and users.
--certs-dir with a real certificateS3 clients need HTTPS; access keys travel in every request.
MINIO_SERVER_URLCorrect links (presigned URLs) behind a DNS name.
Data on its own disk (XFS)Performance and no full root file system.

87.4

Buckets, users and policies with mc

mc alias set s3 https://s3.example.com:9000 minio-admin 'a-very-long-random-root-password'
mc admin info s3
mc mb s3/backups
mc version enable s3/backups
mc ilm rule add --expire-days 90 --noncurrent-expire-days 30 s3/backups
mc retention set --default GOVERNANCE 30d s3/backups

A user for one backup tool, with rights only on its bucket:

backup-writer.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:ListBucket", "s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
      "Resource": ["arn:aws:s3:::backups", "arn:aws:s3:::backups/*"]
    }
  ]
}
mc admin policy create s3 backup-writer backup-writer.json
mc admin user add s3 restic-web1 'another-long-secret'
mc admin policy attach s3 backup-writer --user restic-web1
mc ls s3/backups
mc cp backup.tar.gz s3/backups/web1/
mc mirror --overwrite /srv/exports s3/backups/exports
mc share download --expire 2h s3/backups/web1/backup.tar.gz
Bucket settingWhy
VersioningDeleted or overwritten objects can be restored.
Lifecycle (ilm)Old versions and old backups are removed automatically.
Retention / object lockBackups can not be deleted for N days — protection against ransomware (object lock must be enabled when the bucket is created: mc mb --with-lock).

Real uses at work:

  • Backup target for restic, Velero, database dumps and Proxmox/VM backups.
  • Storage for Loki, Tempo, Harbor and other tools that want "S3".
  • A local S3 for labs and CI (test your app's S3 code without the cloud).

Commando's in deze les

87.5

Make it safe

Security checklist:

  • HTTPS only; strong root credentials; root used only for admin tasks.
  • One user (or service account) per app, with a policy for its bucket only.
  • Versioning + object lock for backup buckets (ransomware protection).
  • Ports 9000/9001 only from client networks; console not public.
  • Monitor disk usage and health (/minio/health/live, Prometheus metrics); keep a second copy of important backups elsewhere (3-2-1 rule).
  • Follow security updates — check the edition and update status regularly.

87.6

Update and remove

Replace the binary and restart (systemctl restart minio), or mc admin update s3 where supported. Back up the configuration (mc admin config export s3) and your bucket policies first.

87.7

Fix common problems

ProblemCauseFix
Access Denied for a userThe policy does not cover the bucket or action.mc admin user info s3 USER; fix the policy resources (bucket and bucket/*).
Clients: x509: certificate signed by unknown authoritySelf-signed or internal CA.Use a trusted certificate, or add the CA to the client trust store.
SignatureDoesNotMatchWrong secret key, wrong time on the client, or a proxy changed the request.Check keys; sync time (chrony); proxy must pass Host unchanged.
Service does not start: permission denied on the data folderOwner is not minio-user.chown -R minio-user: /srv/minio.
Disk fills although objects were deletedVersioning keeps old versions.Lifecycle rule --noncurrent-expire-days.
mc opens Midnight CommanderName clash.Install the MinIO client as mcli.

87.8

Next steps

1Why turn on versioning and object lock for a backup bucket?

So deleted or encrypted backups (ransomware) can be restored, and locked backups can not be deleted for a time.

2A user's policy lists only arn:aws:s3:::backups. Why can it not upload?

Object actions need arn:aws:s3:::backups/* too.

Commando's in deze les

Alle commando's in dit hoofdstuk