His early schooling took place in Panevežys. He then completed his secondary education at the Šiauliai Gymnasium, graduating with honors. In 1874, he completed his studies at St. Petersburg University, with degrees in physics and mathematics. While at the university he had illegally distributed Lithuanian publications, which were forbidden due to the ban of the Lithuanian language by the Tsarist authorities. With two of his brothers, Jonas and Antanas, he belonged to the underground "Twelve Apostles" organization.
Later he accumulated a great fortune as a result of his work as an engineer, much of which he distributed to Lithuanian social organizations. Petras Vileišis established in 1904 the first legal Lithuanian-language daily newspaper Vilniaus žinios in Vilnius. He was also a patron of the arts and sponsored the First Lithuanian Art Exhibition, which took place at his palatial home in 1907.
- Nakas, Algimantas (2000). "Petras Vileišis - žymus geležinkelių ir tiltų inžinierius". Mokslas Ir Gyvenimas (in Lithuanian) (1). Archived from the original on 2006-09-27. Retrieved 2007-09-20.
- Aničas, Jonas (2000). "Petras Vileišis - Lietuvių tautos švietėjas". Žiemgala (in Lithuanian). 2. Archived from the original on 2007-10-22. Retrieved 2007-09-22.