# Bind Mount

> A host folder shared straight into a container. Edits on either side show on both.

**Field:** Infrastructure  
**Category:** Containers  
**Also known as:** Docker Bind Mount, Host Mount, Host Folder Mount

## Think of it like

Think of it like a window between two rooms. What you change on one side shows on the other.

## Definition

A bind mount shares a folder from the host computer straight into a container. The container sees the folder at a path you choose. A change on either side shows up on the other at once. People use it to edit code on a laptop and run it in the container. Unlike a volume, the files live wherever the host keeps them.

## Example

Emma shares her project folder with a Node box. She saves a file in her editor, and the app inside picks up the change.

## Example code

```bash
docker run -v "$PWD":/app -w /app node:22 node app.js
```

The folder Emma is in shows up inside the box at /app. The app runs from there.

## Why it matters

It ties a container to files you can see and edit. That makes it the usual choice while writing code.

## Common mistake

Using a bind mount for a database on a server. A volume is easier to back up and move, and it does not depend on one host's folders.

## Three principles

- **A host folder.** Files stay where the host keeps them.
- **Both ways.** A change shows on both sides at once.
- **For writing code.** Volumes suit data on servers.

## Related terms

- [Container Volume](https://learn.benibix.com/term/infrastructure/container-volume)
- [Container](https://learn.benibix.com/term/infrastructure/container)
- [Docker](https://learn.benibix.com/term/infrastructure/docker)
- [Docker Compose](https://learn.benibix.com/term/infrastructure/docker-compose)
- [Dev Container](https://learn.benibix.com/term/infrastructure/dev-container)

## Told apart from

- [Container Volume vs Bind Mount](https://learn.benibix.com/compare/container-volume-vs-bind-mount): People think a bind mount is just another volume, and it is not. A bind mount shows a host folder you chose inside the box. A volume is storage the container tool makes and looks after. Both can use the same -v flag, which is why they get mixed up. Use a bind mount to edit code, and a volume to keep a database's files.

![A host box holding two containers, web and db, on a shared network line labelled shop. Host port 8080 has an arrow to port 80 in the web container. A host folder called project has a line into the web container's /app folder.](https://learn.benibix.com/diagrams/inf4-container-wiring.svg)

---

Source: https://learn.benibix.com/term/infrastructure/bind-mount
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
