Skip to content
This repository was archived by the owner on Aug 4, 2024. It is now read-only.
This repository was archived by the owner on Aug 4, 2024. It is now read-only.

Grafana container errors GF_PATHS_DATA='/var/lib/grafana' is not writable. #23

@thachpham2k

Description

@thachpham2k

🐛 Issue Title: Fix Grafana container error

Description:
When running the Grafana container, the following error occurs:

mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied
GF_PATHS_DATA='/var/lib/grafana' is not writable.
You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later

Solution:
To resolve this issue, add user: '0' to the docker-compose.yml file for the Grafana service:

 grafana:
  image: grafana/grafana-oss:10.2.4
  container_name: grafana
  restart: always
  ports:
    - "3000:3000"
  links:
    - prometheus:prometheus
  volumes:
    - ./grafana:/var/lib/grafana
  environment:
    - GF_SECURITY_ADMIN_USER=admin
    - GF_SECURITY_ADMIN_PASSWORD=admin
  user: '0'

This will run the Grafana container with root permissions (user: '0'), allowing it to write to the specified directories without permission issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions