Vellum is similar, but there are direct free software equivalents, most notably Sigil, a GUI ePub creation tool. Alternatively, you could use Pandoc to assemble an ePub from Markdown (or any of the seemingly several thousand other markup dialects Pandoc knows). I ended up using Vellum for my book because it was incredibly smart about taking a DOCX file exported from Scrivener and turning it into a properly sectioned and tagged ePub, and adding new sections, artwork, metadata and overall book styling is trivially simple. Sigil and Pandoc are great, but they're also lower-level tools by comparison, with both the advantages and disadvantages that implies. For me personally, it was worth spending $30.
Self-publishing is also free or should be.
Well, it's as free as you want it to be. In my experience, YMMV and all other appropriate disclaimers, producing an ebook which seriously competes with ones from traditional publishers requires skill not just in writing but in editing, graphic design, typesetting (or ebook production), and (depending on the cover) illustration. If you have access to all those skills without spending any money, awesome, but it's kind of a tall order.
Now, to be fair, I could write the entire thing in Markdown and be happy. I don't need Scrivener. But for what it does and how well it does it, it's worth looking at.
Scrivener is US$40, Vellum is Mac-only and US$200, the other two are unnecessary/replaceable and IMHO should be a list of equivalent options -- once you have a manuscript, which can be created using any number of free tools.
Someone who imagines writing the Great American Novel, but who also expects to have to pay a premium for each step along the way, may not grasp the essence of novel writing -- how it fits into the big picture.
There are any number of free word processors able to organize a book project into chapters and sections. Self-publishing is also free or should be.
My favorite story about novel creation is that of Andy Weir and The Martian. Weir started the project as a series of blog posts, got very useful feedback from his readers, improved his content on that basis, and the project grew nearly on its own. By the time Weir wanted to talk to publishers, they already wanted to talk to him.