How to make Grafana container data persistent?

0 votes

Hi Guys,

I have created one docker container for Grafana. But whenever I removed the container the database also erased automatically. But I want to connect the same database to a different container. How can I make the Grafana database persistent?

Sep 6 in Docker by akhtar
• 27,980 points
174 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to create a volume in Docker and mount the same volume to your docker container. Then only your database will not erase. You can use the below commands. 

  • Create a persistent volume for your data in /var/lib/grafana (database and plugins) 

$ docker volume create grafana-storage 
  • Start Grafana container

$ docker run -d -p 3000:3000 --name=grafana -v grafana-storage:/var/lib/grafana grafana/grafana
answered Sep 6 by MD
• 64,820 points

Related Questions In Docker

0 votes
1 answer

How to Backup, Restore or Migrate data volumes in a docker container?

Steps to Backup a container 1)     ...READ MORE

answered Jul 3, 2019 in Docker by Sirajul
• 58,130 points
7,594 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,220 points

edited Oct 16, 2018 by lina 16,524 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 10,100 points
1,342 views
0 votes
1 answer

How to store data in external drive with Docker Postgres:9.3 image?

Apparently, the problem would be in your ...READ MORE

answered Jul 12, 2018 in Docker by Kalgi
• 2,620 points
774 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,680 points
838 views
0 votes
1 answer

How can I connect a docker container to two docker networks that I have created?

Hi@akhtar, It's correct that the network argument of ...READ MORE

answered Mar 23 in Docker by MD
• 64,820 points
221 views
0 votes
1 answer

How to expose my docker container?

Hi@akhtar, To expose you container from outside you ...READ MORE

answered Apr 6 in Docker by MD
• 64,820 points
115 views