A teenager who caused a $1 million school fire has avoided going to jail.

Edward Brian White, 19, cried and hugged his family as he was let out of the dock.

The Adelaide District Court heard he set fire to a timber walkway at his former school last July and the fire quickly spread to adjoining classrooms at Unley High.

Judge David Lovell said White was an immature young man with attention-seeking tendencies.

"You thought that by causing some damage you would impress your friends. You drove a short distance away and became upset when you saw the fire had gone out of control," the judge said.

"You borrowed your friend's phone to call emergency services and informed them about the fire. You decided to go back to see what had happened.

"You were interviewed by at least one TV crew. You told them you had observed the fire and raised the alarm."

Boasted

Judge Lovell said authorities had little trouble catching White.

"You clearly enjoyed the attention that the media had laid upon you. You boasted on Facebook about what you had done and made admissions on Facebook about lighting the fire. This shows your immaturity," he said.

"It did not take long for police to track you down."

The court heard White had described himself as the 'class clown'.

Judge Lovell said he accepted White did not intend to cause so much damage and suffered from anxiety and depression.

The court heard White had been bullied at primary school and Judge Lovell said the teenager was easily influenced by others as he sought acceptance.

"You are immature for your age and you suffer from psychological conditions," he said.

Disruptive

Judge Lovell said his decision to suspend a four-year jail sentence, with two-year non-parole, and impose a good behaviour bond had been difficult because of the serious nature of the crime.

But he said the teenager was unlikely to reoffend.

The court heard the fire caused significant disruption to school activities, students lost their work and teachers lost up to 10 years of work.

"You have some insight into what you have done and the effect it has had and continues to have on those involved with Unley High School," the judge said.

White's lawyer said outside court the teenager had made a formal apology to the school and was remorseful, but keen to get on with his life.

Unley principal Susan Cameron said she had mixed feelings about the sentence.

"I'm pleased for Eddie [but] I know there are some members of my community though who would've expected him to go to jail for his actions," she said.