# creat a directory which blow root authority

sudo mkdir grafana_data

#check

微信截图_20240129144447.png

#creat a compose file

sudo nano docker-compose.yml

#write config

version: '3'
services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: always
    ports:
      - 3000:3000
    volumes:
      - /home/zhaoyuqi/grafana_data:/var/lib/grafana

#run this config file

微信截图_20240129144714.png

#But I found the image failed to run

微信截图_20240129145001.png#After checking the log, it is found that the file permission error causes the operation failure

微信截图_20240129145121.png#Modifying folder Permissions

`sudo chown -R 472:472 /home/zhaoyuqi/grafana_data`

# restart image, it has run properly

微信截图_20240129154220.png