You need to have a civil marriage to be considered officially married in Germany. Marriages which take place according to Christian, Muslim, Jewish -or any other- traditions and rituals have no legal weight if not followed by an officially recorded civil marriage. Foreign citizens who -according to the German law- have the right to join in wedlock may also marry in their home country's embassy. For more information in this regard, please contact the respective embassy. If you are a recognised refugee or asylum seeker, keep in mind that you may lose your protection status by visiting your home country's embassy.
In Germany, the Civil Registry Office ("Standesamt") is responsible for registering marriages. You can find and directly contact a Civil Registry Office near where you and/or your partner live. To register your marriage, you must fill a so-called "Registration for marriage" form ("Anmeldung zur Eheschließung") and submit all the required documents. The form can be obtained from any Civil Registry Office. Even if you prefer to register your marriage in another German city, you still have to also register it at the Civil Registry Office either at your place of residence or that of your partner.
You may apply at the Civil Registry Office six months before the desired date for the marriage (at the earliest). In some cases, you can reserve a specific date beforehand. If all the documents are ready and free dates available, the marriage can take place within a few days of application.
Both you and your partner have to be present for the registration of marriage. If one of you cannot be present, he or she can give the other power of attorney ("Vollmacht") to register the marriage in his/her absence.