You can marry according to the local administrative procedures of your country of residence, provided you meet the substantive conditions of Moroccan marriage (art. 14):
- the offer and the acceptance;
- the capacity of the spouses;
- the presence of the matrimonial guardian (wali), where applicable;
- the absence of legal impediments;
- the non-waiver of the sadaq (dowry);
- the presence of two Muslim witnesses at the session concluding the marriage contract (art. 14).
Next, a filing formality is mandatory. You must file a copy of the contract within three months of its conclusion with the Moroccan consular services of the place where it was concluded (art. 15). Where there are no such services, the copy is sent, within the same period, to the ministry in charge of foreign affairs, which forwards it to the civil registry officer and to the family-justice section of each spouse's place of birth. If one of the spouses was not born in Morocco, the copy is sent to the family-justice section of Rabat and to the Crown Prosecutor at the Court of First Instance of Rabat (art. 15).
Note: it is the marriage contract document that constitutes valid proof of the marriage (art. 16).
This is general legal information, not legal advice. For advice on your specific situation, consult a lawyer admitted to the Bar in Morocco.