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 7, 2020 in Docker by akhtar
• 38,260 points
9,106 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 7, 2020 by MD
• 95,460 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
• 59,230 points
14,150 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 34,135 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,620 points
3,517 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,680 points
2,626 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
• 58,020 points
2,714 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, 2020 in Docker by MD
• 95,460 points
10,845 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, 2020 in Docker by MD
• 95,460 points
914 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP