Serving multiple Grafana instances from a single Debian server / package

I setup Grafana using the official community .deb package on a Debian VM using nginx as a proxy.

Now, I’d like to run separate instances without the burden of maintaining several virtual machines. I’m thinking of using the same binary for each instance.

It looks like I could achieve this by

  • adding systemd files for each grafana instance pointing to a different grafana.ini file
  • changing everything needed in each grafana.ini to ensure different ports, DBs are used, etc.
  • create a separate VHost in nginx to proxy each new instance

If everything can be set in the config file, it should be safe to run a single binary to serve several instances without them interfering with each other.

AFAIU, the only additional precaution would be to review the config file on each .deb update to ensure everything is duplicated.

Is there a good reason not to do that?

I think it should be fine. Grafana is not very resource hungry. If there are any conflicts, you should notice instantly as it should fail on startup.

If you are using provisioning then be careful about having multiple grafana processes scanning the same directory for changes.

Another option is to have one Grafana instance and use the orgs feature to have a multi-tenant setup.

Thank you for your answer.

Indeed I missed the multi-organization possibility. It looks like it totally answers my need and makes my question pointless. I’ll try to figure that out.

I guess the original question still stands for people with a good reason to do multi-instance, so thank you for confirming it should work. I’d still be careful about deployment/update scripts. For instance, database migration scripts might run only on the database used by the instance with the default config location.

Thanks again.

Sir, How to do " adding systemd files for each grafana instance pointing to a different grafana.ini file"…

Could u please help me