Documentation

MinIO Object Storage for Container

MinIO is an object storage solution that provides an Amazon Web Services S3-compatible API and supports all core S3 features. MinIO is built to deploy anywhere - public or private cloud, baremetal infrastructure, orchestrated environments, and edge infrastructure.

This site documents Operations, Administration, and Development of MinIO deployments on Containers for the latest stable version of MinIO: RELEASE.2024-03-15T01-07-19Z.

MinIO is released under dual license GNU Affero General Public License v3.0 and MinIO Commercial License. Deployments registered through MinIO SUBNET use the commercial license and include access to 24/7 MinIO support.

You can get started exploring MinIO features using the MinIO Console and our play server at https://play.min.io. play is a public MinIO cluster running the latest stable MinIO server. Any file uploaded to play should be considered public and non-protected. For more about connecting to play, see MinIO Console play Login.

Quickstart for Containers

This procedure deploys a Single-Node Single-Drive MinIO server onto Docker or Podman for early development and evaluation of MinIO Object Storage and its S3-compatible API layer.

For instructions on deploying to production environments, see Deploy MinIO: Multi-Node Multi-Drive.

Prerequisites

  • Podman or Docker installed.

  • Read, write, and delete access to the folder or drive used for the persistent volume.

Procedure

  1. Start the container

    Select a container type to view instructions to create the container. Instructions are available for either GNU/Linux and MacOS or for Windows.

    Podman (Rootfull or Rootless)

    These steps work for both rootfull and rootless containers.

    mkdir -p ~/minio/data
    
    podman run \
       -p 9000:9000 \
       -p 9001:9001 \
       -v ~/minio/data:/data \
       -e "MINIO_ROOT_USER=ROOTNAME" \
       -e "MINIO_ROOT_PASSWORD=CHANGEME123" \
       quay.io/minio/minio server /data --console-address ":9001"
    

    The example above works this way:

    • podman run starts the container. The process is attached to the terminal session and ends when exiting the terminal.

    • -p binds a local port to a container port.

    • -v sets a file path as a persistent volume location for the container to use. When MinIO writes data to /data, that data mirrors to the local path ~/minio/data, allowing it to persist between container restarts. You can set any file path to which the user has read, write, and delete permissions to use.

    • -e sets the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD, respectively. These set the root user credentials. Change the example values to use for your container.

    podman run \
       -p 9000:9000 \
       -p 9001:9001 \
       -v D:\minio\data:/data \
       -e "MINIO_ROOT_USER=ROOTNAME" \
       -e "MINIO_ROOT_PASSWORD=CHANGEME123" \
       quay.io/minio/minio server /data --console-address ":9001"
    

    The example above works this way:

    • podman run starts the container.

    • -p binds a local port to a container port.

    • -v sets a file path as a persistent volume location for the container to use. When MinIO writes data to /data, that data mirrors to the local path D:\minio\data, allowing it to persist between container restarts. You can set any file path to which the user has read, write, and delete permissions to use.

    • -e sets the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD, respectively. These set the root user credentials. Change the example values to use for your container.

    Docker (Rootfull)
    mkdir -p ~/minio/data
    
    docker run \
       -p 9000:9000 \
       -p 9001:9001 \
       --name minio \
       -v ~/minio/data:/data \
       -e "MINIO_ROOT_USER=ROOTNAME" \
       -e "MINIO_ROOT_PASSWORD=CHANGEME123" \
       quay.io/minio/minio server /data --console-address ":9001"
    

    The example above works this way:

    • mkdir creates a new local directory at ~/minio/data in your home directory.

    • docker run starts the MinIO container.

    • -p binds a local port to a container port.

    • -name creates a name for the container.

    • -v sets a file path as a persistent volume location for the container to use. When MinIO writes data to /data, that data mirrors to the local path ~/minio/data, allowing it to persist between container restarts. You can replace ~/minio/data with another local file location to which the user has read, write, and delete access.

    • -e sets the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD, respectively. These set the root user credentials. Change the example values to use for your container.

    docker run \
       -p 9000:9000 \
       -p 9001:9001 \
       --name minio1 \
       -v D:\minio\data:/data \
       -e "MINIO_ROOT_USER=ROOTUSER" \
       -e "MINIO_ROOT_PASSWORD=CHANGEME123" \
       quay.io/minio/minio server /data --console-address ":9001"
    

    The example above works this way:

    • docker run starts the MinIO container.

    • -p binds a local port to a container port.

    • -v sets a file path as a persistent volume location for the container to use. When MinIO writes data to /data, that data mirrors to the local path D:\minio\data, allowing it to persist between container restarts. You can replace D:\minio\data with another local file location to which the user has read, write, and delete access.

    • -e sets the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD, respectively. These set the root user credentials. Change the example values to use for your container.

    Docker (Rootless)
    mkdir -p ${HOME}/minio/data
    
    docker run \
       -p 9000:9000 \
       -p 9001:9001 \
       --user $(id -u):$(id -g) \
       --name minio1 \
       -e "MINIO_ROOT_USER=ROOTUSER" \
       -e "MINIO_ROOT_PASSWORD=CHANGEME123" \
       -v ${HOME}/minio/data:/data \
       quay.io/minio/minio server /data --console-address ":9001"
    

    The example above works this way:

    • mkdir creates a new local directory at ~/minio/data in your home directory.

    • docker run starts the MinIO container.

    • -p binds a local port to a container port.

    • -user sets the username for the container to the policies for the current user and user group.

    • -name creates a name for the container.

    • -v sets a file path as a persistent volume location for the container to use. When MinIO writes data to /data, that data actually writes to the local path ~/minio/data where it can persist between container restarts. You can replace ${HOME}/minio/data with another location in the user’s home directory to which the user has read, write, and delete access.

    • -e sets the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD, respectively. These set the root user credentials. Change the example values to use for your container.

    Prerequisite:

    docker run \
       -p 9000:9000 \
       -p 9001:9001 \
       --name minio1 \
       --security-opt "credentialspec=file://path/to/file.json"
       -e "MINIO_ROOT_USER=ROOTUSER" \
       -e "MINIO_ROOT_PASSWORD=CHANGEME123" \
       -v D:\data:/data \
       quay.io/minio/minio server /data --console-address ":9001"
    

    The example above works this way:

    • docker run starts the MinIO container.

    • -p binds a local port to a container port.

    • -name creates a name for the container.

    • --security-opt grants access to the container via a credentialspec file for a Group Managed Service Account (gMSA)

    • -v sets a file path as a persistent volume location for the container to use. When MinIO writes data to /data, that data actually writes to the local path D:\data where it can persist between container restarts. You can replace D:\data with another local file location to which the user has read, write, and delete access.

    • -e sets the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD, respectively. These set the root user credentials. Change the example values to use for your container.

  2. Connect your Browser to the MinIO Server

    Access the MinIO Console by going to a browser and going to http://127.0.0.1:9000 or one of the Console addresses specified in the minio server command’s output. For example, Console: http://192.0.2.10:9001 http://127.0.0.1:9001 in the example output indicates two possible addresses to use for connecting to the Console.

    While port 9000 is used for connecting to the API, MinIO automatically redirects browser access to the MinIO Console.

    Log in to the Console with the credentials you defined in the MINIO_ROOT_USER and MINIO_ROOT_PASSWORD environment variables.

    MinIO Console displaying login screen

    You can use the MinIO Console for general administration tasks like Identity and Access Management, Metrics and Log Monitoring, or Server Configuration. Each MinIO server includes its own embedded MinIO Console.

    MinIO Console displaying bucket start screen

    For more information, see the MinIO Console documentation.

  3. (Optional) Install the MinIO Client

    The MinIO Client allows you to work with your MinIO volume from the commandline.

    Select your operating system for instructions.

    GNU/Linux

    The MinIO Client allows you to work with your MinIO server from the commandline.

    Download the mc client and install it to a location on your system PATH such as /usr/local/bin. You can alternatively run the binary from the download location.

    wget https://dl.min.io/client/mc/release/linux-amd64/mc
    chmod +x mc
    sudo mv mc /usr/local/bin/mc
    

    Use mc alias set to create a new alias associated to your local deployment. You can run mc commands against this alias:

    mc alias set local http://127.0.0.1:9000 {MINIO_ROOT_USER} {MINIO_ROOT_PASSWORD}
    mc admin info local
    

    Replace {MINIO_ROOT_USER} and {MINIO_ROOT_PASSWORD} with the credentials you defined for the container with the -e flags.

    The mc alias set takes four arguments:

    • The name of the alias

    • The hostname or IP address and port of the MinIO server

    • The Access Key for a MinIO user

    • The Secret Key for a MinIO user

    For additional details about this command, see mc alias set.

    MacOS

    The MinIO Client allows you to work with your MinIO volume from the commandline.

    Run the following command to install the latest stable MinIO Client package using Homebrew.

    brew install minio/stable/mc
    

    Run the following commands to install the latest stable MinIO Client package using a binary package for Apple chips.

    curl -O https://dl.min.io/client/mc/release/darwin-arm64/mc
    chmod +x mc
    sudo mv mc /usr/local/bin/mc
    

    Run the following commands to install the latest stable MinIO Client package using a binary package for Intel chips.

    curl -O https://dl.min.io/client/mc/release/darwin-amd64/mc
    chmod +x mc
    sudo mv mc /usr/local/bin/mc
    

    Use mc alias set to quickly authenticate and connect to the MinIO deployment.

    mc alias set local http://127.0.0.1:9000 {MINIO_ROOT_USER} {MINIO_ROOT_PASSWORD}
    mc admin info local
    

    Replace {MINIO_ROOT_USER} and {MINIO_ROOT_PASSWORD} with the credentials you defined for the container with the -e flags.

    The mc alias set takes four arguments:

    • The name of the alias

    • The hostname or IP address and port of the MinIO server

    • The Access Key for a MinIO user

    • The Secret Key for a MinIO user

    For additional details about this command, see mc alias set.

    Windows

    Download the standalone MinIO server for Windows from the following link:

    https://dl.min.io/client/mc/release/windows-amd64/mc.exe

    Double click on the file to run it. Or, run the following in the Command Prompt or PowerShell.

    \path\to\mc.exe --help
    

    Use mc alias set to quickly authenticate and connect to the MinIO deployment.

    mc.exe alias set local http://127.0.0.1:9000 {MINIO_ROOT_USER} {MINIO_ROOT_PASSWORD}
    mc.exe admin info local
    

    Replace {MINIO_ROOT_USER} and {MINIO_ROOT_PASSWORD} with the credentials you defined for the container with the -e flags.

    The mc alias set takes four arguments:

    • The name of the alias

    • The hostname or IP address and port of the MinIO server

    • The Access Key for a MinIO user

    • The Secret Key for a MinIO user

    For additional details about this command, see mc alias set.

Next Steps