Installing Inventree on Fedora Server

Inventree is an open-source Inventory and Manufacturing Management System that helps to manage your warehouse, stock, and manufacturing processes. In this tutorial, you will learn how to install Inventree on Fedora Server.

Prerequisites

Step 1: Install the Required Packages

First, update your system packages and install the necessary packages required to run Inventree.

sudo dnf update -y
sudo dnf install -y git gcc python3-devel ruby ruby-devel redhat-rpm-config zlib-devel openssl-devel

Step 2: Install Node.js and npm

Inventree uses Node.js and npm to compile client-side assets. Use the following command to install Node.js and npm on your system.

sudo dnf install -y nodejs

Step 3: Install Postgres Database

Inventree uses a PostgreSQL database to store its data. Use the following command to install PostgreSQL on your system.

sudo dnf install -y postgresql-server postgresql-contrib postgresql-libs

After the installation, initialize the PostgreSQL database and start the PostgreSQL service.

sudo postgresql-setup initdb
sudo systemctl start postgresql.service
sudo systemctl enable postgresql.service

Step 4: Clone the Inventree Repository

Clone the Inventree repository to your system using the following command.

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

Step 5: Create a Python Virtual Environment and Install Dependencies

Inventree uses Python 3 to run the server, and it is recommended to use a virtual environment to isolate the project's dependencies. Use the following commands to create a virtual environment and activate it.

cd InvenTree
python3 -m venv inventree_env
source inventree_env/bin/activate

Now, install the project dependencies using pip.

pip install -r requirements.txt

Step 6: Setup the Database

Before running Inventree for the first time, you need to set up the PostgreSQL database. Use the following commands to create a new PostgreSQL user and database.

sudo -u postgres createuser --createdb --username postgres --no-createrole --no-superuser inventreeuser
sudo -u postgres createdb --username postgres --owner inventreeuser inventree

Next, create a settings file for Inventree using the following command.

cp InvenTree/settings.py.sample InvenTree/settings.py

Edit the settings.py file with your PostgreSQL database configuration.

vi InvenTree/settings.py
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "inventree",
        "USER": "inventreeuser",
        "PASSWORD": "your-password",
        "HOST": "localhost",
        "PORT": "",
    }
}

Step 7: Run the Migrations

Inventree uses Django's built-in migration system to setup the database schema. Use the following commands to apply the migrations.

python manage.py makemigrations
python manage.py migrate

Step 8: Compile the Assets

Inventree uses Node.js and npm to compile client-side assets. Use the following commands to install the required dependencies and compile the assets.

sudo npm install -g yarn
yarn install
yarn run build

Step 9: Create a Superuser

Finally, create a superuser account to access the Inventree admin panel.

python manage.py createsuperuser

Step 10: Run the Server

You can now start the Inventree server using the following command.

python manage.py runserver

By default, the server listens on port 8000. You can access the Inventree admin panel by visiting http://localhost:8000/admin in your web browser.

Conclusion

You have successfully installed Inventree on Fedora Server. You can now start using Inventree to manage your inventory and manufacturing processes.

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!