Oscar Ramiro-Ortega Hernandez made a brief appearance with his lawyer in US District Court in Washington.
Ortega is accused of firing shots at the White House on the night of November 11. Obama and his wife Michelle were not home at the time.
Ortega was arrested several days after the shooting in Pennsylvania.
The indictment includes charges of attempting to assassinate the president, transporting a firearm across state lines and assaulting a US employee with a deadly weapon.
Prosecutors say Ortega harboured fantasies of killing the president.
Ortega is scheduled to make another appearance in court next month.