<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
>

<channel>
	<title>sentry with docker &#8211; DataYuge</title>
	<atom:link href="https://datayuge.com/tag/sentry-with-docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://datayuge.com</link>
	<description>The API Culture</description>
	<lastBuildDate>Wed, 13 Nov 2019 06:54:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://datayuge.com/wp-content/uploads/2018/07/cropped-favicon-32x32.png</url>
	<title>sentry with docker &#8211; DataYuge</title>
	<link>https://datayuge.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Installing Sentry with Docker on Ubuntu (Self hosted)</title>
		<link>https://datayuge.com/install-sentry-with-docker-on-ubuntu-self-hosted/</link>
					<comments>https://datayuge.com/install-sentry-with-docker-on-ubuntu-self-hosted/#respond</comments>
		
		<dc:creator><![CDATA[arun]]></dc:creator>
		<pubDate>Tue, 12 Nov 2019 20:24:21 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[sentry]]></category>
		<category><![CDATA[sentry on docker]]></category>
		<category><![CDATA[sentry on premise]]></category>
		<category><![CDATA[sentry self hosted]]></category>
		<category><![CDATA[sentry with docker]]></category>
		<guid isPermaLink="false">https://datayuge.com/?p=2335</guid>

					<description><![CDATA[<p>Sentry&#8217;s cross-platform application monitoring helps teams in analysing the error and bugs in live applications. We internally use Sentry to track errors on our price comparison API This makes it easy for the team to analyse the error in various parts...</p>
<p>The post <a rel="nofollow" href="https://datayuge.com/install-sentry-with-docker-on-ubuntu-self-hosted/">Installing Sentry with Docker on Ubuntu (Self hosted)</a> appeared first on <a rel="nofollow" href="https://datayuge.com">DataYuge</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sentry&#8217;s cross-platform application monitoring helps teams in analysing the error and bugs in live applications. We internally use Sentry to track errors on our <a href="https://datayuge.com/products/price-comparison-api/">price comparison API</a> This makes it easy for the team to analyse the error in various parts of the application and fix errors fastly. Today we will see how to set up sentry up and running on a ubuntu machine. There are official sentry docs on how to install sentry with docker, we tried the best to set it up from scratch on a vanilla machine faster.</p>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-2341 aligncenter" src="https://datayuge.com/wp-content/uploads/2019/11/sentry-docker.png" alt="install sentry on docker" width="560" height="315" /></p>
<h1>Install sentry with docker</h1>
<ol>
<li>
<h2>Swap Memory</h2>
</li>
</ol>
<p>We are considering a 1GB machine for the tutorial, however, it&#8217;s suggested to have at least 4GB machine so that memory issues won&#8217;t be popping up while installation.</p>
<blockquote><p>SSH in to your machine.</p></blockquote>
<p>We are adding a 4GB swap memory (since 1GB RAM can cause memory issues while installation). First, check if the system has configured any swap memory. You can skip this step if your machine has enough memory (At least 4GB)</p>
<blockquote><p>sudo swapon &#8211;show</p></blockquote>
<p>Then verify that there are no active swap utilized by the system by running,</p>
<blockquote><p>free -h</p></blockquote>
<p>Create a 4B swap using the following command.</p>
<blockquote><p>sudo fallocate -l 4G /swapfile</p></blockquote>
<p>Verify the allocation using the command.</p>
<blockquote><p>ls -lh /swapfile</p></blockquote>
<p>Now, apply the permissions to the swap file by running:</p>
<blockquote><p>sudo chmod 600 /swapfile</p></blockquote>
<p>Mark the file as swap by running the command:</p>
<blockquote><p>sudo mkswap /swapfile</p></blockquote>
<p>Now, enable the swap by running the command:</p>
<blockquote><p>sudo swapon /swapfile</p></blockquote>
<p>Rerun, the command to confirm that the swap is available.</p>
<blockquote><p>free -h</p></blockquote>
<h2>2. Installing Docker</h2>
<p>Now, let&#8217;s install docker into the machine. Set up the docker repository by running the following.</p>
<pre class="lang:sh decode:true">sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
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"
</pre>
<p>Once the repository has been set up, let install Docker CE</p>
<pre class="lang:default decode:true">sudo apt-get update
sudo apt-get install docker-ce</pre>
<p>Finish the docker setup by verifying the installation by running,</p>
<pre class="lang:default decode:true ">sudo docker run hello-world</pre>
<h2>3. Installing Sentry on-premise</h2>
<p>Now, clone the sentry on-premise repo using the following command.</p>
<blockquote><p>https://github.com/getsentry/onpremise.git</p></blockquote>
<p>Then cd into the folder and create a file and copy-paste the contents in the below file. Make the necessary changes in the config section on the top of the file before you begin the installation. The <em>system.url-prefix </em>will be the URL where the sentry will be available after installation. (Note: You need to config domain accordingly on your webserver).</p>
<blockquote><p>cd onpremise &amp;&amp; sudo nano installer.sh</p></blockquote>
<pre class="lang:sh decode:true" title="installer.sh">#!/usr/bin/env bash

echo "Applying config.yml values"

cat &lt;&lt;EOT &gt; config.yml
auth.allow-registration: false #prevents public registration
beacon.anonymous: true
mail.backend: 'smtp' 
mail.from: "mail@yourdomain.com"
mail.host: "smtp.yourdomain.com"
mail.password: "password"
mail.port: 465
mail.use-tls: true
mail.username: "mail@yourdomain.com"
system.admin-email: "admin@yourdomain.com"
system.url-prefix: "https://sentry.yourdomain.com"
EOT
echo "Building Sentry onpremise"
make build

docker container stop sentry-cron sentry-worker sentry-web sentry-postgres sentry-redis
docker container rm sentry-cron sentry-worker sentry-web sentry-postgres sentry-redis

docker run \
  --detach \
  --name sentry-redis \
  redis:3.2-alpine

docker run \
  --detach \
  --name sentry-postgres \
  --env POSTGRES_PASSWORD='sentry' \
  --env POSTGRES_USER=sentry \
  -v /opt/docker/sentry/postgres:/var/lib/postgresql/data \
  postgres:latest

echo "Generating secret key"
docker run --rm sentry-onpremise config generate-secret-key &gt; key
SENTRY_SECRET_KEY=$(cat key)

echo "Running migrations"
echo "This can take time based on memory usage"
docker run \
  --rm \
  -it \
  --link sentry-redis:redis \
  --link sentry-postgres:postgres \
  --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
  -v /opt/docker/sentry/sentry:/var/lib/sentry/files \
  sentry-onpremise \
  upgrade

echo "Installing plugins"
docker run \
  --rm \
  -it \
  --link sentry-redis:redis \
  --link sentry-postgres:postgres \
  --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
  -v /opt/docker/sentry/sentry:/var/lib/sentry/files \
  sentry-onpremise \
  pip install sentry-plugins

echo "Running service WEB"
docker run \
  --detach \
  --link sentry-redis:redis \
  --link sentry-postgres:postgres \
  --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
  --name sentry-web \
  --publish 9000:9000 \
  -v /opt/docker/sentry/sentry:/var/lib/sentry/files \
  sentry-onpremise \
  run web
sleep 15
echo "Running service WORKER"
docker run \
  --detach \
  --link sentry-redis:redis \
  --link sentry-postgres:postgres \
  --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
  --name sentry-worker \
  -v /opt/docker/sentry/sentry:/var/lib/sentry/files \
  sentry-onpremise \
  run worker
sleep 15
echo "Running service CRON"
docker run \
  --detach \
  --link sentry-redis:redis \
  --link sentry-postgres:postgres \
  --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
  --name sentry-cron \
  -v /opt/docker/sentry/sentry:/var/lib/sentry/files \
  sentry-onpremise \
  run cron

date
sleep 60
date
docker exec sentry-web sentry config set sentry:version-configured '9.1.0'
</pre>
<p>The above script is available on the internet and credit goes to the original author. The script will ask you to set up the default credentials during the process.  Please note that the whole process can take some time based on your server capacity. If the process exited, it means that your server doesn&#8217;t have the required memory to run the process, either increase the swap or consider upgrading to a better machine.</p>
<p>Once installed, you can navigate over to the following address and finish the final stages.</p>
<blockquote><p>your_server_ip:9000</p></blockquote>
<h2>4. Setting up Nginx</h2>
<p>Setting up Nginx to serve your custom domain.</p>
<p>Install Nginx by running the below command.</p>
<pre class="lang:default decode:true">sudo apt-get update
sudo apt-get install nginx
sudo ufw allow 'Nginx HTTP'</pre>
<p>If you now navigate to your server IP address, you will be seeing the Nginx welcome page.</p>
<p>Add a configuration for your site.</p>
<pre class="lang:default decode:true">cd /etc/nginx/sites-available
sudo cp default sentry.yourdomain.com
sudo nano sentry.yourdomain.com</pre>
<p>Then paste the contents. Note: This is a bare minimum installation, add the security measures if needed.</p>
<pre class="lang:default decode:true ">server {
   listen 80;
   server_name sentry.yourdomain.com;
   location / {
       proxy_pass         http://localhost:9000;
       proxy_redirect     off;
       proxy_set_header   Host              $host;
       proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
       proxy_set_header   X-Forwarded-Proto $scheme;
   }
}</pre>
<p>Now, enable server blocks and restart nginx.</p>
<pre class="lang:default decode:true">sudo ln -s /etc/nginx/sites-available/sentry.yourdomain.com /etc/nginx/sites-enabled/
sudo systemctl restart nginx
</pre>
<h2>5. Add HTTPS using LetsEncrypt</h2>
<p>Finally, we are adding HTTPS using Letsencrypt. Install certbot using the command.</p>
<pre class="lang:default decode:true ">sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
</pre>
<p>Once installed, generate a new HTTPS certificate using</p>
<blockquote><p>sudo certbot &#8211;nginx -d sentry.yourdomain.com</p></blockquote>
<p>Now, you can log in to sentry.yourdomain.com with the credentials you set up during the installation process; Now you have successfully set up sentry on-premise. If you liked our tutorial, you can read about our how-to article on <a href="https://datayuge.com/convert-import-csv-redis/">Redis CSV import</a>.</p>
<p>Let us know what you think about the tutorial in the comment box below.</p>
<p>The post <a rel="nofollow" href="https://datayuge.com/install-sentry-with-docker-on-ubuntu-self-hosted/">Installing Sentry with Docker on Ubuntu (Self hosted)</a> appeared first on <a rel="nofollow" href="https://datayuge.com">DataYuge</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://datayuge.com/install-sentry-with-docker-on-ubuntu-self-hosted/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 66/180 objects using disk
Page Caching using disk: enhanced 
Minified using disk
Database Caching 1/8 queries in 0.003 seconds using disk

Served from: datayuge.com @ 2026-04-07 07:23:26 by W3 Total Cache
-->