After ordination as a deacon, Viilma was appointed as deacon in the parish of Keila. The same year he was appointed as deacon in the parish of Parnu-Jacobi, holding this post till 1998. Between 1998 and 2004 he was pastor of Pärnu-Jakobi. He also worked in the Pärnu Provincial Support Office between 1999 and 2003. He was also pastor of the parish of Mihkli, Tõstamaa and Vigala, respectively and simultaneously, between 1999 and 2004. Later he also held various positions within the Lutheran church of Estonia notably the head of the council of the Diocese of Tallinn between 2010 and 2015.