Skip to content

poul0315/minio_synology_NAS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

MinIO on Synology NAS (S3-Compatible Object Storage Setup)

This guide walks you through setting up a self-hosted MinIO object storage solution on your Synology NAS using Container Manager. This provides a fully private, S3-compatible storage backend suitable for backend services like Flask, Node.js, or Python scripts.


1. Create a Folder on NAS for MinIO Storage

  1. Open File Station on your NAS

  2. Create a folder:

    • Name: your_name
    • Location: /volume1/minio_data
    • Permissions: Grant read/write to the appropriate user

2. Install MinIO Using Container Manager

  1. Open Package Center
  2. Search for and install Container Manager
  3. Open Container Manager
  4. Go to the Registry tab and search for minio
  5. Download the official minio/minio:latest image

3. Create and Configure MinIO Container

Basic Settings:

  • Container Name: minio
  • Image: minio/minio:latest
  • Enable auto-restart: ✅

Port Settings:

Local Port Container Port Protocol
9000 9000 TCP
9001 9001 TCP

Volume Settings:

Host Path Container Path Read-Only
/volume1/minio_data /data ❌ No

Environment Variables:

  • MINIO_ROOT_USER=your-access-key
  • MINIO_ROOT_PASSWORD=your-secret-key

Command:

server /data --console-address :9001

Network:

  • Use default bridge mode

4. Setup MinIO in Web Console

  1. Access the MinIO Console:

    • URL: http://<your-nas-ip>:9001
  2. Login using the access key and secret key defined earlier

  3. Create a bucket:

    • Example: app-file
  4. Create an Access Key:

    • Go to Access > Users and create a new user
    • Save the generated Access & Secret keys securely
  5. Assign a custom policy:

{
 "Version": "2012-10-17",
 "Statement": [
  {
   "Effect": "Allow",
   "Action": [
    "s3:GetObject",
    "s3:ListBucket",
    "s3:PutObject",
    "s3:DeleteObject"
   ],
   "Resource": [
    "arn:aws:s3:::app-file",
    "arn:aws:s3:::app-file/*"
   ]
  }
 ]
}

5. Test Functionality Using Python (Boto3)

Upload an Image

import boto3
from botocore.client import Config

s3 = boto3.client(
    's3',
    endpoint_url='http://<your-nas-ip-address>:9000',
    aws_access_key_id='your-access-key',
    aws_secret_access_key='your-secret-access-key',
    config=Config(signature_version='s3v4'),
    region_name='us-east-1'
)

s3.upload_file(
    Filename='test-image2.jpg',
    Bucket='your-file',
    Key='uploads/test-image2.jpg',
    ExtraArgs={'ContentType': 'image/jpeg'}
)

Retrieve a Pre-Signed Image URL

def get_presigned_image_url(image_key: str, expires_in: int = 86400) -> str:
    return s3.generate_presigned_url(
        'get_object',
        Params={'Bucket': 'your-file', 'Key': image_key},
        ExpiresIn=expires_in
    )

image_key = 'uploads/test-image.jpg'
url = get_presigned_image_url(image_key)
print("Image URL:", url)

Delete an Image

def delete_image(image_key: str):
    response = s3.delete_object(Bucket='your-file', Key=image_key)
    return response

image_key = "uploads/test-image.jpg"
delete_image(image_key)

6. Build Your App

You can now:

  • Store permanent image keys in your DB
  • Upload, view, and delete images securely
  • Avoid paying for AWS S3 or Azure Blob. Full private cloud on your NAS!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors