Blog
How to Set the Grid Box in AutoDock Vina: Center and Size Explained (Step-by-Step)
- July 4, 2026
- Posted by: Stem Skills Lab
- Category: Molecular Modeling

To set the AutoDock Vina grid box, define its center and size in the config file: center_x/y/z place the box on the binding-site center in Angstroms, and size_x/y/z set the search space dimensions in Angstroms. For targeted docking, center the box on a known pocket and keep each side near 18 to 25 Angstroms so the ligand can rotate freely. Read the numbers from AutoDockTools’ Grid Box tool.
Every part of a docking job can be correct, the receptor cleaned, the ligand protonated, the charges assigned, and the run will still return a meaningless pose if the grid box is wrong. The box, called the search space in the Vina documentation, is the region the algorithm is allowed to explore. Put it in the wrong place and Vina docks into empty solvent. Make it too small and the ligand cannot fit or rotate. Make it too large and the default search settings can miss the real binding mode. This guide shows you how to find the binding-site center, choose a defensible box size, and decide between targeted and blind docking, so your coordinates are a deliberate choice rather than a guess.
This is a spoke in our learn molecular docking series. It follows the AutoDock Vina tutorial for beginners and assumes you have already prepared your protein and ligand as PDBQT files. If you are placing docking inside a research career, see the full computational biology skills roadmap.
What is the grid box in AutoDock Vina?
The grid box is a rectangular region of 3D space, defined by a center point and three side lengths, that bounds where AutoDock Vina searches for ligand poses. Unlike AutoDock 4, Vina does not precompute affinity grid maps with AutoGrid before docking. It computes what it needs internally, so all you supply is the box geometry: three center coordinates and three sizes. This is a real advantage of Vina noted by its authors, who reported that the program runs “approximately two orders of magnitude” faster than AutoDock 4 while also improving the accuracy of pose prediction (Trott O, Olson AJ, “AutoDock Vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading,” J Comput Chem 31 (2010) 455-461, DOI: 10.1002/jcc.21334).
Six numbers describe the box, and they all live in the same Cartesian frame as your receptor PDBQT file, measured in Angstroms:
| Parameter | Meaning | Units |
|---|---|---|
| center_x, center_y, center_z | Coordinates of the box center, placed on the binding site | Angstroms |
| size_x, size_y, size_z | Side lengths of the box, one per axis | Angstroms |
Because the center is expressed in the receptor’s own coordinates, you cannot invent the numbers. They have to be read off the structure, which is exactly what the next two sections do.
How do you find the binding-site center coordinates?
The center is the single most important number, because it decides which part of the protein Vina even looks at. There are three reliable ways to get it, in order of how much you already know about the target.
1. Center on a co-crystallized ligand. If your structure came from the PDB with a bound ligand, that ligand marks the pocket. The geometric center of its atoms is an excellent box center. In PyMOL you can isolate the ligand as a selection and compute its center; community plugins such as the GetBox plugin read a selection and print center_x/y/z and a suggested size_x/y/z directly. This is the most defensible choice, because you are centering on an experimentally observed binding location.
2. Center on known active-site residues. If you know the catalytic or binding residues from the literature, select those residues and use their center. This is common for enzymes where the active site is annotated in UniProt or the primary paper but no ligand is present in your particular structure.
3. Use a pocket-prediction result. When you have neither a bound ligand nor annotated residues, a cavity-detection tool gives you candidate pockets and their coordinates, which you then use as the center. This shades into blind docking, covered below.
Whichever route you take, the output is the same three numbers: center_x, center_y, center_z.
How do you set the grid box in AutoDockTools (step by step)?
AutoDockTools (ADT), part of the free MGLTools package, has a visual Grid Box tool that is still the most common way beginners read box coordinates. Here is the exact sequence.
- Open ADT and load your prepared receptor: File → Read Molecule, then select your
receptor.pdbqt. - Tell ADT which molecule is the receptor: Grid → Macromolecule → Choose, and pick the receptor.
- Open the box: Grid → Grid Box…. A wireframe box appears in the viewer with a control panel.
- In the panel, set the spacing (angstrom) field. Its default is 0.375 Angstroms, the standard AutoGrid spacing. Change it to 1.0 so that the number of points equals the box size in Angstroms, which makes the Vina numbers trivial to read.
- Set the number of points in x, y, z. With spacing at 1.0, entering 22 in each field gives a 22 by 22 by 22 Angstrom box.
- Center the box. Use the panel’s Center → Center on ligand (if a ligand is loaded) or type the center_x/y/z you found earlier into the center fields. Watch the box move onto the pocket in the viewer.
- Read off the six numbers. The center fields are your center_x/y/z. With spacing = 1.0, the number of points fields are your size_x/y/z.
The relationship you are relying on is simple: size in Angstroms = number of points x spacing. If you leave spacing at the default 0.375, then a box of 40 points per side is 40 x 0.375 = 15 Angstroms per side, not 40. Setting spacing to 1.0 removes that arithmetic and the mistakes that come with it.
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.
What do the grid box values look like in config.txt?
Vina reads the box from a plain-text config file. A minimal, working config.txt for targeted docking looks like this:
receptor = receptor.pdbqt
ligand = ligand.pdbqt
center_x = 11.5
center_y = 25.3
center_z = 9.8
size_x = 22
size_y = 22
size_z = 22
exhaustiveness = 8
num_modes = 9
energy_range = 3
out = docked_out.pdbqtYou then run the job with a single command:
vina --config config.txtThe last three optional lines are shown at their program defaults so you can see them: exhaustiveness defaults to 8, num_modes to 9, and energy_range to 3 kcal/mol. You do not have to write them, but exhaustiveness matters for large boxes, as the next section explains. Note one version difference that trips people up: older tutorials add a log = log.txt line, but the log keyword was removed in AutoDock Vina 1.2, where results print to the terminal instead. The center and size parameters are unchanged across versions, and are documented in the official AutoDock Vina basic docking documentation.
How big should the AutoDock Vina grid box be?
The box has to be large enough that the ligand can translate and rotate freely inside it, and no larger. A useful rule of thumb is to make each side at least the length of the ligand in its longest dimension plus a margin of roughly 8 to 10 Angstroms, which for typical drug-like molecules lands in the 18 to 25 Angstrom range per side for a targeted run. The Vina documentation is explicit about the cost of oversizing: the search space “should not be much bigger than necessary,” because a larger box needs a proportionally larger search effort to find the correct pose reliably.
That is where exhaustiveness enters. Exhaustiveness controls how hard Vina searches; higher values run more independent local searches and make the result more reproducible, at the cost of runtime. A tight, well-placed box works fine at the default exhaustiveness of 8. A large box, such as a whole-protein blind-docking box, often needs exhaustiveness raised well above the default and the run repeated to confirm the top pose is stable, not a lucky sample. The practical test is reproducibility: run the same box twice and check that the best pose and its score agree.
Targeted docking vs blind docking: which box should you use?
The box size and placement follow directly from whether you already know where the ligand binds. This is the decision that shapes everything else.
| Aspect | Targeted (local) docking | Blind docking |
|---|---|---|
| When to use | Binding site is known from a ligand, mutation, or literature | Binding site is unknown; you are screening the whole surface |
| Box placement | Centered on the known pocket | Centered on the whole protein |
| Typical box size per side | ~18 to 25 Angstroms | Large enough to cover the protein (often 40+ Angstroms) |
| Exhaustiveness | Default (8) is usually enough | Raise well above default; repeat runs |
| Runtime | Fast | Slow |
| Main risk | Missing an alternative pocket outside the box | Lower resolution; false positives at the surface |
For most student projects the answer is targeted docking. Blind docking is a screening step to locate a pocket, after which you almost always re-dock into a tight, targeted box around the pocket you found to get a trustworthy pose and score. Once you have that pose, the next skill is reading it correctly, which is covered in how to interpret molecular docking results.
Grid box troubleshooting: common errors and fixes
These are the failures we see most often when students share a broken run.
- Parse error on the config file. Vina reports a parse error and stops. The usual cause is a stray keyword, most often a leftover
log = ...line under Vina 1.2, or a typo in a parameter name. Remove the offending line and check spelling against the documentation. - All top poses sit against one face of the box. The center is off. The ligand is being pushed to the wall closest to the true pocket. Re-read the center coordinates and confirm the box visually encloses the site in ADT or PyMOL.
- The ligand does not fit or barely moves. The box is too small for the molecule to rotate. Enlarge each side until the longest dimension of the ligand plus a margin fits comfortably.
- Two identical runs give different best poses. The box is too large for the search effort. Shrink it toward the real pocket, raise exhaustiveness, or both, then re-check reproducibility.
- Poses look right but scores are implausibly weak. Confirm the receptor and ligand PDBQT files carry correct charges and that polar hydrogens were added during preparation, since the box cannot fix a badly prepared input.
Related questions
Do the center and size have to be integers? No. The center is usually a decimal read from atomic coordinates, and the size can be any positive value in Angstroms, though whole numbers are convenient when you set ADT spacing to 1.0.
Are the box units grid points or Angstroms? In the Vina config file, size_x/y/z are in Angstroms. In the ADT Grid Box panel they are entered as a number of points, and size in Angstroms equals points multiplied by the spacing.
Can I set the box without AutoDockTools? Yes. You can compute the center from a bound ligand in PyMOL or with community scripts, then type the numbers straight into config.txt. ADT is convenient because it shows the box, but it is not required.
What spacing should I use for Vina? Setting the ADT spacing to 1.0 Angstrom is the simplest choice for Vina, because the number of points then equals the box size in Angstroms. The 0.375 default comes from AutoDock 4’s AutoGrid workflow.
FAQ
What is the grid box in AutoDock Vina? It is the rectangular search space, set by a center (center_x/y/z) and three side lengths (size_x/y/z) in Angstroms, that limits where Vina searches for ligand binding poses.
How do I find the center of the binding site? Center on a co-crystallized ligand, on known active-site residues, or on a predicted pocket. The geometric center of a bound ligand’s atoms is the most defensible choice because it marks an observed binding location.
What is a good grid box size for docking? For targeted docking, roughly 18 to 25 Angstroms per side, large enough for the ligand to rotate with a margin, but no larger, so the default search settings stay reliable.
Why do my docking results change every run? Usually the box is too large for the search effort. Shrink the box toward the real pocket, increase exhaustiveness above the default of 8, and confirm two runs agree.
What is the difference between targeted and blind docking? Targeted docking uses a small box on a known pocket at default settings. Blind docking uses a large box over the whole protein at higher exhaustiveness to locate an unknown site, and is usually followed by a targeted re-dock.
Setting the grid box is the step where docking stops being a black box and becomes a deliberate scientific decision you can defend in a viva. Get the center from the structure, size the box to the ligand, choose targeted over blind whenever you can, and check that your runs reproduce. Do that, and the pose you report is one a committee will trust.
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.
Written by the StemSkills Lab team, which brings more than ten years of hands-on experience in structural bioinformatics, drug discovery and design, and multiscale molecular modeling.