Oktoberfest is the world's largest Volksfest. Held annually in Munich, Bavaria, Germany, it is a 16- to 18-day folk festival running from mid or late September to the first weekend in October, with more than 6 million people from around the world attending the event every year. Locally, it is often called the Wiesn, after the colloquial name for the fairgrounds, Theresa's meadows. The Oktoberfest is an important part of Bavarian culture, having been held since the year 1810. Other cities across the world also hold Oktoberfest celebrations that are modelled after the original Munich event.
The Oktoberfest tradition started in 1810 to celebrate the October 12th marriage of Bavarian Crown Prince Ludwig to the Saxon-Hildburghausen Princess Therese. The citizens of Munich were invited to join in the festivities which were held over five days on the fields in front of the city gates.Wikipedia
I always thought it was to celebrate the end of season harvest.
Here's a funny on how to celebrate: