Haydn's experience in Hainburg was good for his musical abilities, but bad for his soul. The young boy was often left without much to eat during his time there, and was not given the same love he might have received from his parents. When the musical director of a church in Vienna offered to take Haydn as a chorister at age eight, his parents accepted.
Haydn spent nine years at St. Stephen's Cathedral in Vienna, but when his voice changed, he was expelled from the school. Haydn began doing odd jobs to make money, and taught himself music theory, eventually he worked his way up to becoming the musical director for count Ferdinand Maximilian von Morzin. It was in this position that he composed his first symphony.
Haydn's wife Anna. Unauthenticated miniature attributed to Ludwig Guttenbrunn (Burgenländisches Landesmuseum)
In 1760 he married Maria Anna Aloisia Appolonia Keller, they never had children. A year later, Haydn became assistant music director for Esterhazy family, his kindness to the staff and good nature here earned him the title "Papa" by many of the musicians and later earned him the post of musical director.
As a "house officer" in the Esterházy establishment, Haydn wore livery and followed the family as they moved among their various palaces, most importantly the family's ancestral seat Schloss Esterházy in Eisenstadt and later on Esterháza, a grand new palace built in rural Hungary in the 1760s. Haydn had a huge range of responsibilities, including composition, running the orchestra, playing chamber music for and with his patrons, and eventually the mounting of operatic productions. Despite this backbreaking workload, the job was in artistic terms a superb opportunity for Haydn. The Esterházy princes (Paul Anton, then from 1762–1790 Nikolaus I) were musical connoisseurs who appreciated his work and gave him daily access to his own small orchestra. During the nearly thirty years that Haydn worked at the Esterházy court, he produced a flood of compositions, and his musical style continued to develop.
FRANZ JOSEPH HAYDN, THE VIOLINIST SIMON, AND MEMBERS OF THE ESTERHAZY FAMILY
Wolfgang Amadeus Mozart who Haydn had met sometime around 1784 were good friends and according to later testimony by Michael Kelly and others, the two composers occasionally played in string quartets together. Haydn was hugely impressed with Mozart's work and praised it unstintingly to others. Mozart evidently returned the esteem, as seen in his dedication of a set of six quartets, now called the "Haydn" quartets, to his friend. In 1785 Haydn was admitted to the same Masonic lodge as Mozart, the "Zur wahren Eintracht [de]" in Vienna.