How to Install Inventree on POP! OS

Inventree is an open-source inventory management software. This tutorial will guide you through the steps for installing it on POP! OS.

Prerequisites

Before proceeding with the installation, ensure that the following prerequisites are met:

If you are unsure whether these prerequisites are met or you need to install them, run these commands:

python3 --version
pip3 --version

If any of these commands fail, install the missing package using the system package manager.

Step 1: Install Dependencies

Inventree has several dependencies that must be installed before installing the software. First, update the system package list and install the required packages by running these commands:

sudo apt update
sudo apt install git python3-dev python3-virtualenv python3-pip python3-setuptools python3-wheel build-essential libjpeg-dev zlib1g-dev libssl-dev libldap2-dev libsasl2-dev node-less postgresql postgresql-contrib libpq-dev

This command will install Git, Python dev packages, virtual environment packages, build tools, SSL and LDAP libraries, Node.JS less package, PostgreSQL with the client and server, and the PostgreSQL development libraries.

Before proceeding with the installation, make sure that the PostgreSQL server is running. You can check its status by running the command:

systemctl status postgresql.service

Step 2: Clone the Inventree Repository

To clone the Inventree repository, navigate to the directory where you want to download the source code and run this command:

git clone https://github.com/inventree/Inventree.git

This will clone the latest version of the Inventree source code.

Step 3: Create a Virtual Environment

Inventree requires a virtual environment to isolate the Python dependencies. To create a virtual environment, run these commands:

cd Inventree
virtualenv -p python3 venv
source venv/bin/activate

This will create a new virtual environment called venv and activate it.

Step 4: Install Python Dependencies

Once the virtual environment is active, use pip to install the required Python packages by running this command:

pip install -r requirements.txt

This will install all the Python dependencies that Inventree needs to run.

Step 5: Configure PostgreSQL

Inventree requires a PostgreSQL database to store its data. Create a new database and user by running these commands:

sudo su postgres
psql

This will open the PostgreSQL shell. Run the following commands to create a new database and user:

postgres=# CREATE DATABASE inventree;
postgres=# CREATE USER inventree WITH PASSWORD 'inventree';
postgres=# ALTER ROLE inventree SET client_encoding TO 'utf8';
postgres=# ALTER ROLE inventree SET default_transaction_isolation TO 'read committed';
postgres=# ALTER ROLE inventree SET timezone TO 'UTC';
postgres=# GRANT ALL PRIVILEGES ON DATABASE inventree TO inventree;
postgres=# \q
exit

Step 6: Configure Inventree

Before running Inventree, you need to configure it. Copy the sample configuration file, inventree/settings.py.sample, to inventree/settings.py by running this command:

cp inventree/settings.py.sample inventree/settings.py

Edit the inventree/settings.py file and modify the following lines:

...
DEBUG = False
...
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'inventree',
        'USER': 'inventree',
        'PASSWORD': 'inventree',
        'HOST': 'localhost',
        'PORT': '',
    }
}
...
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
...

Change the DEBUG setting to False when you're ready to run Inventree in production.

Update the DATABASES setting with the database name, user, and password you created in Step 5.

Update the EMAIL_HOST setting with the SMTP server hostname or IP address.

Step 7: Run the Server

Inventree is now ready to run. To start the development server, run this command:

python manage.py runserver

This will start the Inventree server and will be available at http://localhost:8000/.

Conclusion

Congratulations! You have successfully installed Inventree on your POP! OS system. You can now use the software to manage your inventory.

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!