Skip to content

Instantly share code, notes, and snippets.

@dgoguerra
Last active July 24, 2019 23:16
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save dgoguerra/43d52f0ef4c4c1fcbc7344a905dd8957 to your computer and use it in GitHub Desktop.
Save dgoguerra/43d52f0ef4c4c1fcbc7344a905dd8957 to your computer and use it in GitHub Desktop.
Install Sentry on-premise in Ubuntu 16.04 with Docker CE (Community Edition)

Install Docker

See: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-from-a-package

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"
sudo apt-get update
sudo apt-get install docker-ce

Check the installation works running the hello-world container:

sudo docker run hello-world

Install Sentry

See: https://github.com/getsentry/onpremise

# install docker-compose
sudo apt-get install docker-compose

# download sentry repo
git clone https://github.com/getsentry/onpremise sentry
cd sentry/

# create database and sentry config directories
mkdir -p data/{sentry,postgres}

# generate SENTRY_SECRET_KEY
sudo docker-compose run --rm web config generate-secret-key

# update config
nano docker-compose.yml
nano config.yml

# run database migrations
sudo docker-compose run --rm web upgrade

# run services as daemons
sudo docker-compose up -d

To restart the running containers when needed:

sudo docker-compose restart
@mpibpc-mroose
Copy link

I would mention to run sudo docker-compose run --rm web upgrade to prepare the database

@tareq1988
Copy link

Thanks for the quickstart. Do you know how to enable the github extenion?

@dyanakiev
Copy link

Dont forget to set the SENTRY_SECRET_KEY in .env file

@legalsylvain
Copy link

Hi.
First thanks a lot for your script.
Just for your information, it worked correctly, adding 3 lines after mkdir -p data/{sentry,postgres}

sudo docker volume create --name=sentry-data
sudo docker volume create --name=sentry-postgres
echo "SENTRY_SECRET_KEY=my_secret_key" > .env

kind regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment