Peptidoglycan (PG), also known as murein, is an essential component in both Gram-positive and Gram-negative bacteria. However, even if the chemical structure has been well-known for long, the great tertiary structure remains not clear due to its variability and complicated cross-link mechanism. And it inevitably raises the huge challenge for computational simulations. Against the background, here we present a method for building a solvated peptidoglycan system at coarse-grained level as required. The method is named PEPpy, which represents a Peptidoglycan python code. It reads in the user’s parameters in sequence and automatically generates a topological file and a structure file in the meantime. With these files generated, molecular dynamics simulations and a series of analyses can be easily performed afterwards.