Configuring a Sentry Server on Ubuntu 16.04 LTS

Sentry is an error tracking software product which has many different subscriptions options. Its software is open source and can be difficult to install if you are unfamiliar with the server side of things and hosting. They do offer a free hosted option for up to 10k events per month, 1 user and up to seven days retention.

In this example, I’m using an updated Ubuntu 16.04.2 LTS install. To get started, we will install several packages. Note, this will install Redis and PostgreSQL. Typically, you would want to install these on their own servers.

We’ll then create a sentry user that will be running the software. We will also allow this use to be a sudoer.

Next, we need to create our database. To do this, we will login as the postgres user and open the template1 database. We’ll create a sentry database user and password. Be sure to change this password. We then need to create the citext extension.

We will then login as the sentry user and create a virtual environment for sentry.

Let’s install sentry

Let’s configure the with vi, nano or whatever your preferred editor is.

We’re now ready to upgrade! This will migrate the database; building the tables and initial data. You will also be asked to create a user which will be your login information.

Let’s log out of the sentry user and make sentrystartup whenever the server boots.

We’ll then paste this into sentry.conf

We’ll then update supervisor and check its status.

The app will then be available at http://localhost:9000.  If you want to set up SSL or run sentry on port 80, we can create an NGINX proxy.

Then replace the location / with the following.

If you need to configure your email settings, you can edit /home/sentry/.sentry/config.yml.

You can also setup crontab to cleanup the sentry data periodically.

Your site will be live at http://x.x.x.x/auth/login. Start a project and and tracking errors now!