This article covers using MinIO object storage to sync Obsidian. MinIO is a high-performance, open-source object storage server that provides reliable data storage and access.
1. Installing the MinIO Server
We can install the MinIO server using Docker by running the following script:
docker run -p 8090:8090 -p 8091:8091 \
-name minio \
-d --restart=always \
-e "MINIO_ACCESS_KEY=minioadmin" \
-e "MINIO_SECRET_KEY=minioadmin" \
-v /home/chinglin/fastdata/.minio/data:/data \
-v /home/chinglin/fastdata/.minio/config:/root/.minio \
minio/minio server \
/data --console-address ":8090" -address ":8091"
Explanation:
MINIO_ACCESS_KEYandMINIO_SECRET_KEY: default tominioadminandminioadmin; you don’t have to change them.- The console address,
8090, is used to configure the entire service. - Address
8091is used to access files — the MinIO client uses this port.
If you also want external access, for example through http://server_ip:8090, open the corresponding firewall port.
2. The MinIO Client
You can use MinIO’s own mc client, or rclone.
2.1. Installing mc
- Follow the instructions here to install it.
- Installing the Mac client:
brew install minio/stable/mc - Installing the Linux client:
dnf install https://dl.minio.org.cn/client/mc/release/linux-amd64/mcli-20230128202938.0.0.x86_64.rpm mcli alias set myminio/ http://MINIO-SERVER MYUSER MYPASSWORD
2.2. Configuration
Visit localhost:8090 and create a bucket named bucket_name. Obtain the access_key and access_secret_key.
Set an alias:
mc alias set alias_name oss_url access_key access_secret_key
2.3. Basic operations
- List bucket information:
mc ls alias_name/bucket_name - Download a file:
mc cp alias_name/bucket_name/file_name local_path - Upload a file:
mc cp local_path alias_name/bucket_name/ - Delete a file:
mc rm alias_name/bucket_name/file_name
3. Configuring Obsidian and Reverse-Proxying with Cloudflare
3.1. Configuring Obsidian
Install Obsidian’s third-party plugin remotely-save. Choose S3 as the remote storage backend. Set the bucket name to localhost:8091/bucket_name, and leave the region at its default value.
3.2. Reverse-proxying with Cloudflare
Cloudflare is a powerful web service provider that can reverse-proxy our MinIO service, improving both access security and performance.
- Register and log in to a Cloudflare account.
- Add your domain, and follow the prompts to configure DNS, pointing the domain at your MinIO server’s IP address.
- In the Cloudflare dashboard, find the “Crypto” tab and set SSL/TLS encryption to “Full” or “Flexible” to secure data in transit.
- Create a new proxy rule that forwards requests to your MinIO server’s address. For example, if your MinIO server address is
http://your_minio_server_ip:8091, set the proxy rule to forward all requests there. - Configure caching settings to improve access speed. You can set the cache duration and caching rules based on your needs.
Using Cloudflare as a reverse proxy hides the MinIO server’s real IP address, improving security. At the same time, Cloudflare’s global network can speed up data transfer and improve the user experience.
4. Summary
By installing a MinIO server, accessing it with the MinIO client, and configuring Obsidian, we can use MinIO object storage to sync Obsidian. This setup is performant, reliable, and flexible enough to meet typical data storage and sync needs.
In practice you can further optimize the configuration to your own needs — for example, adjusting bucket permission settings or encrypting data to improve security. You can also combine this with other tools and techniques, such as backup strategies and monitoring systems, to ensure data integrity and availability.