Blog
How to Install GROMACS: A Beginner’s Guide for Windows, Linux and Google Colab
- June 16, 2026
- Posted by: Stem Skills Lab
- Category: Uncategorized

GROMACS installs in three common ways. On Linux you either install the packaged build with a single apt command or compile the latest release from source with CMake. On Windows you run it inside WSL2 using those same Linux steps. On a free Google Colab notebook you install it with conda in about two minutes and no local setup. After any method, you confirm it worked by running gmx --version.
GROMACS is the engine most students reach for when they run their first molecular dynamics (MD) simulation, because it is free, fast, and heavily optimised. The one hurdle before the science starts is getting it installed and on your path. This guide walks through every realistic option for a student laptop, gives you the exact commands to copy, and shows you how to confirm the install before you waste time on a broken setup. It is part of our pillar guide on how to learn molecular dynamics with GROMACS, and a natural step on the computational biology skills roadmap.
What is GROMACS, and what do you need before installing it?
GROMACS (GROningen MAchine for Chemical Simulations) is an open-source package for molecular dynamics, built to simulate the motion of proteins, lipids, nucleic acids, and other biomolecules. It is released under the LGPL licence and is free for academic and commercial use. The reference description is the team’s own paper by Mark James Abraham and colleagues, “GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers” (SoftwareX, 2015), which describes the design that lets the same code run on a student laptop and on a national cluster.
Before installing, check three things. First, GROMACS is a Linux-first program, so on Windows you will run it through a Linux layer rather than natively. Second, you need a 64-bit machine with a C and C++ compiler available (the build needs a compiler that supports the C++17 standard). Third, you do not need a GPU to learn: GROMACS runs on a normal CPU, and a GPU only speeds up larger production runs. The authoritative requirements live in the official GROMACS Installation Guide, which you should keep open alongside this page.
How do I install GROMACS on Linux?
Linux is the native home for GROMACS, so this is the smoothest path. You have two choices: a one-line package install, or a build from source.
Option A: the one-line package install (fastest)
On Ubuntu or Debian, the package manager carries a ready-built GROMACS. Open a terminal and run:
sudo apt update
sudo apt install gromacs
gmx --versionThis is the quickest way to get a working gmx command for learning and coursework. The trade-off is version age: distribution repositories often ship a release that is a year or two behind the current one, and they are usually built without the newest performance options. For a first MD tutorial that is fine. When you move to real production runs, switch to the source build below.
Option B: build the latest release from source (recommended for real work)
Building from source gives you the current version and a binary tuned for your own hardware. Install the build tools first (cmake, a compiler, and build-essential), then follow the canonical sequence from the official guide. Replace the version number with the current one from the GROMACS download page:
sudo apt install build-essential cmake
wget https://ftp.gromacs.org/gromacs/gromacs-YYYY.x.tar.gz
tar xfz gromacs-YYYY.x.tar.gz
cd gromacs-YYYY.x
mkdir build
cd build
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
make -j4
make check
sudo make install
source /usr/local/gromacs/bin/GMXRCA few notes on what each step does. The cmake line configures the build; -DGMX_BUILD_OWN_FFTW=ON tells GROMACS to download and build its own copy of the FFTW maths library so you do not have to install it separately, and -DREGRESSIONTEST_DOWNLOAD=ON fetches the test suite. The make -j4 compiles using four CPU cores (raise the number to match your machine). The make check runs the regression tests, and you want them to pass before trusting the install. The final source line puts gmx on your path for that terminal session; add it to your ~/.bashrc to make it permanent.
How do I install GROMACS on Windows?
GROMACS does not ship a maintained native Windows build for everyday use, so the reliable route is the Windows Subsystem for Linux version 2 (WSL2), which runs a real Ubuntu inside Windows. Open PowerShell as Administrator and run:
wsl --installThis installs WSL2 and Ubuntu by default. Restart when prompted, set a Linux username and password the first time Ubuntu opens, and you now have a Linux terminal on your Windows machine. Inside that Ubuntu terminal, follow the Linux instructions above (either sudo apt install gromacs for the quick path or the source build for the latest version). Your Windows files are reachable from Linux under /mnt/c/, so you can keep input files in a normal Windows folder and run GROMACS on them from WSL. This is the same approach we recommend for docking tools in our guide on the best free molecular docking software for students.
Want the guided, hands-on version?
Our live Molecular Modeling & MD Simulations cohort bootcamp takes you from zero to running real docking and MD workflows, with a portfolio project for your grad-school applications.
How do I run GROMACS on Google Colab with no installation?
If your laptop is old or you are on Windows without admin rights, a free Google Colab notebook gives you a Linux machine in the browser with nothing to install locally. The cleanest way to add GROMACS to a Colab session is with conda. In a new notebook, run this in the first cell:
!pip install -q condacolab
import condacolab
condacolab.install()The kernel restarts automatically after condacolab.install(), which is expected. In the next cell, install GROMACS from the conda-forge channel and check it:
!mamba install -c conda-forge gromacs -y
!gmx --versionYou now have a full gmx command inside the notebook. The one thing to remember is that a Colab session is temporary: when it disconnects, the install and your files are wiped, so save outputs to Google Drive. Colab is ideal for following a tutorial or running a short simulation, and it pairs well with our walkthrough on running molecular docking on Google Colab.
Which install method should I choose?
| Method | Best for | Setup time | Gets the latest version? | Survives a restart? |
|---|---|---|---|---|
| Linux apt package | A quick first MD run on Linux | About 2 minutes | No, often older | Yes |
| Linux source build | Real production work, tuned speed | 20 to 40 minutes | Yes | Yes |
| Windows via WSL2 | Windows users who want a real install | 15 to 30 minutes | Yes (uses the Linux steps) | Yes |
| Google Colab | No admin rights or a weak laptop | About 2 minutes | Yes | No, session resets |
How do I check the installation worked?
Run two commands. First, gmx --version prints the version number plus the build details, including whether GPU support and which precision were compiled in. If you see a version banner rather than a “command not found” error, GROMACS is on your path. Second, gmx help commands lists the available tools, which confirms the binary runs. If you built from source, a passing make check is the strongest signal that the install is sound. Once these work, you are ready to prepare a system and launch your first run, which we cover next in the GROMACS pillar.
What happens after GROMACS is installed?
Installing the program is step zero. A real simulation then moves through a fixed sequence of gmx tools, and it helps to recognise the names now so the commands are not a surprise later. You convert a starting structure into GROMACS topology files with gmx pdb2gmx, define and centre a simulation box with gmx editconf, fill it with water using gmx solvate, add ions to neutralise the charge with gmx genion, combine everything into a run input file with gmx grompp, and finally run the dynamics with gmx mdrun. Each step has its own settings, and we walk through the full first run in the GROMACS pillar guide. For now, a working gmx command means you are ready to start.
Common installation problems and fixes
- “gmx: command not found” in a new terminal. The source build only adds
gmxto the session where you ran thesource /usr/local/gromacs/bin/GMXRCline. Add that line to your~/.bashrcso every new terminal finds it. - CMake cannot find a compiler. Install the toolchain with
sudo apt install build-essential cmakebefore running CMake, then delete thebuildfolder and configure again from a clean directory. make checkreports failures. A small number of tolerance failures can come from aggressive compiler optimisation. Rebuild with a standard optimisation level and re-run the tests before using the binary for science.- WSL feels slow on Windows. Keep your working files inside the Linux home directory rather than on
/mnt/c/. Reading and writing across the Windows and Linux file systems is much slower than staying on one side. - Colab “package not found”. Make sure the
condacolab.install()cell finished and the kernel restarted before you run themamba installcell. Running them out of order is the usual cause.
Frequently asked questions
Do I need a GPU to install and run GROMACS?
No. GROMACS runs on a normal CPU, which is enough to learn the workflow and run small systems. A GPU only matters for large or long production simulations, where it can speed up the calculation significantly. Start on a CPU and add a GPU later if your research needs it.
Which GROMACS version should I install?
For learning, the version in your Linux package manager is fine. For research, install the current stable release from the official download page, because newer versions bring performance improvements and bug fixes. Always note the version you used in your methods section so your work is reproducible.
Can I install GROMACS on a Mac?
Yes. The simplest route on macOS is the Homebrew package manager with brew install gromacs, and you can also build from source using the same CMake steps as Linux. The official installation guide covers the macOS specifics.
Is WSL2 better than dual-booting Linux?
For most students, yes. WSL2 gives you a real Linux environment without repartitioning your drive or rebooting to switch systems, and it is enough for coursework and small to medium simulations. Choose a dedicated Linux install or a cluster account only when you need the full performance of large production runs.
Is GROMACS free?
Yes. GROMACS is open-source software under the LGPL licence, free to download and use for both academic and commercial work, with the full source code available.
Want the guided, hands-on version?
Our live Molecular Modeling & MD Simulations cohort bootcamp takes you from zero to running real docking and MD workflows, with a portfolio project for your grad-school applications.