Books about literaty theory have a long tradition; Aristotle's Poetics dates back to the 4th century BC. Books about how to write literature also go back a long way, for example, Horace's Ars Poetica (around 19 BC). And, of course, people have been studying and commenting on literature for many centuries. However, since many questions on this site are about the analysis or interpretation of literature, it seems worth asking when people (presumably academics) started teaching others how to do this.
In the English-speaking world, I assume that this started with the establishment of literature departments at universities during the 19th century. According to E.D.H. Johnson, writing about the Department of English at Princeton (my emphasis),
Until well through the nineteenth century, English studies at Princeton, as elsewhere, were regarded as incidental to preparation for the ministry, law, or public life, and as a result instruction concentrated on grammar and composition, rhetoric, and elocution.
Although the Rev. James W. Alexander, Professor of Belles- Lettres, delivered in 1838 what should probably be regarded as the first course of lectures in English literature, official recognition of this subject in the College catalogue had to wait until 1864 when John S. Hart was listed as ``Lecturer on English Literature.''
According to Paul Watt ("Criticism in late nineteenth-century England: Towards the regulation and reform of a profession in crisis"), writers in 19th-century England found that the quality of criticism had declined significantly, so
By the 1880s, however, concrete plans were hatched by English newspaper editors, intellectuals and critics—as well as assertive newspaper readers—to lift the standard of criticism in England. The highest priorities were the establishment of training programs for aspiring critics and the formulation of principles and methods to guide them.
This seems to imply that such "principles and methods" did not exist in the 1880s, even though some literature departments had been established by that time. For example, in Scotland:
The Chair of English Language and Literature at Glasgow University was established by the Universities Commission of 1858, its first Professor being John Nichol (1862-1889), making it one of the oldest Chairs in English Literature in Britain. Although English Literature had been taught in the University in one form or another for a century already by such well-known figures as Adam Smith , the first holders of the Chair of English Language and Literature had little precedents to follow, and none had ever attended a class in English or held a degree in the subject. These men determined the content and direction of the English class. Notable early occupants of the post included Andrew Cecil Bradley (1889-1900) and Walter Raleigh (1900-1904).
(A. C. Bradley is still remembered for his influential work Shakespearean Tragedy, published in 1904 and reprinted many times.)
But none of the above sources, nor the Wikipedia article Literary criticism make mention of books that teach readers how to analyse and interpret literature. So what was the first such book? Note that I am not interested in books that explain literary theory, but books like Terry Eagleton's How to Read Literature and How to Read a Poem.