Personalized recommendation automatically predicts the top-y hashtags to a given tweet. Most research in the literature of hashtag recommendation focused on the content of the posts such as words and topics. Although these methods have measured the performance of hashtag recommendation on large data sets, there is a lack of analysis on how these methods perform on small communities. Motivated by the well-studied research area of community detection algorithms that aggregate strongly connected users with similar interests and behaviors, in this article, we propose a community-based hashtag recommendation framework, which studies hashtag recommendation through tweet similarity task and applies it on communities detected using the Clique percolation method, Louvain algorithm, and label propagation method. The detected communities are extracted from four social network constructions based on following, mention, hashtag, and topic. Compared to the three state-of-the-art hashtag recommendation methods, our extensive experiments show that our community-based method outperforms these methods, thus giving a higher hit rate. Our in-depth analysis demonstrates that the performance of hashtag recommendation is the best when the communities are generated using the Clique percolation method (CPM) from the network of users who share similar usage of hashtags.