Self-published Ansible book – 87k copies, 300k revenue, 41 revisions

I just published the 41st revision of my self-published book Ansible for DevOps, which has sold 87,234 copies as of this writing across LeanPub, Amazon (Kindle and paperback), and iBooks.

There are multiples of that number of eBooks downloaded, as I've never DMCA'ed the sites that re-host the book illegally. I just... provide new and better versions. People who download the illegal copies know they can come to me for the best reading experience. Plus, I provide free updates forever for anyone who's purchased or gotten the book free on LeanPub.

My self-published book earned $300,000+ in revenue over the past 9 years, and still earns enough every month to pay my health insurance bill (sans deductible)—which has soared to beyond $2,000/month! (Living with a pre-existing condition in the USA is... bad.)

I've had multiple offers to license the book through traditional publishers, but every one was a raw deal for me as an author. I earn between 30-80% of each book sale (depending on the channel), and the publishers' deals paled in comparison—at best 5-10% royalties, and that's after the revenue surpasses the advance royalty payment. Unless you're the next Steven King, traditional book publishing is not a route to sustainable writing income.

I am transparent in reporting my work, as I rely on the support of sponsors on Patreon and GitHub to sustain my work and open source development.

In fact, I finally completed the open-sourcing of my book's manuscript (all the code examples were free and open source from the start)—the book is now licensed as CC BY-SA, meaning if Red Hat likes, they could take my book, and republish it in its entirety, and even sell that downstream copy, and I am okay with that. They are free to do that, as long as they abide by the license and share it with the same license.

Here are some metrics which I hope you may find useful—especially if you are considering writing your own book.

Amazon and KDP dominate

Ansible for DevOps - Sales per channel

I started publishing my book on LeanPub, because I like the philosophy as publishing as you write. Readers can get value from the book even before it's complete, and putting your work out there early gives validation about what parts of the work are more valued than others.

Kind of the 'move fast and break things' philosophy, applied to a creative endeavor.

But once I published the first complete edition of the book to Amazon's bookstore, sales exploded—and have not let up. The book went into the top of the Linux-related Amazon rankings a few times in its lifetime, and despite Amazon's practices, it seems the majority of book readers find there way to that store.

I published on iBooks just to see what that could get, and... surprisingly there are still 10-20 people every month on that tiny platform who buy the book!

LeanPub is where I've given away the book for free numerous times—that's why you see those off-the-charts spikes—but it has also been a reliable source of sales over the years.

Ansible for DevOps - Bestsellers All Time number 3

I never thought Ansible for DevOps would be so popular (it's now the #3 bestseller all-time on LeanPub). In fact, I originally set a goal to have 100 readers by the time I completed writing the book.

Revenue: Significant, not life-changing

Ansible for DevOps - Royalties per month (total)

Total revenue on the book surpassed $300,000 this year. Averaged over 10 years, that is $30,000/year, which is not insignificant.

My salary as a software developer was multiples of that, however, so if I calculate my hourly earnings as a salaried employee versus the book income, I would barely be able to afford health insurance for my family of six—much less the $14,000 deductible we pay on top of that! Unless you are a serial author, or write multiple bestsellers, it is incredibly hard to write for a living, even without a family.

In addition, my writing is only useful inasmuch as it instructs. The chief complaint against some of the other introductory Ansible books is "this is about on par with the documentation, but it doesn't solve my problem."

I worked my examples backwards from real-world scenarios encountered in my day job. And it shows, because much of the code in the book utilizes the same open source libraries and Ansible content I wrote to assist multiple Fortune 500 companies.

In that way, the book has been a positive feedback loop, especially considering I have been testing all the book's examples in CI against every Ansible version for a decade now.

The book is certainly good for self-marketing, though besides a short stint consulting for Red Hat, I don't think the book has led directly to any individual business contract. I think the writing process itself benefitted my career more than the published work.

I wrote the book mainly because (a) writing a book was a bucket-list item for me, and (b) I already had a lot of in-depth blog posts to kick-start the first three chapters. I was not planning on writing almost 500 pages (my initial target was 100), but I became a lot more involved in the writing than I originally intended.

YouTube channel growth 2020-2023

As I write 2,000 word scripts for my weekly YouTube videos, the ability to both get words on paper (well, on a screen), and hone those words down to a fine point, has helped my YouTube channel grow to the point of sustaining my family.

Book Progress

And speaking of word counts:

Ansible for DevOps - Word Count Over Time

I wrote the following script to calculate how many words were in all .txt files in my book's manuscript over time (note that there are a few txt files full of metadata that inflates this number, but only a little):

# Count all lines in .txt files in a repository for each commit.
for commit in `git rev-list --all`; do
    commit_date=$(git log -n 1 --pretty=%ad --date=iso-strict $commit)
    # On GNU tar, add `--wildcards --no-anchored` options
    wordcount=$(git archive $commit | tar -x -O '*.txt' | wc -w | xargs)
    echo "$commit_date,$wordcount"

I have found it useful to reflect back on the progress this book has made over the years, and I'm proud to finally have had time to make the manuscript public. I intended on doing it much earlier, but until recent events, I didn't have sufficient motivation to devote a few hours into the process.


Love the book and the many wonderful updates, bought it what seems long ago and is still a reference book for myself and one I recommend to others entering the space. Thanks for all your hard work!

Thank you so much for writing this. I downloaded it for free (after YOU posted the FREE link as a reply to someone else in a reddit thread), but after burning through it and having learned an immense amount of usable information in a short time of being incredibly engaged, I had to go back and send a payment on LeanPub. I've been a follower of your work since. Thank you for you work, your efforts, and your philosophies

As someone who lives on a disability pension because of what Americans call a "pre-existing condition" (ie. a disabling chronic illness), that health insurance bill is more than my entire monthly pension, even without converting to Australian dollarydos.

America is scary. Love to my American brethren who have to live that life. It's not a good one, and it's not one anyone deserves.

You have piqued my curiosity. I am Brazilian and I am embarking on this field. Your book will be of great help on my journey

So great to hear! I've read the book, and at two different jobs I've had the company buy it for my employees and used it as a book club to learn Ansible. And I'm planning on doing the same at my new company!

I bought a physical copy of this book a couple months ago to bring into work! I got about half way through it before I decided to slow down so my home lab can catch up, then subsequently forgot everything when my home lab didn't catch up, lol. However, I really enjoyed the book and the cowsay at the end of every chapter was a fun bonus! Oh, and thanks for doing the standard textbook cliche of pretending that every reader of this programming book doesn't know how to program and therefore needs to know everything in excruciatingly painful detail. Your dedication to real world examples and use cases speaks to the way I taught myself programming.

Hehe well I know for my own learning, I like having every last little detail spelled out, because my dense brain won't remember to do things right if I don't remind myself how to do 'em!

Thanks Jeff! I've enjoyed your channel for some time now, and I really appreciate this gift.

You have climbed to the second position as best selling book on leanpub! Congratulations Jeff!

Roger Peng we are coming for you!