Fast migration from the cloud S3 storage to your own min.io

Vitaly Liber
2 min readSep 8, 2019

--

I used wasabi.com for two years. It has a cheap price and works well. But one month ago I started to have big delays before previewing images on my website. The support of Wasabi confirmed that they had a problem with high load on their cluster.

I started to research what I should do and what I expected from S3:

  • S3 service and web-server should be placed in the same region
  • S3 service should have a cheaper price
  • S3 service must have https
  • It has to work fast

I decided to use Open Source Minio with my own VPS server. It will be tutorial how you can repeat my solution for your web apps.

First of all we can buy VPS with Volume. If you will need more disc space you can resize volume. I bought simple VPS hetzner.cloud for 3 euros and 10GB volume for 50 cents.

Notice you must stop your VPS before resizing the Volume.

Run traefik docker container on your VPS. It has built in Let’s Encrypt support. Please see official docs below.

After that you should configure minio server via docker-compose file.

You need to replace “traefik.frontend.rule” to your domain name. SSL certificate will be generated automatically. Also don’t forget to replace MINIO_ACCESS_KEY and MINIO_SECRET_KEY.

Try to find the Volume via command:

df -h

It looks like “/mnt/HC_Volume_3208452/minio”. Replace this string in minio docker-compose file and run it.

docker-compose up -d

Check your minio web panel after that. If it works you can start a files migration process.

Install minio client to your mac:

brew install minio/stable/mc

Put minio and S3 cloud credentials to minio client config:

nano ~/.mc/config.json

Start the files migration process:

mc mirror wasabi/backet minio/backet

That’s all. You can try to switch your app to minio server.

If you use Active Storage you must pass “force_path_style: true” param to service options.

It will look like:

Thank you for reading!

My Instagram:

https://www.instagram.com/vitalyliber

My Courses:

Deploy apps with Dokku (Russian)

--

--

Vitaly Liber

Full Stack Engineer (React Native, Expo, Next.js, Ruby on Rails)