Prerequisites
You need the following tools installed before you begin:
- Docker and Docker Compose — required to run the containers
- Node.js v22 or higher and npm — required for running tests and scripts outside of Docker
Start the local preview
Clone the repository
Clone only the Then navigate into the cloned directory:
main branch to save time and disk space:Start the containers
Run This starts the
make from the root of the repository:unified-docs Docker Compose profile, which spins up two containers:| Container | Port | Description |
|---|---|---|
unified-docs-api | 8080 | The unified docs API. Processes content from the /content directory on startup. |
dev-portal | 3000 | The dev-portal frontend, configured to pull from the local unified docs API. |
Verify the API is ready
To confirm the When this endpoint returns a JSON response, the API is ready. You can also test a specific content path:
unified-docs-api container has finished processing, visit:What each endpoint provides
localhost:3000
The dev-portal frontend. Use this to preview how your content changes appear to users on developer.hashicorp.com.
localhost:8080
The unified docs API. Serves raw content, navigation data, version metadata, and assets from the
/content directory.Run tests
To run the test suite with coverage reporting, first install dependencies and run the prebuild step outside of Docker:Stop the environment
To stop the containers gracefully, run the following in a separate terminal:Troubleshooting
I cannot see my local changes
I cannot see my local changes
If you are running Docker and cannot see local changes or preview specific doc versions, you may have a stale or cached Docker image. Run:This removes the local images and rebuilds from scratch.
The dev-portal shows stale content
The dev-portal shows stale content
The
dev-portal container depends on unified-docs-api completing its health check before starting. If the dev-portal started before the API finished processing, wait for the API container to pass its health check and then reload localhost:3000.