.NET Quickstart Guide

MinIO Client SDK for .NET Slack

MinIO Client SDK provides higher level APIs for MinIO and Amazon S3 compatible cloud storage services.For a complete list of APIs and examples, please take a look at the Dotnet Client API Reference.This document assumes that you have a working VisualStudio development environment.

Install from NuGet

To install MinIO .NET package, run the following command in Nuget Package Manager Console.

PM> Install-Package Minio

MinIO Client Example

To connect to an Amazon S3 compatible cloud storage service, you will need to specify the following parameters.




URL to object storage service.


Access key is the user ID that uniquely identifies your account.


Secret key is the password to your account.


Enable/Disable HTTPS support.

The following examples uses a freely hosted public MinIO service ‘’ for development purposes.

using Minio;

// Initialize the client with access credentials.
private static MinioClient minio = new MinioClient()

// Create an async task for listing buckets.
var getListBucketsTask = minio.ListBucketsAsync();

// Iterate over the list of buckets.
foreach (Bucket bucket in getListBucketsTask.Result.Buckets)
    Console.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);

Complete File Uploader Example

This example program connects to an object storage server, creates a bucket and uploads a file to the bucket. To run the following example, click on [Link] and start the project

using System;
using Minio;
using Minio.Exceptions;
using Minio.DataModel;
using System.Threading.Tasks;

namespace FileUploader
    class FileUpload
        static void Main(string[] args)
            var endpoint  = "";
            var accessKey = "Q3AM3UQ867SPQQA43P2F";
            var secretKey = "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG";
                var minio = new MinioClient()
            catch (Exception ex)

        // File uploader task.
        private async static Task Run(MinioClient minio)
            var bucketName = "mymusic";
            var location   = "us-east-1";
            var objectName = "";
            var filePath = "C:\\Users\\username\\Downloads\\golden_oldies.mp3";
            var contentType = "application/zip";

                // Make a bucket on the server, if not already present.
                bool found = await minio.BucketExistsAsync(bucketName);
                if (!found)
                    await minio.MakeBucketAsync(bucketName, location);
                // Upload a file to bucket.
                await minio.PutObjectAsync(bucketName, objectName, filePath, contentType);
                Console.WriteLine("Successfully uploaded " + objectName );
            catch (MinioException e)
                Console.WriteLine("File Upload Error: {0}", e.Message);

Running MinIO Client Examples

On Windows

  • Clone this repository and open the Minio.Sln in Visual Studio 2017.

  • Enter your credentials and bucket name, object name Minio.Examples/Program.cs Uncomment the example test cases such as below in Program.cs to run an example.

  //Cases.MakeBucket.Run(minioClient, bucketName).Wait();
  • Run the Minio.Client.Examples project from Visual Studio

On Linux

Setting .NET SDK on Linux (Ubuntu 22.04)
NOTE: minio-dotnet requires .NET 6.x SDK to build on Linux.
wget -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-6.0
Running Minio.Examples
  • Clone this project.

$ git clone && cd minio-dotnet
  • Enter your credentials and bucket name, object name etc. in Minio.Examples/Program.cs Uncomment the example test cases such as below in Program.cs to run an example.

  //Cases.MakeBucket.Run(minioClient, bucketName).Wait();
dotnet build --configuration Release --no-restore
dotnet pack ./Minio/Minio.csproj --no-build --configuration Release --output ./artifacts
dotnet test ./Minio.Tests/Minio.Tests.csproj

Bucket Operations

Bucket policy Operations

Bucket notification Operations

File Object Operations

Object Operations

Presigned Operations

Client Custom Settings

Explore Further