November 21, 2016 · Setup Guides ·

Backup Your Dusty Old Files Using Minio

For a while now I have been looking for an easy way to archive files from my Raspberry Pi to somewhere in the web.

Just recently, a workmate pointed me towards Minio. It is a simple S3-compatible object storage server. I decided to try it out and the experience has been good to me so far. Paired with their own Minio Client tool, it seems to be a good way to back up my photo albums.

Here's my setup and some short instructions on how I installed things.

The Server

For the server, I have Minio running on a DigitalOcean VPS. Files are stored in an attached block storage volume so I'd be able to resize it as needed.

This can also be installed in a Raspberry Pi or a DIY NAS.

Install the Minio Server

Installing Minio on an Ubuntu 14.04 server is pretty easy. Just select and download the binary for your OS here.

I downloaded it under /usr/local/bin so I can run the command from anywhere without specifying the path.

cd /usr/local/bin
sudo wget
sudo chmod +x minio

Generate keys

In Ubuntu, a quick way to generate keys is through the apg tool.

apg -m 20

apg -m 40

Run the Minio Server

I saved this in a file for convenience.

export MINIO_ACCESS_KEY=ujReugtaigVirOmegMyn
export MINIO_SECRET_KEY=beorruphHadsinCezdoartoadNihomRucovIjEs/
minio server --address=:9000 "~/minio-files" >>/var/log/minio.log 2>&1 &

Test your installation by going your browser and entering http://your-url-or-ip:9000. This should open the Minio browser login page. Copy and paste the keys you set a while ago, submit the form, and you should be able to login.

The Client

There are a couple of ways to do uploads. One is through the awscli tool, which is pretty cool if you are already familiar with the AWS ecosystem.

Personally, I like to use Minio's own mc tool which allows seamless switching between multiple configs. It can even be used to sync my actual AWS S3 buckets!

Install the Minio Client

Since I am also running Ubuntu 14.04, installing mc was pretty straightforward. Just download, add execute permission, and you're good to go.

cd /usr/local/bin
sudo wget
sudo chmod -x mc

Note: On my Raspberry Pi, the mc command conflicts with midnight commander, so I downloaded it under /opt/mc and run it with the absolute path instead.

Try it out by running mc. This should give you the help screen.

  mc - Minio Client for cloud storage and filesystems.


  ls		List files and folders.
  mb		Make a bucket or folder.
  cat		Display contents of a file.
  pipe		Write contents of stdin to one target. When no target is specified, it writes to stdout.
  share		Generate URL for sharing.
  cp		Copy one or more objects to a target.
  mirror	Mirror folders recursively from a single source to single destination.
  diff		Compute differences between two folders.
  rm		Remove file or bucket [WARNING: Use with care].
  events	Manage bucket notification.
  watch		Watch for events on object storage and filesystem.
  policy	Set public policy on bucket or prefix.
  session	Manage saved sessions of cp and mirror operations.
  config	Manage configuration file.
  update	Check for a new software update.
  version	Print version.


For other OS's check out their install guide.

Setting up your local configs

Create a new host. In this example, we set our newly created Minio Server as a new host named backups.

# mc config host add <host> <url> <access-key> <secret-key>

mc config host add backups http://your-url-or-ip:9000 ujReugtaigVirOmegMyn beorruphHadsinCezdoartoadNihomRucovIjEs/

Create a bucket

# mc mb <host>/<remote-directory>

mc mb backups/2016-october-arduino-pics

Start syncing

Sync local directory with created bucket using the mirror command.

# mc mirror <local-directory> <host>/<remote-directory>

mc mirror 2016-october-arduino-pics backups/2016-october-arduino-pics


Minio is a good alternative to S3 if you prefer to host your files yourself.

It is great for backing up files like photo archives that don't often change. I would not recommend it as a way to sync frequently changing documents between devices like you would with Dropbox or BitTorrent Sync.

Although I prefer the Minio Browser's simplicity when compared to the AWS dashboard, controls might be too limited for some users. There is no way to edit/delete files from the dashboard. Also, S3 could be a cheaper option than hosting this on a DO droplet.

I am honestly a bit torn between the Minio server and S3 for my backups, but I definitely appreciate the convenience the mc tool provides and would probably use it regardless of the host I use.