Fritillaria anhuiensis (F. anhuiensis), a traditional medicinal herb of the Liliaceae family, has various pharmacological effects, including anti‐tussive, anti‐asthmatic, and expectorant activities. Peimine, a steroidal alkaloid, is a major active constituent of F. anhuiensis. Although steroidal alkaloids of F. anhuiensis have been explored chemically and pharmacologically, the molecular basis of their biosynthesis remains unknown due to a lack of genomic and transcriptomic information. In this study, peimine was detected in bulbs, stems, and leaves of F. anhuiensis, with the highest content in the bulbs. We analyzed the transcriptomes of the bulbs, stems, and leaves of F. anhuiensis using an Illumina HiSeq 4000 platform. A total of 92,829 unigenes with a mean length of 804 base pairs (bp) and an N50 value of 1354 bp were assembled from a total of 30.56 Gb high‐quality reads. Based on the Kyoto Encyclopedia of Genes and Genomes annotation, 83 unigenes were found to be related to the steroid biosynthesis pathway, while 155 unigenes were related to the terpenoid backbone biosynthesis pathway. Numerous transcription factors are involved in the regulation of alkaloid biosynthesis. A putative steroidal alkaloid biosynthesis pathway in F. anhuiensis was constructed, providing a novel understanding of peimine biosynthesis. We performed extensive bioinformatics and phylogenetic analyses to investigate the functional characteristics and evolutionary history of cycloartenol synthase. This study is the first to report transcriptome data from F. anhuiensis and extends our knowledge of the molecular mechanisms of steroid alkaloid biosynthesis.