Social media has become a platform for people to express emotions, including happiness and sadness, to their followers. Major Depressive Disorder (MDD), a common mental health disorder, is characterized by sadness and loss of interest in activities, leading to physical, emotional, cognitive, and social suicidal thoughts. Early detection and intervention of MDD are crucial for effective management and treatment. The study investigates the potential of detecting MDD on social media platforms like Facebook, Twitter and Reddit by analyzing text using advanced machine learning and deep learning algorithms. In order to collect dataset, we employed both web scraping techniques and publically existing datasets (Twitter, Reddit) that are available on the Kaggle website. Natural language processing (NLP) techniques are applied to preprocess and excerpt meaningful features from the textual data. Several machine learning algorithms are employed to make prophetic models for MDD discovery grounded on verbal patterns, sentiment analysis, and verbal labels associated with depressive symptoms. We analyse our models using three datasets. The two online datasets for which the LSTM algorithm performs best are Reddit with 93.72% accuracy, Twitter with 99.85% accuracy, and our dataset which is extracted using web scraping technologies from Reddit gets 96.47% accuracy utilizing Stacking ensemble. The model's performance is thoroughly assessed using a variety of criteria, such as accuracy, precision, recall, and F1-score. Additionally, We find an approach with a more effective ML framework for enhancing MDD detection.