By continuing to navigate on this website, you accept the use of cookies to serve you more relevant services & content.
For more information and to change the setting of cookies on your computer, please read our Cookie Policy.

Setting Up Sentry - Web Application Event Tracking platform

When you want to track your exception and log messages in a UI rather than storing it in a file(which we usually do), we can use  SENTRY.  Sentry provides real-time crash reporting and exception tracking for your web and mobile apps.

In this Tutorial we will look on how to set up Sentry on a ubuntu VPS.

Update package list and upgrade packages:

sudo apt-get update && sudo apt-get upgrade

Required Packages:

apt-get install python-dev python-pip libpq-dev python-virtualenv libxml2-dev libxslt1-dev  postgresql-9.3 libffi-dev libssh-dev nginx supervisor


cd <installation source directory>

virtualenv env

source env/bin/activate

pip install sentry

Post Installation Steps:

Create sentry config files

sentry init <installation source directory>

Change Postgresql settings

sudo su postgres


ALTER USER postgres PASSWORD 'mynewpassword';

\q                      # to exit

createdb -E utf-8 sentry (as user postgres)

Based on whether you want to use it as postgres user or any other user change one of the below setting to md5

local   all             postgres     peer
local   all             all          peer


Newer versions of sentry need Redis >  2.8.9, visit  this link for more details on the ppas added below.

add-apt-repository ppa:chris-lea/redis-server
apt-get install redis-server

Modify <installation source directory>/ 

    'workers': 5,  # the number of web workers
    'protocol': 'uwsgi',  # Enable uwsgi protocol instead of http

Note: accordingly change postgresql, smtp and redis settings in config file.

Migrate Database

SENTRY_CONF=<installation source directory> sentry upgrade

You will be asked to create a superuser in between migration, which will be used to login into Sentry. In case if that doesnt happen use

SENTRY_CONF=<installation source directory> sentry createuser

Nginx Configuration Changes: 

Add following lines to /etc/nginx/sites-enabled/sentry

server {
listen 80 <your ip address/domain>;
location / {
    include     uwsgi_params;

sudo service nginx restart


If we visit the domain or IP set you will receive a 502 Page, because the sentry application is not yet up and running, Lets Daemonize sentry through a supervisor.

Add Below Lines to /etc/supervisor/conf.d/sentry.conf

command=/bin/bash -c "SENTRY_CONF=<installation source directory> <installation source directory>/env/bin/sentry run web"
# format of command should be SENTRY_CONF=/home /home/env/bin/sentry run web

command= /bin/bash -c "SENTRY_CONF=<installation source directory> <installation source directory>/env/bin/sentry celery worker"
# format of command should be SENTRY_CONF=/home /home/env/bin/sentry celery worker

command= /bin/bash -c "SENTRY_CONF=/home /home/env/bin/sentry celery beat"

then execute these commands in shell to update the configurational changes.
supervisorctl reread
supervisorctl update


Now visit your domain and Login with Credentials you created during database migration

set domain as http://<yourdomain> (without trailing slash) and SMTP Details if any and start exploring sentry.

Visit this tutorial to learn how to create a project, team and track a Django Application. 



    Posted On
  • 25 December 2015
  • By
  • Micropyramid

Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
Elastic Search Security Measures

After Installing Elastic Search in production, many new developers leave it unconfigured. In this Post, we will look into important config file changes and its ...

Continue Reading...
Django Testing Automated with Self Hosted Gitlab CI and Docker

It is a bit pricy if you want to host code for collaboration using bitbucket or github on your own VPS or On-Premisis servers. Gitlab ...

Continue Reading...
Setting Up Gitlab container Registry on own Domain.

GitLab Container Registry is a secure and private registry for Docker images integrated completely in Gitlab. In this tutorial we will setup and use GitLab ...

Continue Reading...
open source packages

Subscribe To our news letter

Subscribe and Stay Updated about our Webinars, news and articles on Django, Python, Machine Learning, Amazon Web Services, DevOps, Salesforce, ReactJS, AngularJS, React Native.
* We don't provide your email contact details to any third parties