ChartMuseum is a charting server that hosts Helm charts.

Let’s spin up a quick ChartMuseum instance and push a chart to it.

First, we need a Docker image for ChartMuseum. The official image is a good starting point. We’ll also need a place to store our charts. For this example, we’ll use a local directory, but in production, you’d likely use cloud storage like S3 or GCS.

# Create a directory to store charts
mkdir -p ./chart-repo

# Run ChartMuseum in Docker
docker run -d \
  -p 8080:8080 \
  -v $(pwd)/chart-repo:/charts \
  -e "OPENANALYTICS_ENDPOINT=http://localhost:8081" \
  -e "STORAGE=local" \
  -e "LOCAL_CHART_DIR=/charts" \
  --name chartmuseum \
  chartmuseum/chartmuseum:v0.14.0

This command does a few things:

  • -p 8080:8080: Maps port 8080 on your host machine to port 8080 inside the container, where ChartMuseum listens.
  • -v $(pwd)/chart-repo:/charts: Mounts your local chart-repo directory into the container at /charts. This is where ChartMuseum will read and write charts from.
  • -e "OPENANALYTICS_ENDPOINT=http://localhost:8081": This is an optional setting for an analytics endpoint. We’re pointing it to a non-existent service here for simplicity; it won’t break anything if it’s not running.
  • -e "STORAGE=local": Tells ChartMuseum to use the local filesystem for storage.
  • -e "LOCAL_CHART_DIR=/charts": Specifies the directory within the container that ChartMuseum should use for local storage.
  • --name chartmuseum: Assigns a name to the container for easier management.
  • chartmuseum/chartmuseum:v0.14.0: The Docker image and tag to use.

Now that ChartMuseum is running, we need a Helm chart to push. If you don’t have one, you can create a simple one:

# Create a new Helm chart
helm create my-nginx-chart

# Package the chart
cd my-nginx-chart
helm package .

This will create a .tgz file, for example, my-nginx-chart-0.1.0.tgz.

Next, we need to tell Helm where our ChartMuseum repository is.

# Add ChartMuseum as a Helm repository
helm repo add my-local-repo http://localhost:8080

Now, let’s push our chart to ChartMuseum.

# Push the chart to ChartMuseum
helm cm-push my-nginx-chart-0.1.0.tgz my-local-repo

You should see output indicating the chart was successfully uploaded. If you check your local chart-repo directory, you’ll see the chart files there. ChartMuseum also serves an index file (index.yaml) that Helm uses to discover available charts.

To verify, let’s update our Helm repository cache and see if the chart is available.

# Update Helm repository index
helm repo update

# Search for the chart
helm search repo my-local-repo/my-nginx-chart

You should see your my-nginx-chart listed with its version. You can now install it:

# Install the chart
helm install my-nginx my-local-repo/my-nginx-chart --version 0.1.0

ChartMuseum’s primary function is to serve Helm charts, but it also handles chart versioning automatically. When you push a chart that already exists, ChartMuseum will add the new version to the index.yaml without overwriting the old one, making it a robust solution for managing your internal Helm chart dependencies.

One of the most powerful, yet often overlooked, features of ChartMuseum is its ability to act as a proxy for other Helm repositories. By configuring ChartMuseum to proxy https://charts.helm.sh/stable (or any other repository), you can consolidate all your chart sources through a single endpoint. This simplifies Helm client configurations across your organization and allows for caching of charts, reducing external network calls and improving deployment speeds. To enable proxying, you’d typically set environment variables like PRO masalah or REMOTE_REPO.

The next step you’ll likely encounter is securing your ChartMuseum instance with authentication and TLS.

Want structured learning?

Take the full Helm course →