Self-Hosted Deployment of Sentry over AWS

Sentry
Reading Time: 2 minutes

Hello Readers. This will be a blog series on Self-hosted Sentry deployment over AWS. In the 1st blog of this series, I’ll be deploying a self-hosted Sentry server. Before starting up with deployment, let’s first understand what Sentry is and what does it provide.

What is Sentry?

Sentry is a service that helps you monitor and fix crashes in real-time. It helps in tracking errors and also provide with information to reproduce the issue and fix crashes. Apart from this, it also provides insights into production deployments, all that in real-time. Some of its prominent features include

  • Consolidates similar error and make their resolution easy
  • Huge list of supported platforms.
  • Provide Hosted and Self Hosted service
  • Multiple integrations available including GitHub and Slack
  • Allow Email Notification and many more…

Setting up Self-Hosted Sentry Server

Sentry provides a separate GitHub repository for Self-Hosted Server. To deploy the server, you can run the following steps.

Setup Instance

Launch an instance over AWS. The instance should have at least 4GB RAM and 2 CPU Core for better performance. For AWS, I’ll recommend to go with t2.medium instance.
Configure the instance by installing docker and docker-compose.

Installing docker
## Install Dependencies for docker
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

## Install Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get update -y && sudo apt-get install -y docker-ce docker-ce-cli containerd.io
Installing docker-compose
## Installing docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

## Make docker-compose executable
sudo chmod +x /usr/local/bin/docker-compose
Run docker without sudo
sudo groupadd docker
sudo usermod -aG docker $USER
## Reboot the instance
Install sentry
## Clone the sentry repository
git clone https://github.com/getsentry/onpremise.git

After cloning the repository, Install Sentry with default configurations using the following command

## Run installation script
cd onpremise/
./install.sh --no-user-prompt
docker-compose up

Final Note

As specified, the above-mentioned commands will install Sentry with the default configurations and its dashboard will now be accessible on <instance-ip>:9000.
To modify those default configurations, we need to modify onpremise/sentry/config.yml and onpremise/sentry/sentry.conf.py.
Sentry will also generate a log file sentry_install_log-<TIMESTAMP>.txt over the instance with the output logs of Sentry installation script install.sh.

Conclusion

In this blog, I’ve shown you how you can install Sentry self-hosted server with the default configurations. If you have any queries regarding this, feel free to contact me at yatharth.sharma@knoldus.com.

Also, I would like to thank you for sticking to the end. If you like this blog, please do show your appreciation by giving thumbs-ups and share this blog and provide suggestions on how can I improve my future posts to suit your needs. Follow me to get updates on different technologies.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading