Nakayama algebras appear in modular representation theory of groups and they are defined as a quotient of the algebra of upper triangular matrices. In this talk we will explain the connection of these algebras with two combinatorial objects: the 321-avoiding permutations and the Dyck paths. We will use these objects to explain the representation theory and homological algebra of Nakayama algebras (joint work with René Marczinzik).