The cost to build a pergola can vary between $2,138 and $6,341, with an average cost of $4,241.