# MinIO Tutorial: S3 Storage You Run on Your Own Server

## Quick answer

MinIO is object storage that speaks the Amazon S3 API, and you run it on your own server instead of renting space from Amazon. You create buckets, store files as objects, and fetch them back with the same tools that talk to S3. This post starts a MinIO server on your own machine, stores five shop orders with the Python client, totals Rs 81,800, and fixes the two errors every beginner meets first.

Every order your shop takes leaves a trail: an invoice PDF, a payment receipt, a photo of the packed parcel. At first they sit in a folder on the app server. Then the disk fills, a second server needs the same files, and a backup means copying a folder by hand. Amazon S3 solves all of that, but it means an Amazon account, a card on file, and your customer data in someone else's data centre. MinIO offers a third path: the same S3 API on a server you control. This post runs it locally and stores five real orders in it.

## What I would check before using it

My first check is how you will get the server. The download at dl.min.io now answers 410 Gone: the open-source server, client, and KES projects are archived and no longer maintained. The demo below builds the server from source instead, but that makes you the one keeping the binary current. If you will skip that chore, a managed S3 service is the safer pick.

My second check is what a single drive can promise you. The demo runs one server with one drive, which is fine for learning and for a small shop, but it has no redundancy: if that disk dies, the objects go with it. Real durability needs erasure coding across four or more drives, or backups you actually test.

My third check is which S3 calls your code really needs. The core API, buckets, objects, listing, downloads, works with the standard clients, and the demo uses the official Python library. If your app leans on newer AWS only features, test those calls against MinIO before you commit.

My fourth check is security, because MinIO trusts whoever holds the keys. The demo uses the well known default user and a simple password on a local port: fine on your own machine, a breach waiting to happen on a public server. Change the credentials, put the API behind TLS, and keep the console port closed to the internet.

My verdict, as judgement: adopt MinIO when you want the S3 API without an AWS account and are willing to own the server, the disk, and the backups. The recommendation flips if you need someone else to keep the service patched and durable, or if you only need files on one machine, because a plain folder with a backup is simpler.

## Five shop orders stored on your own S3 server

The demo is a small shop with five orders: Bilal and Hira in Karachi, Fatima and Ahmed in Lahore, Usman in Islamabad. Each order becomes one JSON file in a bucket called shop-orders, then one file is downloaded back to prove the round trip works. The upload could sit inside the checkout handler from the [Build Your First REST API With Node.js and Express](https://practicaldevblog.blogspot.com/2026/10/build-your-first-rest-api-with-nodejs.html) post; here it runs alone.

First the server, built from source in the verification step, with a local data folder and the API on port 9000:

```
$ MINIO_ROOT_USER=minioadmin MINIO_ROOT_PASSWORD=minioadmin123 ./minio-built server ./data --address 127.0.0.1:9000 --console-address 127.0.0.1:9001
INFO: Formatting 1st pool, 1 set(s), 1 drives per set.
MinIO Object Storage Server
Version: DEVELOPMENT.GOGET (go1.23.2 linux/amd64)
API: http://127.0.0.1:9000
WebUI: http://127.0.0.1:9001
Docs: https://docs.min.io
```

Then the Python client:

```
$ pip install minio
$ python -c "import minio; print(minio.__version__)"
7.2.20
```

The script creates the bucket, writes each order to a JSON file, uploads it, lists the bucket, downloads one order back, and totals the shop by city:

```python
"""Store five shop orders as JSON files in a local MinIO bucket."""
import json
import os
from minio import Minio

ORDERS = [
    {"id": "ORD-601", "customer": "Bilal", "city": "Karachi", "total": 18900},
    {"id": "ORD-602", "customer": "Fatima", "city": "Lahore", "total": 14250},
    {"id": "ORD-603", "customer": "Usman", "city": "Islamabad", "total": 22100},
    {"id": "ORD-604", "customer": "Hira", "city": "Karachi", "total": 9750},
    {"id": "ORD-605", "customer": "Ahmed", "city": "Lahore", "total": 16800},
]

client = Minio(
    "127.0.0.1:9000",
    access_key="minioadmin",
    secret_key="minioadmin123",
    secure=False,
)

BUCKET = "shop-orders"
client.make_bucket(BUCKET)
print(f"Bucket {BUCKET} created.")

os.makedirs("orders", exist_ok=True)
for order in ORDERS:
    path = f"orders/{order['id']}.json"
    with open(path, "w") as f:
        json.dump(order, f)
    client.fput_object(BUCKET, f"{order['id']}.json", path)
    print(f"Uploaded {order['id']} ({order['customer']}, {order['city']}, Rs {order['total']:,})")

print("Objects in shop-orders:")
for obj in client.list_objects(BUCKET):
    print(f"  {obj.object_name} ({obj.size} bytes)")

downloaded = client.get_object(BUCKET, "ORD-603.json")
order_back = json.loads(downloaded.read())
downloaded.close()
downloaded.release_conn()
print(f"Downloaded ORD-603.json back: {order_back}")

totals = {}
grand = 0
for order in ORDERS:
    totals[order["city"]] = totals.get(order["city"], 0) + order["total"]
    grand += order["total"]
print("Shop order totals by city (Rs):")
for city in sorted(totals):
    print(f"  {city}: Rs {totals[city]:,}")
print(f"Grand total: Rs {grand:,} across {len(ORDERS)} orders")
print(f"All {len(ORDERS)} orders stored and verified.")
```

```
$ python demo.py
Bucket shop-orders created.
Uploaded ORD-601 (Bilal, Karachi, Rs 18,900)
Uploaded ORD-602 (Fatima, Lahore, Rs 14,250)
Uploaded ORD-603 (Usman, Islamabad, Rs 22,100)
Uploaded ORD-604 (Hira, Karachi, Rs 9,750)
Uploaded ORD-605 (Ahmed, Lahore, Rs 16,800)
Objects in shop-orders:
  ORD-601.json (73 bytes)
  ORD-602.json (73 bytes)
  ORD-603.json (75 bytes)
  ORD-604.json (71 bytes)
  ORD-605.json (72 bytes)
Downloaded ORD-603.json back: {'id': 'ORD-603', 'customer': 'Usman', 'city': 'Islamabad', 'total': 22100}
Shop order totals by city (Rs):
  Islamabad: Rs 22,100
  Karachi: Rs 28,650
  Lahore: Rs 31,050
Grand total: Rs 81,800 across 5 orders
All 5 orders stored and verified.
```

All five orders are in, and the totals check out: Karachi Rs 28,650, Lahore Rs 31,050, Islamabad Rs 22,100, a grand total of Rs 81,800. Now the thing that goes wrong: uploading into a bucket that was never created.

```python
import io

client.put_object("missing-bucket", "ORD-999.json", io.BytesIO(b'{"id": "ORD-999"}'), 17)
```

```
Trying to upload into a bucket that does not exist...
Upload failed: S3 operation failed; code: NoSuchBucket, message: The specified bucket does not exist, resource: /missing-bucket, request_id: 18EC17D8FEE8E20D, host_id: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8, bucket_name: missing-bucket
Trying to list buckets with the wrong secret key...
List failed: S3 operation failed; code: SignatureDoesNotMatch, message: The request signature we calculated does not match the signature you provided. Check your key and signing method., resource: /, request_id: 18EC17D8FF0C977E, host_id: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8
```

The fix for the first error is the line the demo already runs: create the bucket first with make_bucket, then upload into it. The fix for the second is to check the secret key exactly, because a single wrong character gives the same signature error as a completely wrong key.

## Common mistakes and how to fix them

First, uploading into a bucket that does not exist. The symptom is an S3Error with code NoSuchBucket and the message "The specified bucket does not exist". The fix is to create the bucket with make_bucket before the first upload.

Second, a wrong secret key. The symptom is an S3Error with code SignatureDoesNotMatch and the message about the request signature not matching. The fix is to compare the key with the server's root password exactly, because the error never points at the wrong character.

Third, forgetting that the local server speaks plain HTTP. The symptom is a MaxRetryError with an SSLError saying WRONG_VERSION_NUMBER, because the client tried HTTPS by default. The fix is to pass secure=False locally, and to switch it on with real TLS before the server faces the internet.

Fourth, an invalid bucket name. The symptom is a ValueError saying "invalid bucket name Shop_Orders". The fix is to use lowercase letters, numbers, dots, and hyphens only, with no underscores and no uppercase.

## Frequently Asked Questions

Is MinIO a replacement for Amazon S3? It replaces the API, not the service. Your code talks to MinIO as it talks to S3, but you own the disks.

Is MinIO free? Yes, the core is open source under the GNU AGPLv3 licence, and the Python client is free too. Paid editions exist for support.

Can I use the same code against real S3 later? Mostly yes. Point the client at s3.amazonaws.com with real credentials and your put and get calls work the same way.

How is MinIO different from a folder on disk? A folder gives you files on one machine. MinIO gives you buckets, objects, and an API any server in your fleet can reach over HTTP.

Does MinIO back up my files? No. It stores them and can spread them across drives, but a backup is a separate copy you have to arrange.

## What to remember

- MinIO speaks the S3 API from your own server, and the same code works against real S3.
- Create the bucket before the first upload, or it fails with NoSuchBucket.
- A wrong secret key fails with SignatureDoesNotMatch, and the message never says which character.
- The local server speaks plain HTTP, so the client needs secure=False until TLS is in place.
- One drive means no redundancy: disk, backups, and patching are your job.

## Where this leaves you

MinIO earns its place when your shop outgrows a folder on one server but is not ready to hand its files to Amazon. The demo showed it honestly: five orders stored and totalled at Rs 81,800, one order downloaded back intact, and two plain errors with plain fixes. The price is ownership: you keep the server yourself, since the download page no longer serves the binary. If that trade sounds fair, build it from source, create one bucket, store one real file, and download it back first.

## Further reading

- [MinIO Linux documentation](https://min.io/docs/minio/linux/index.html)
- [MinIO Python SDK documentation](https://min.io/docs/minio/linux/developers/python/minio-py.html)
- [Docker Explained: Containers Without the Confusion](https://practicaldevblog.blogspot.com/2026/10/docker-explained-containers-without.html)
- [PostgreSQL Explained: The Reliable Database You Default To](https://practicaldevblog.blogspot.com/2026/10/postgresql-explained-database-you.html)
- [Redis Explained: The In-Memory Store That Speeds Things Up](https://practicaldevblog.blogspot.com/2026/10/redis-explained-in-memory-store-that.html)
- [FastAPI Explained: Python APIs at Full Speed](https://practicaldevblog.blogspot.com/2026/10/fastapi-explained-python-apis-at-full.html)
- [Build Your First REST API With Node.js and Express](https://practicaldevblog.blogspot.com/2026/10/build-your-first-rest-api-with-nodejs.html)

Waqas Shahid is a software engineer from Karachi with more than 12 years of experience, including 6+ years in engineering leadership. He writes The Practical Developer.
