Self hosted Sentry

We're going to set up sentry using docker, nginx, systemd, and certbot

Let's go!
This guide assumes you've already installed Docker, Docker Compose, Nginx, and Certbot .

Start by cloning the repository:

git clone sentry

You will end up with a folder called sentry

Now run the install script:


You will be prompted to create an admin user during the installation process.

Now we're going to create a systemd service, so that we can easily start sentry automatically on boot.

Move the sentry folder to /etc/sentry

sudo mv ./sentry /etc/sentry

Create the following file:

Description=Sentry server
After=docker.service nginx.service

ExecStart=/usr/local/bin/docker-compose -f /etc/sentry/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f /etc/sentry/docker-compose.yml stop


Now we can start the service by calling:

sudo systemctl enable sentry
sudo systemctl start sentry

This will also make sure it starts automatically on boot.

Now let's configure nginx
Create the following file:

upstream sentry {

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;

server {
        root /var/www/;
        index index.html index.htm index.nginx-debian.html;


        location / {
            proxy_pass        http://localhost:9000;

Sentry uses the port 9000 by default, but this can be changed if you're already using that port (see SENTRY_BIND in /etc/sentry/.env)

Then add a symlink:

sudo ln -s /etc/nginx/sites-available/sentry /etc/nginx/sites-enabled/sentry

And then restart nginx service:

sudo systemctl restart nginx

Now go to your domain's DNS settings and add a subdomain and point it to your servers ip-address.

You need an SSL certificate, and there is no easier way than using certbot.

Assuming you have certbot installed, run:

sudo certbot --nginx -d

Edit /etc/sentry/sentry/config.yml and you'll see SMTP configuration in the comments. Just fill in your own values, then restart the sentry service, and you should be good to go.

That's pretty much it!