To prevent loss from disease, immunostimulants have been used as dietary supplements to improve immunity and survival of shrimps. Among the various types of immunostimulants, there is increasing evidence that a diet enriched with bacterial lipopolysaccharide can reduce the mortality rate of shrimp under exposure to pathogens. Here, the immunostimulatory effects of bacterial lipopolysaccharide (LPS) from various bacterial sources were explored. Bacterial LPS was extracted from a shrimp pathogen, Vibrio harveyi and its effects were compared with the commercially available LPS from the non-shrimp pathogen, Escherichia coli. Our results revealed that the LPS from V. harveyi was different in molecular size but contained similar functional groups to that from E. coli. To understand their molecular mechanisms, bacterial LPS from the two sources were applied as a supplementary diet and fed to juvenile shrimp for 4-week feeding period before tissue samples were collected for transcriptomic analysis by next generation sequencing. Gene expression profiling revealed that major immune-related genes such as pattern recognition proteins (PRPs), proteinases and proteinase inhibitors, prophenoloxidase systems (proPO system), antimicrobial peptides (AMPs), signaling transduction pathways, heat shock proteins (HSPs), oxidative stress responses, and other immune-related molecules such as mucins and peritrophins were modulated in the groups of shrimp fed with bacterial LPS from both sources, but at different levels. The results suggest that bacterial LPS could modulate shrimp immune system, and different LPS sources led to different activation of immune pathways. Additionally, metabolic-related genes were affected by LPS, suggesting that energy was required for immune stimulation. In the V. harveyi pathogen challenge trial, all shrimp groups fed with diets containing LPS from both bacterial sources showed better survival than the control group without LPS. When comparing groups fed with LPS supplemented diets, the higher concentration of LPS (8 μg/body weight) from E. coli resulted in a better survival rate than a lower concentration (4 μg/body weight). Conversely, shrimp fed with a diet containing LPS from V. harveyi showed a lower survival rate when a higher dose of LPS (8 μg/body weight) was administered than the group fed with a lower concentration of LPS (4 μg/body weight). This could be due to overstimulation of shrimp immune responses, especially by LPS derived from shrimp pathogens, resulting in a reverse effect. These results confirm that immunity in shrimp upon administration of bacterial LPS depends on the origin and dose of the LPS administered.