Local install using virtualenv

In this guide, we’ll cover the key steps to get Bugsink up and running in your local environment, deployed without Docker, using a Python virtual environment (venv). This setup is a good fit when some of the below applies:

  • You’d rather work directly on the host system without containers.

  • You’re comfortable on the command-line.

  • You’re native to the Python ecosystem, and know your way around pip (bonus points for Django).

It’s very similar to the single-server production setup, but without the production-grade features like HTTPS.

Install Python

Bugsink is written in Python, so you need to have Python installed on your system. You can download Python from the official website or using a package manager like apt or brew.

You can verify that Python is installed by running the following command:

python --version

and similarly for pip:

pip3 --version

and for venv:

python3 -c "import venv; print('venv is installed')"

If any of these commands fail, you may need to install Python and its dependencies. The exact steps depend on your operating system, so please refer to the official Python documentation for more information.

Set up a working dir

Both the Bugsink code and the data it collects will be stored somewhere. We’ll use a separate directory for this purpose. Create a new directory and navigate to it:

mkdir bugsink
cd bugsink

Set up a virtual environment and activate it

It’s a good practice to use a virtual environment to manage your Python dependencies. This way, you can avoid conflicts between different projects.

Run the following commands to create a virtual environment and activate it:

python -m venv .
source bin/activate

After running these commands, you should see the name of the virtual environment in parentheses at the start of your shell prompt, e.g. (bugsink).

Install Bugsink and its dependencies

You can install Bugsink using pip:

python -m pip install bugsink --upgrade

You should see output indicating that Bugsink and its dependencies are being installed. After the installation is complete, you can verify that Bugsink is installed by running:

bugsink-show-version

Configuration

Bugsink relies on a configuration file to determine how it should run. You can create a configuration file that’s suitable for local development by running:

bugsink-create-conf --template=local --port=8000

This will create a file bugsink_conf.py in the current directory. You may later edit this file to customize the configuration but for this tutorial the default configuration should be sufficient.

Initialize the database

Bugsink uses a database to store the data it collects. You can initialize the database by running:

bugsink-manage migrate

This will create a new SQLite database in the current directory and set up the necessary tables. You may verify the presence of the database by running:

ls db.sqlite3

Create a superuser

Create a superuser to manage the Bugsink installation. Run the following command and follow the prompts.

bugsink-manage createsuperuser

This will create a new user account with administrative privileges.

Run the Bugsink server

We will run Bugsink using Gunicorn (a WSGI server, i.e. a server that can run Python web applications). Gunicorn was already installed as part of the Bugsink dependencies, so we just need to run it.

gunicorn --bind="127.0.0.1:8000" --access-logfile - bugsink.wsgi

You should see output indicating that the server is running. You can now access Bugsink by visiting http://localhost:8000/ in your web browser and logging in with the superuser account you created earlier.

Next steps

You’ve successfully installed Bugsink on your local machine! You can now start using it to collect crash reports for your (local) applications. Log in with the superuser credentials you set up earlier and configure your first project.