Halo, kalau kamu merasa tulisan saya ngebantu kamu, kamu bisa ucapkan terima kasih lewat saweria .

If you feel this website help you, you can donate at saweria .



What I Used in This Tutorial

  1. Ubuntu Server 22.04 LTS

  2. Docker version 24.0.2

  3. Dockprom


How To Fix This Problem

  1. Update docker-compose.yml file
  grafana:
    image: grafana/grafana:10.0.1
    container_name: grafana
    volumes:
      - grafana_data:/var/lib/grafana
      - ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
      - ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
      # you can mount all grafana conf folder 
      # - ./grafana/conf:/usr/share/grafana/conf
      #or you can only mount 
      - ./grafana/conf/defaults.ini:/usr/share/grafana/conf/defaults.ini

    environment:
      - GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
      - GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
      - GF_USERS_ALLOW_SIGN_UP=false
    restart: unless-stopped
    expose:
      - 3000
    networks:
      - monitor-net
    labels:
      org.label-schema.group: "monitoring"
  1. Then go to directory grafana/conf, then change value serve_from_sub_path = false from defaults.ini file to serve_from_sub_path = true

  2. Restart grafana docker restart grafana

Notes:

Change grafana.ini won’t work, because it override by default.ini file


Common Problem

  1. If you still got error “Grafana failed to load its application files”, even when you try to revert it (not using subpath). In my case that was because cloudflare minify . You should disable Cloudflare JS, CSS minify at domain you host grafana