Removing the DRM from my Kindle books

A few months ago, Microsoft made headlines when they announced they’d be turning off people’s books. They were turning off the DRM servers behind their ebook store, and refunding customers for any books they’d bought. I never bought any books from Microsoft, but I do have a collection of Kindle books, and this story was a reminder to investigate ways to remove the DRM from those.

Google suggests that Calibre can do this with the right plugins, but I don’t use Calibre for anything else, and I want to install new software as little as possible. I prefer solutions that use command-line tools and (ideally) run inside Docker container – they tend to be much more portable between machines.

I’ve got a script that works now, which leans on two other tools to do the heavy lifting:

My script has a couple of extra pieces to upload the files to my ebook manager, which are very specific to my setup – the software I’ve linked above is more general, and hopefully a useful starting point for anybody else who wants to strip the DRM from their Kindle books.