Section author: Wes Barnett

GROMACS tutorials

Note: The GROMACS tutorials that follow were written in Markdown by Wes Barnett and were originally published in the tutorials section of his website. Patrik and Vedran <>`__ converted the tutorials from Markdown to reStructuredText with some help from Pandoc. For now, the contents are kept unchanged. In the future, the contents will be updated to keep up with changes in GROMACS and expanded to cover more topics.

These are some GROMACS tutorials for beginners that I wrote during my PhD work. I found that many GROMACS tutorials focused on biomolecules such as proteins, where few focused on simple systems. I hope these tutorials fill the gap and give you a greater understanding of how to setup and run simple molecular simulations and how to utilize advanced sampling techniques.

It’s not necessary to do the tutorials in order, but the first two tutorials are essential before going on to the others, as the structure file (methane.pdb) and topology file ( for methane from tutorial 2 are used in all subsequent tutorials. The tutorials are designed for GROMACS version 5.1 and up. If you are using an older version, some of the commands or parameters may have changed. Note especially that the pull code for umbrella sampling has changed since 5.0 and older releases.


I assume you have some working knowledge of the command line (e.g., bash). Specifically, you should know how to make directories, change into them, edit text files, and download files to your system. When you see a $ or > this is the prompt on the command line and indicates you should type the text following it. If the command line is new to you, consider searching for a tutorial.

I also assume you have GROMACS installed on a machine available to you. Source code and installation instructions can be found on the GROMACS documentation page.

Throughout the tutorials we’ll be using OPLS methane and TIP4PEW water.


  1. Water - Basics of setting up a simulation. Find out the density of TIP4PEW water.

  2. One methane in water - How to create a topology file for a molecule and solvate it. Get the radial distribution function.

  3. Several methanes in water - How to put multiple solutes into a system. Get the methane-methane potential of mean force.

  4. Free energy of solvation of methane - How to do a free energy simulation when coupling a molecule. Use MBAR to get the result.

  5. Window sampling - Get methane-methane PMF from window sampling using pull code.

  6. Test particle insertion - Get the excess chemical potential of methane using test particle insertion.


See my contact page under “GROMACS tutorials”. GROMACS Tutorials by Wes Barnett is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.