← Back to blog
bpdubuntu

Developing Locally with Docker: A Guide to Live Code Reloading

27 February 2026bpd · ubuntu

See Your Code Changes Instantly

Docker is not just for deploying applications; it’s also a fantastic tool for local development. The ‘Ubuntu System Administration Guide’ demonstrates a key technique for an efficient development workflow: mounting your local code directly into a running container.

How It Works

The book provides a simple `docker-compose.yaml` file that starts an NGINX web server. The magic happens with the `volumes` configuration:

volumes:
  - ./code:/usr/share/nginx/html

This line maps a local folder named `code` on your computer to the web root directory inside the NGINX container. When you start this stack, the NGINX server will serve the `index.html` file from your local folder. Any changes you save to that file are immediately reflected in the container. This means you can edit your code in your favorite editor and simply refresh your browser to see the results, without ever needing to rebuild the Docker image or restart the container.


This post is based from content of the book Ubuntu System adminstration guide. And the book can be found here https://www.amazon.com/stores/Mattias-Hemmingsson/author/B0FF5CQX13