A new Biogeography-based Optimization (BBO) algorithm for detecting community in complex network science has been proposed. It adopts integral matrix encoding that each element represents the community index of the corresponding node. The migration operator and the mutation operator are the fundamental process to improve the accuracy and the quality of community detection. Each individual in the habitat can exchange information with other individuals by immigrating or emigrating. And the exchange among individuals will change the integral matrix value that closely connects with community index. In this paper, network modularity function is chosen as its suitability function, which to measure the quality of the community structure. The quality and effectiveness of the BBO algorithm are exposed in experimental tests by using artificial random network and real networks. The accuracy of BBO algorithm is batter to that of some classic algorithms, and is comparable to that of some latest algorithms.