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, visitthis 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
Understand Deep Learning and how it works with a simple example

Deep Learning is a part of Machine Learning, it mimics the way our brains fundamentally work. We all know that our brain consists of billions …

Continue Reading...
Letsencrypt wildcard - Setup wildcard subdomain using letsencrypt and certbot

To get wildcard supported certificates, we need to pass the challenge which requires adding TXT records in your dns records.
To get certificates for single domains, …

Continue Reading...
Deploying Wordpress blog with Django using Docker Containers.

Containers run services in an isolated environment, if we deploy our applications using containers then the host system on which these containers are running will …

Continue Reading...
How to setup http password authentication with nginx

HTTP Authentication is used to allow access limit to a site or particular directories by validating the username and password. HTTP basic authentication can also …

Continue Reading...
Gitlab and Docker - Continuous Integration, Deployment and Continuous Delivery

In this blog post, we will learn how to setup and use gitlab container registry to implement, test build and deploy your code automatically with …

Continue Reading...

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