Do I have to be ordinarily resident in the municipality for 30 days prior to the election day to be able to vote?

Yes. The same residency considerations as detailed above need to be considered for voting, as well as running as a candidate.