How to Install GlitchTip on EndeavourOS

GlitchTip is an open-source error tracking tool that provides comprehensive error tracking and notifications for web applications. In this tutorial, we will go through the steps involved in installing GlitchTip on EndeavourOS.

Prerequisites

Before we get started with the installation process, there are a few prerequisites you need to ensure are in place. These include:

Step 1: Update System Packages

Before we install any new packages on our system, we should first ensure that our existing packages are up-to-date. To do so, open the terminal and run the following command:

sudo pacman -Syu

Enter your password and wait for the update process to complete.

Step 2: Install Required Packages

To host GlitchTip, we need to have an Apache webserver, PHP, Composer, and some other dependencies. We can install them with the following command:

sudo pacman -S apache php php-apache mariadb mariadb-clients composer

During the installation, you will be prompted to create a database root password. Make sure you remember or note it down, as we will need it later.

Step 3: Download and Install GlitchTip

Now we can download and install GlitchTip by following the below steps:

First, we will navigate to the Apache web root directory using the command:

cd /srv/http/

Then, we will clone the GlitchTip repository to the current directory using the following command:

sudo git clone https://github.com/glitchtip/glitchtip.git

Next, we will navigate to the GlitchTip root directory using the command:

cd glitchtip

Finally, we will run the installation script to install GlitchTip and its dependencies by executing the following command:

sudo ./build.sh

Step 4: Configure Apache

We now need to configure Apache to host the GlitchTip application. To configure Apache, perform the following steps:

First, create a new Apache virtual host configuration file named glitchtip.conf using the following command:

sudo nano /etc/httpd/conf/extra/glitchtip.conf

Then, copy and paste the following content to the file:

<VirtualHost *:80>
    ServerAdmin webmaster@glitchtip.com
    DocumentRoot "/srv/http/glitchtip/public"
    ServerName glitchtip.com
    ServerAlias www.glitchtip.com
    ErrorLog "/var/log/httpd/glitchtip-error.log"
    CustomLog "/var/log/httpd/glitchtip-access.log" common

    <Directory "/srv/http/glitchtip/public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost"
    </FilesMatch>
</VirtualHost>

Save and close the file.

Then, create a new PHP configuration file named php.ini using the following command:

sudo nano /etc/php/php.ini

Then, change the following lines:

upload_max_filesize = 20M
post_max_size = 20M

Save and close the file.

Finally, enable and start the Apache web server:

sudo systemctl enable httpd
sudo systemctl start httpd

Step 5: Configure MariaDB

We now need to create a new database and user for GlitchTip under MariaDB. To do so, perform the following steps:

First, login to the MariaDB server as the root user by executing the following command:

sudo mysql -u root -p

Then, enter your MariaDB root password and press Enter.

Next, create a new database named glitchtip_db:

CREATE DATABASE glitchtip_db;

Create a new user named glitchtip_user with the password password and grant it permissions to the glitchtip_db database:

CREATE USER `glitchtip_user`@`localhost` IDENTIFIED BY 'password';
GRANT ALL ON glitchtip_db.* TO `glitchtip_user`@`localhost`;

Finally, exit the MariaDB prompt using the command:

exit

Step 6: Setup GlitchTip

We have now completed all the required steps to install GlitchTip. Going forward, we need to configure GlitchTip before it can be used.

First, navigate to the GlitchTip application directory using the command:

cd /srv/http/glitchtip/config

Then, create a new file named .env and paste the following content:

APP_ENV=production
APP_DEBUG=false
APP_KEY=base64:8CHKvU/rjtcFqlP/O2McavEZz8/uBn6T7g6btTAU6bA=
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=glitchtip_db
DB_USERNAME=glitchtip_user
DB_PASSWORD=password

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

Save and close the file.

Then, install the required PHP packages using the following command:

sudo composer install --no-dev

Finally, generate a new application key by executing the following command:

sudo php artisan key:generate

Step 7: Run the Application

We have now completed all the necessary steps to install and configure GlitchTip. To run the application, we need to start the PHP service. To do so, execute the following command:

sudo systemctl start php-fpm

Open your favorite browser, navigate to the URL http://localhost, and voila! You have successfully installed and configured GlitchTip.

Conclusion

GlitchTip is a handy tool that provides error tracking and notifications for web applications. In this tutorial, we walked you through the installation and configuration of GlitchTip on EndeavourOS. By following these steps, you can now monitor and track errors in your web application with ease.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!