Teixeira wore a beige jumpsuit and looked sullen when he appeared before a judge at the Massachusetts federal court in Boston at 10:00 a.m. (1400 GMT).
At one point his father shouted, “We love you Jack,” to which Teixeira replied: “Love you dad.”
He was not required to enter a plea and was placed in custody pending a hearing for next Wednesday.
Teixeira is suspected of posting some documents as recently as early March to a private chat group on the social media platform Discord.
The New York Times reported that Teixeira was the leader of a group called Thug Shaker Central and allegedly posted documents under the alias “OG”.
He first wrote down the contents of the classified documents to share with the group, but later began taking photographs, telling other members not to share them, according to The Washington Post.
Some of the documents later appeared on other sites including Twitter, 4Chan and Telegram.