Onchidium struma widely distributes in subtidal and low-tidal zones, which is considered to be an economical species with rich nutrition, a valuable biomonitor for heavy metal pollution and a representative species for evolution from ocean to land. However, there is limited genetic information available for O. struma development. This study compared transcriptomic profiles of coelomocytes from normal and bacteria infected O. struma by Illumina-based paired-end sequencing to explore the molecular immune mechanism of O. struma against bacterial infection. After assembly, a total of 92,450 unigenes with an average length of 1019 bp were obtained. Approximately 34,964 (37.82%) unigenes were annotated in the Nr NCBI database and 40.1% of unigenes were similar with that of Aplysia californica. Among them, 7609 unigenes were classified into three Gene Ontology (GO) categories: biological process (3250 unigenes, 42.7%), cellular component (2,281, 30.0%) and molecular function (2078 unigenes, 27.3%). A total of 22,776 unigenes were aligned to the Clusters of Orthologous Groups (COG) of proteins and classified into 25 functional categories. Following bacterial infection, 10,623 differently expressed unigenes (DEGs) were identified, including 7644 up-regulated and 2979 down-regulated unigenes. Further KEGG analysis annotated 11,681 DEGs to 42 pathways, and 11 pathways were identified to be related with diseases and immune system. To our knowledge, it was first time to analyze transcriptome profiles of O. struma. Results of the present study will provide valuable theoretical resources for future genetic and genomic research on O. struma. The research results will be helpful for improving the efficiency and quality of artificial breeding, establishing genetic linkage map, and enhancing health management for this species.