Cybersecurity has emerged as a major concern for individuals and organisations due to digitalisation. As a result, data is growing exponentially making it susceptible to various cyberattacks. Intrusion detection systems are used to effectively detect cyberattacks to achieve cybersecurity. Traditionally, there are many existing IDS models developed using machine learning algorithms for anomaly detection. This study aims to explore the performance of the IDS using tree-based machine learning algorithms with feature selection. The experiment was conducted using three algorithms Decision Tree (DT), Random Forest (RF), and XGBooster (XGB). Each algorithm used five feature selection techniques Information Gain, Pearson Correlation, Chi-square, Principal Component Analysis, and Recursive Feature Elimination. The experiment is carried out with the NSL-KDD dataset. The performance of the models was evaluated using the performance metrics such as accuracy, recall, precision, F1-score, and false positive rate (FPR). Although each model effectively detects intrusion with different feature selection techniques, DT shows the highest performance with Pearson Correlation and achieved 82% accuracy and 0.02 FPR.