# Graphite / Graphite-Web and Ubuntu 18.04 with nginx

**URL:** <https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469>\
**Category:** Visualization, Metrics & Reporting\
**Tags:** graphite-web, icingaweb2, nginx, graphite\
**Created:** [February 27, 2019, 6:56am UTC](https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469 "2019-02-27T06:56:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blindzero](https://community.icinga.com/user_avatar/community.icinga.com/blindzero/32/134_2.png) [@blindzero](https://community.icinga.com/u/blindzero)\
**Post date:** [February 27, 2019, 6:56am UTC](https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469/1 "2019-02-27T06:56:38Z")

</div>

Hi there,

to be honest I am a complete noob to all this fance python-etc-stuff…  
And although having years of experience with webservers and modules and icinga, nagios, netsaint I am really struggeling with graphite under ubuntu with nginx…

Has anybody experience / a good howto about this?  
Everything I found was with apache but not nginx (which seems to make a real difference for graphite-web…) or important details are completely missing…or…or…or…

- What I got running: seems to be service data send to graphite / carbon backend, I see databases growing and named after services…
- What I got **not** running: graphite-web module accessible through nginx (and therefor not showing in icingaweb2)…

Any help / recommendations?

Thanks a lot,  
Matthias

---

<div class="post-metadata">

**Author:** ![aflatto](https://community.icinga.com/user_avatar/community.icinga.com/aflatto/32/160_2.png) [@aflatto](https://community.icinga.com/u/aflatto)\
**Post date:** [February 27, 2019, 7:38am UTC](https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469/2 "2019-02-27T07:38:28Z")

</div>

I have implemented the graphite module on Ubuntu and RH, and found that there was an issue with the nginx frontend forwarding and reading, so in the end I run the graphite-web as a standalone systemd unit and connected directly to it ( as it is an internal system we did not had the need for the extra layer of the nginx/ apache requirement)

Can you share your nginx and graphite module config ?

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [March 11, 2019, 2:45pm UTC](https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469/3 "2019-03-11T14:45:37Z")

</div>

> [@aflatto](#):
>
> I run the graphite-web as a standalone systemd unit and connected directly

Interesting, can you share this configuration? 🙂

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![blakehartshorn](https://community.icinga.com/user_avatar/community.icinga.com/blakehartshorn/32/599_2.png) [@blakehartshorn](https://community.icinga.com/u/blakehartshorn)\
**Post date:** [April 19, 2019, 3:06pm UTC](https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469/4 "2019-04-19T15:06:30Z")

</div>

We’re discussing graphite’s web portal itself, not the icingaweb modules, right?

The trickiest part is getting Gunicorn up and running if you don’t have experience running Django apps.  
[https://graphite.readthedocs.io/en/latest/config-webapp.html](https://graphite.readthedocs.io/en/latest/config-webapp.html)

Similarly to Assaf, I point icingaweb’s graphite module directly at Gunicorn instead of Nginx (typically ipaddress:8000) and that works fine. For Graphite’s web portal specifically, you’ll need to make sure you forward the static content (described in that documentation) with Nginx. Here’s my systemd module:

```auto
[Unit]
Description = Graphite

[Service]
Environment=PYTHONPATH=/opt/graphite/webapp
User = carbon
Group = carbon
WorkingDirectory = /opt/graphite/webapp
PIDFile = /var/run/graphite/graphite.pid
ExecStart = /usr/local/bin/python3.7 /usr/local/bin/gunicorn --bind 0.0.0.0:8000 graphite_wsgi:application
ExecReload = /bin/kill -s HUP $MAINPID
ExecStop = /bin/kill -s TERM $MAINPID

[Install]
WantedBy = multi-user.target

```

Naturally change paths accordingly. I install Graphite with pip and I’m not familiar with how Ubuntu lays it out (if at all). Your graphite\_wsgi file should be in the webapp directory that parents graphite-web’s folder. That mess should summarize some headache I dealt with outside of the official documentation, let me know if you need anything clarified.

Additionally, check the local\_settings.py file. That’s a standard thing with Django and if you need to configure any custom URIs before setting up a reverse proxy (URL\_PREFIX=/graphite for example), that can be handled there.

---

<div class="post-metadata">

**Author:** ![blindzero](https://community.icinga.com/user_avatar/community.icinga.com/blindzero/32/134_2.png) [@blindzero](https://community.icinga.com/u/blindzero)\
**Post date:** [April 15, 2020, 9:37am UTC](https://community.icinga.com/t/graphite-graphite-web-and-ubuntu-18-04-with-nginx/469/5 "2020-04-15T09:37:27Z")

</div>

Thanks for sharing this config, unfortunately I didn’t get it run with Ubuntu 18.04 though.  
There are always issues by getting the provided graphite.wsgi running (some Python errors…).

But I found [https://computingforgeeks.com/how-to-install-and-configure-graphite-on-ubuntu-18-04/](https://computingforgeeks.com/how-to-install-and-configure-graphite-on-ubuntu-18-04/)  
which pointed me to a wonderful docker image which runs perfectly and provides me all necessary daemons I could just put into icinga2 / icingaweb2 modules configs.
