trans-Cinnamaldehyde (TCA) is the main active component extracted from Cinnamomum cassia (C. cassia), which has many pharmacological effects, such as anti-inflammation, lowering blood glucose, and improving nerve function. However, there is no report of TCA in the treatment of depression. e purpose of this study was to investigate the antidepressant-like effect of TCA and the mechanism of NF kappa B (NF-κB) pathway and NLRP3 inflammasome inhibition by TCA. We divided 40 rats into the control group, CUMS group, FLU group, and the TCA group. e activation of the NF-κB pathway and NLRP3 inflammasome in prefrontal cortex and hippocampus of rats in each group was observed. After the treatments with FLU and TCA, the sucrose consumptions in rats increased significantly and the immobility time in forced swimming was decreased significantly compared to the CUMS group. e expression of TLR4, NF-κB-1, p-p65, TNF-α, NLRP3, ASC, caspase-1, IL-1β, and IL-18 proteins in prefrontal cortex and hippocampus was decreased, and the expression of IL-1β, IL-18, and TNF-α in serum was downregulated compared to the CUMS group. Similar to FLU, TCA reverses the depression-like behaviors in rats, which indicates that TCA has a significant antidepressant-like effect. e mechanism of the antidepressant property of TCA might be that it inhibits the activation of the NF-κB pathway and NLRP3 inflammasome in the prefrontal cortex and hippocampus of CUMS rats.