Gracia takes over from Jose Luis Mendilibar, who was sacked on Tuesday with Osasuna rooted to the bottom of the Primera Division standings after losing their opening three games this season.
Osasuna did not take long to name Mendilibar's replacement, with Pamplona-born Gracia the man tasked with trying to lead his home-town club out of trouble.
The 43-year-old guided Almeria to promotion to La Liga last term through the play-offs before leaving the club in the summer, having failed to reach an agreement on a new contract.
The new man in the hotseat will be presented on Thursday, immediately after overseeing his first training session.
"Osasuna and Javier Gracia at 1700 (CET) this (Wednesday) afternoon signed a contract for the coach to take charge of the first team, along with (assistant) coach Juan Solla," read a statement on www.osasuna.es.
"The contract binds Javier Gracia and Juan Solla with Osasuna over the next two years.
"Javier Gracia will take training on Thursday from 1000 (CET) and will then be presented at the Instalaciones de Tajonar, accompanied by president Miguel Archanco."
His first competitive game in charge is set to be Osasuna's away match against Getafe when the Primera Division resumes after the international break.