Canavalia rosea, distributed in the coastal areas of tropical and subtropical regions, is an extremophile halophyte with good adaptability to high salinity/alkaline and drought tolerance. Plant sodium/hydrogen (Na+/H+) exchanger (NHX) genes encode membrane transporters involved in sodium ion (Na+), potassium ion (K+), and lithium ion (Li+) transport and pH homeostasis, thereby playing key roles in salinity tolerance. However, the NHX family has not been reported in this leguminous halophyte. In the present study, a genome-wide comprehensive analysis was conducted and finally eight CrNHXs were identified in C. rosea genome. Based on the bioinformatics analysis about the chromosomal location, protein domain, motif organization, and phylogenetic relationships of CrNHXs and their coding proteins, as well as the comparison with plant NHXs from other species, the CrNHXs were grouped into three major subfamilies (Vac-, Endo-, and PM-NHX). Promoter analyses of cis-regulatory elements indicated that the expression of different CrNHXs was affected by a series of stress challenges. Six CrNHXs showed high expression levels in five tested tissues of C. rosea in different levels, while CrNHX1 and CrNHX3 were expressed at extremely low levels, indicating that CrNHXs might be involved in regulating the development of C. rosea plant. The expression analysis based on RNA-seq showed that the transcripts of most CrNHXs were obviously decreased in mature leaves of C. rosea plant growing on tropical coral reefs, which suggested their involvement in this species’ adaptation to reefs and specialized islands habitats. Furthermore, in the single-factor stress treatments mimicking the extreme environments of tropical coral reefs, the RNA-seq data also implied CrNHXs holding possible gene-specific regulatory roles in the environmental adaptation. The qRT-PCR based expression profiling exhibited that CrNHXs responded to different stresses to varying degrees, which further confirmed the specificity of CrNHXs’ in responding to abiotic stresses. Moreover, the yeast functional complementation test proved that some CrNHXs could partially restore the salt tolerance of the salt-sensitive yeast mutant AXT3. This study provides comprehensive bio-information and primary functional identification of NHXs in C. rosea, which could help improve the salt/alkaline tolerance of genetically modified plants for further studies. This research also contributes to our understanding of the possible molecular mechanism whereby NHXs maintain the ion balance in the natural ecological adaptability of C. rosea to tropical coral islands and reefs.