Pyli (Greek: Πύλη meaning "gate", before 1927: Δερβενοσάλεσι - Dervenosalesi) is a village and a community in Boeotia, Greece. Its population in 2011 was 652 for the village and 745 for the community, which includes the villages Lefka, Panakto and Prasino. It was the seat of the former municipality of Dervenochoria.
Pyli is situated at the eastern edge of the Pastra mountain. It is in a sparsely populated area, dominated by agriculture and forestry. It is 5 km west of Skourta, 19 km north of Elefsina and 20 km southeast of Thiva.