Described herein are compounds, such as compounds of formula (I) and pharmaceutically acceptable salts thereof, that inhibit ALK2 and its mutants, pharmaceutical compositions including such compounds, and methods of using such compounds and compositions