In 1674 Kerll moved to Vienna. A pension was granted to him in 1675 by the emperor, who in 1677 employed him as one of his court organists. Although it has been suggested that Kerll might have worked at the Stephansdom, there is no proof. If he did, however, Johann Pachelbel would have been his deputy organist there. The 1679 plague, commemorated by Kerll in "Modulatio organica", a collection of liturgical organ music, resulted in Anna Catharina's death. He married Kunigunde Hilaris in 1682/3 and stayed in Vienna for the next 10 years, surviving the Turkish invasion of 1683, which he also commemorated in music in "Missa in fletu solatium". He visited Munich several times between 1684 and 1692, publishing his "Modulatio organica" (1686) and "Missae sex" (1689, dedicated to the emperor) there. At the end of 1692 Kerll relinquished his Vienna position and returned to Munich, where he died shortly afterwards.