I don't remember when I discovered that the movie was based off a book, but I know that I immediately looked into finding the audiobook and it sat waiting to be listened to for quite a while. Anyway, this should come as no surprise, but the movie is only very loosely based off the book. Secondly, this is one of those rare times where the movie tops the book. Although, admittedly the movie was much more predictable than the book because it follows such classic/traditional story lines.
The biggest similarities between the two is the names of people and places and to some extent the end where a big dragon is battled [although it is two in the book] and how Hiccup and his dragon go through that battle. Almost everything else is different. The book started with the youth attempted to catch a dragon to bring home and train. And all of the dragons are small, toothless is less than the length of Hiccup's arm. Furthermore the dragons are whiny, although this could have been a case of the reader making it worse, because he had a really good whining voice. The training does not go well for Hiccup and the premise of the book is that he has in his old age written an update to the old "How to Train Your Dragon" book which simply stated "Yell at it" or "Yell at it loudly".
There are a lot more books in the series, and I've heard rumors that DreamWorks intends to do a lot more movies, but I could leave it.