Cyber-attacks occur more frequently with the rapid growth in the Internet. Intrusion detection systems (IDS) have become an important part of protecting system security. There are still some challenges preventing IDS from further improving its classification performance. Firstly, the complexity of high-dimensional features challenges the speed and the performance of the classification for IDS. Secondly, the classification performance of traditional Stacking algorithm can be easily affected by the base classifiers. Tackling both challenges above, we propose a hybrid intrusion detection system based on a CFS-DE feature selection algorithm and a weighted Stacking classification algorithm. To limit the dimension of the features, we deployed the CFS-DE algorithm, which searches for the optimal feature subset. Afterwards, a weighted Stacking algorithm is proposed, which increases the weights of the base classifiers with good training results and drops those base classifiers with bad ones to improve the classification performance. As such, the model enhances the classification efficiency and yielding better accuracy. All experiments in this study were conducted on the NSL-KDD and CSE-CIC-IDS2018 data sets. The results based on KDDTest+ show that our proposed model has accuracy of 87.44%, precision of 89.09%, recall of 87.44% and F1-score of 88.25%. The results based on CSE-CIC-IDS2018 show that our proposed model has accuracy of 99.87%, precision of 99.88%, recall of 99.87% and F1-score of 99.88%. Compared with traditional machine learning models and models mentioned in other papers, out proposed CFS-DE-weighted-Stacking IDS has the best classification performance.