Step by step installation

1. Install packages

$ sudo apt install -y \
git python3 python3-dev python3-pip python3-mysqldb \
python3-setuptools python3-virtualenv \
automake libfuzzy-dev libssl-dev \
libffi-dev mariadb-server libmariadbclient-dev
$ sudo pacman -S --noconfirm \
git python3 python-pip mysql-python \
python-setuptools python-virtualenv \
mariadb mariadb-libs ssdeep gcc automake
$ sudo dnf install -y \
git python3 python3-devel python3-pip \
python3-mysql python3-setuptools python3-virtualenv \
libffi-devel ssdeep-devel ssdeep-libs mariadb-server \
mariadb-devel

2. Create a database user for Freki

$ sudo mysql_secure_installation
$ sudo mysql -u root -p

mysql> CREATE USER 'freki'@'localhost' IDENTIFIED BY 'yourpassword';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'freki'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit

3. Create a folder to store the uploaded samples

$ sudo mkdir /opt/freki
$ sudo chown -R youruser:usergroup /opt/freki

4. Clone Freki’s latest version

$ git clone https://github.com/crhenr/freki.git

5. Create and start a new virtualenv

$ cd freki/freki
$ virtualenv venv
$ source venv/bin/activate

6. Install the Python requirements

(venv) $ pip3 install -r requirements.txt

7. Export the required environment variables

(venv) $ export FREKI_MYSQL_HOST="localhost"
(venv) $ export FREKI_MYSQL_PASSWORD="yourpassword"
(venv) $ export FREKI_SECRET_KEY="yoursecretkey"

8. Run Freki!

(venv) $ python3 run.py

or

(venv) $ gunicorn --bind 0.0.0.0:5000 run:app