Skip to content

Installing on Ubuntu and Debian

Cristian Souza edited this page Aug 18, 2020 · 1 revision

1. Update the system

$ sudo apt update && sudo apt upgrade -y

2. Install the required software

$ sudo apt install git python3 python3-dev python3-pip python3-mysqldb python3-setuptools python3-virtualenv automake libfuzzy-dev libssl-dev libffi-dev mariadb-server libmariadbclient-dev

3. 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

4. Clone Freki's latest version

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

5. Create a folder to store the uploaded samples

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

6. Create and start a new virtualenv

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

7. Install the Python requirements

(venv) $ pip3 install -r requirements.txt
(venv) $ pip3 install mysqlclient

8. Export the required environment variables

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

9. Run Freki!

(venv) $ python3 run.py

or

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