How to Install Inventree on Debian Latest

Inventree is an open-source inventory management system designed for manufacturers, wholesalers, and distributors. It can be installed on Linux servers, and in this tutorial, we’ll show you how to install it on Debian Latest.

Prerequisites

Before installing Inventree, make sure that you have the following prerequisites installed on your Debian Latest server:

Step 1: Update System

First, update your system packages by running the following command as sudo:

sudo apt update && sudo apt upgrade

Step 2: Install PostgreSQL

Inventree requires a PostgreSQL database, so we’ll install it first. Run the following command to install PostgreSQL:

sudo apt install postgresql

Step 3: Create a Database

Next, we’ll create a new PostgreSQL user and database for Inventree to use. Run the following command to create a new database user:

sudo -u postgres createuser inventreeuser

When prompted, enter a password for the new user.

Now, create a new database and grant it privileges to the new user:

sudo -u postgres createdb -O inventreeuser inventree

Step 4: Install Git

Inventree’s source code is available on GitHub, so we’ll need to install Git. Run the following command to install Git:

sudo apt install git

Step 5: Install Dependencies

Inventree has many dependencies, so let’s install them all with the following command:

sudo apt install python3-pip python3-setuptools python3-dev libpq-dev libcups2-dev libssl-dev libldap2-dev libjpeg-dev libxml2-dev libxslt-dev libffi-dev libyaml-dev libgmp-dev

Step 6: Clone the Inventree Repository

Now, clone the Inventree Git repository to your home directory:

git clone https://github.com/inventree/InvenTree.git ~/inventree

Step 7: Install Inventree

In the Inventree directory, run the following command to install the required Python packages:

cd ~/inventree
sudo -H pip3 install -r requirements.txt

Step 8: Create a Configuration File

Create the Inventree configuration file by making a copy of the sample file:

cp ~/inventree/InvenTree/settings.py.sample ~/inventree/InvenTree/settings.py

Use nano or your preferred text editor to modify the contents of ~/inventree/InvenTree/settings.py. Update the DATABASES section to use the new database information we created earlier:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'inventree',
        'USER' : 'inventreeuser',
        'PASSWORD': 'DB_PASSWORD',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

Where DB_PASSWORD is the password you set earlier.

Step 9: Create Database Tables

Now, we’ll create the database tables for Inventree by running the following commands:

cd ~/inventree
python3 manage.py makemigrations
python3 manage.py migrate

Step 10: Create a Superuser

We’ll need a superuser account to use the Inventree web interface. Create one by running the following command:

python3 manage.py createsuperuser

And follow the prompts to create a new user account.

Step 11: Run the Development Server

Inventree has a built-in development web server. Run it by running the following command:

python3 manage.py runserver

You can now access the Inventree web interface by visiting http://127.0.0.1:8000 in your web browser.

Conclusion

In this tutorial, we’ve shown you how to install Inventree on Debian Latest. If you plan to use Inventree in a production environment, be sure to configure it accordingly.

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!