In 2006, he retired and took over as head coach for Stavanger IF, guiding the club to promotion to the second division. At the end of the season, Nilsen left the club to take up the assistant coach position at the Norwegian top-flight side Viking.[8] After manager Uwe Rösler left in November 2009 he was briefly caretaker manager.[9] He was downsized from his assistant job after the 2010 season.[10]