So I'm going to Germany in April for my master degree program and I have no idea where one gets a visa. Do you have to go to a consulate, or a courthouse like where you get a passport? I'm in Dubai.
You need to go to the German consulate in Dubai. Checkout out this link here. I presume you would be requiring a type D visa.
The German Consulate in Dubai facilitates visa application process for applicants residing in Dubai, Sharjah, Ras-Al-Khaimah, Fujairah, Ajman or Umm-Al-Quwain.
The above link outlines some pointers which would be useful for your visa application. For more details also visit this website.