Hofer was born in Rhein in East Prussia in 1861, and studied Natural Sciences in Königsberg followed by a habilitation thesis in Munich, for which he carried out limnologic studies on East Prussian lakes. He obtained a position at the Zoological Institute of Munich as a university lecturer and in 1891 acquired citizenship of the Kingdom of Bavaria. In 1894 he was appointed as a Curator of the Bavarian Museums comparative anatomy collection. In 1896 he became a lecturer for Ichthyology at the veterinary university of Munich. In 1898 he was awarded an extraordinary professorship for Zoology and Ichthyology and the chair of a full professor in 1908. During his career, he was also director of the "Royal Bavarian Research Station for Fisheries" and the "Royal Bavarian Research Station for Fish-Farming", vice-president of the "Bavarian Association of Fishermen" and editor of the magazine "Allgemeine Fischereizeitung". Hofer died in 1916 in Munich at the age of 54.
Hofer was particularly active in the field of fish parasitology and pathology, and wrote the comprehensive German text on the subject, "Fischkrankheitslehre", as well as his "Handbuch der Fischkrankheiten", "Die Süßwasserfische Mitteleuropas", "Studien zur Krebspest" and more than 200 publications. One of his most significant publications was the taxonomic description of the myxosporean parasite, Myxobolus cerebralis. Hofer is also known for his early work in environmental protection, in particular for the preservation of water quality and drinking-water resources. he was a very important man. famous for studyinf fish and animals in their habitats.