Skip to main content
Huỳnh Thanh Nhàn
💬
0 discussions

Setup seft-hosted Sentry

I. Before get started

  • Requirements for system :
    • Docker 19.03.6+
    • Compose 1.28.0+
    • 4 CPU Cores
    • 8 GB RAM
    • 20 GB Free Disk Space
  • Remote ubuntu server :
ssh -i AccessToken ubuntu@15.235.202.117
git clone https://github.com/getsentry/self-hosted/tree/23.1.1
  • Create floder in root and add source code to this floder on your ubuntu server:

    sudo -i
    mkdir sentry
  • Install Docker lastest :

    sudo -i
    apt-get update
    apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
    mkdir -p /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    echo \
    "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    chmod a+r /etc/apt/keyrings/docker.gpg
    apt-get update
    apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
    • Verify that the Docker Engine installation is successful by running the hello-world image:
      sudo docker run hello-world
  • Install Nginx by command line :

    • Get apt by command line
      sudo -i
      apt update
      apt install nginx
    • Adjusting the Firewall
      ufw app list
    • And the Output should be :
      Output
      Available applications:
      Nginx Full
      Nginx HTTP
      Nginx HTTPS
      OpenSSH
    • Option for Nginx :
       Nginx Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
      Nginx HTTP: This profile opens only port 80 (normal, unencrypted web traffic)
      Nginx HTTPS: This profile opens only port 443 (TLS/SSL encrypted traffic)
    • You can enable this by typing:
       ufw allow 'Nginx Full'
    • You can verify the change by typing:
      ufw status
    • Check status service is running:
      systemctl status nginx

II. Setup seft-hosted sentry

1. Set up sentry at localhost

  • Run command line as root :
    sudo -i
  • Open sentry floder:
    cd sentry
  • Install default sentry by command line:
    ./install.sh
    • On the first option, you should select "No".
    • Next option for account. Please fill your username and password.
    • And wait for output: "Docker compose up -d"
  • Before run command line "Docker compose up -d", you can change secret key by command line:
    cd sentry
    nano config.example.yml
    • Kindly change secret at system.secret-key: '!!changeme!!'
  • Go back your sentry floder and run command line to start by docker:
    cd ..
    docker compose up -d
    • Wait for a min to start all docker images.
  • If you run on your computer then go localhost:9000 to view project.

2. Deploy sentry to domain host

  • Open Nginx floder by command line:
    sudo -i
    cd ..
    cd etc/nginx
  • Edit default config on nginx site available floder to set up site domain:
    cd sites-available/
    nano default
  • Then copy default file to site enabled by command line:
    sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/
  • Restart NGINX with the below command:
    systemctl restart nginx
  • Open your domain in Chorme (exp: https://sentry.gcalls.co ) to view your project.