Hannes Gruber spent his youth at Oberrieden on Lake Zurich, where he did his first watercolours, drawing on motifs from the surrounding countryside. In 1942 he began to work in oils and a year later Hannes Gruber enrolled at the Zurich School for the Decorative and Applied Arts, where he studied under Ernst Gubler. Between 1944 and 1948 Hannes Gruber also served an apprenticeship in the graphic arts at the Orell Füssli Art Institute under Hans Vollenweider while also attending classes in painting taught by Ernst and Max Gubler at the Zurich School for the Decorative and Applied Arts.
From 1947 Hannes Gruber showed work regularly at the 'Züri Land' exhibition. In 1948 Hannes Gruber moved to Grevasalvas in the Upper Engadine and was commissioned by Remy Nüesch to paint large murals for Olma St. Gallen. Hannes Gruber's 1940s drawings and landscapes still reveal Gubler's influence. The move to Grevasalvas, a very remote place, allowed Hannes Gruber to embark on new paths which would determine the rest of his career.
Once a landscape painter, Hannes Gruber became a painter of light, developing what he called the "Theory of Surrounding Colour". The basic lines of his landscapes detached themselves from form, joined to form structures that were visually both novel and autonomous and gradually turned into abstract configurations.
Hannes Gruber spent the following years travelling to Italy, the Netherlands and Denmark to study art. In 1960 he became acquainted with Hans Neuenburg and, not long afterwards, met the painter Friedrich Kuhn through his friend Ernst Gloor. Hannes Gruber stayed in Sicily, Tuscany and Spain before settling once again in the Engadine in 1972.
Gruber painted, did illustrations and was commissioned to execute murals for the Fuhr school in Wädenswil near Zurich. During the 1970s Hannes Gruber worked in Ernst Gloor's Künstlerkeller and showed work regularly at cantonal art exhibitions mounted at the Kunsthaus Chur. He had a large-scale retrospective at the Stadthaus Uster in 1978.