Skip to content

Introduction

Fast install

A quick-and-easy install can be done done with the following one-liner.

wget -Nq https://raw.githubusercontent.com/InvenTree/InvenTree/master/contrib/install.sh && bash install.sh
Read more about the installer.

Introduction

InvenTree can be self-hosted with minimal system requirements. Multiple database back-ends are supported, allowing for flexibility where required.

The InvenTree server ecosystem consists of the following components:

Database

A persistent database is required for data storage. InvenTree can be used with any of the following database backends:

  • PostgreSQL
  • MySQL / MariaDB
  • SQLite

SQLite

While SQLite provides a simpler setup and is useful for a development environment, we strongly recommend against using it for a production environment. Use PostgreSQL or MySQL instead

Database selection should be determined by your particular installation requirements.

Media Files

Uploaded media files (images, attachments, reports, etc) are stored to a persistent storage volume.

Web Server

The bulk of the InvenTree code base supports the custom web server application. The web server application services user requests and facilitates database access.

The webserver code also provides a first-party API for performing database query actions.

Once a database is setup, you need a way of accessing the data. InvenTree provides a "server" application out of the box, but this may not scale particularly well with multiple users. Instead, InvenTree can be served using a webserver such as Gunicorn. For more information see the deployment documentation.

Background Tasks

A separate application handles management of background tasks, separate to user-facing web requests.

OS Requirements

The InvenTree documentation assumes that the operating system is a debian based Linux OS. Some installation steps may differ for different systems.

Installing on Windows

Installation on Windows is not guaranteed to work (at all). To install on a Windows system, it is highly recommended that you install WSL, and then follow installation procedure from within the WSL environment.

Docker

Installation on any OS is simplified by following the docker setup guide.

Python Requirements

InvenTree runs on Python.

Python Version

InvenTree requrires Python 3.9 (or newer). If your system has an older version of Python installed, you will need to follow the update instructions for your OS.

Invoke

InvenTree makes use of the invoke python toolkit for performing various administrative actions.

Invoke Version

InvenTree requires invoke version 1.4.0 or newer. Some platforms may be shipped with older versions of invoke!

To display a list of the available InvenTree administration actions, run the following commands from the top level source directory:

invoke --list

Virtual Environment

Installing the required Python packages inside a virtual environment allows a local install separate to the system-wide Python installation. While not strictly necessary, using a virtual environment is highly recommended as it prevents conflicts between the different Python installations.

You can read more about Python virtual environments here.

Virtual Environment

The installation intstruction assume that a virtual environment is configured

cd into the InvenTree directory, and create a virtual environment with the following command:

python3 -m venv env

Activating a Virtual Environment

The virtual environment needs to be activated to ensure the correct python binaries and libraries are used. The InvenTree instructions assume that the virtual environment is always correctly activated.

To configure Inventree inside a virtual environment, cd into the inventree base directory and run the following command:

source env/bin/activate

Activate Virtual Environment

if

source env/bin/activate
is not working try
. env/bin/activate

This will place the current shell session inside a virtual environment - the terminal should display the (env) prefix.

InvenTree Source Code

InvenTree source code is distributed on GitHub, and the latest version can be downloaded (using Git) with the following command:

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

Alternatively, the source can be downloaded as a .zip archive.

Updating via Git

Downloading the source code using Git is recommended, as it allows for simple updates when a new version of InvenTree is released.

Installation Guides

There are multiple ways to get an InvenTree server up and running, of various complexity (and robustness)!

Docker

The recommended method of installing InvenTree is to use docker. InvenTree provides out-of-the-box support for docker and docker-compose, which provides a simple, reliable and repeatable pipeline for integration into your production environment.

Refer to the following guides for further instructions:

Bare Metal

If you do not wish to use the docker container, you will need to manually install the required packages and follow through the installation guide.

Refer to the following guides for further instructions:

Debug Mode

By default, the InvenTree web server is configured to run in DEBUG mode.

Running in DEBUG mode provides many handy development features, however it is strongly recommended NOT to run in DEBUG mode in a production environment. This recommendation is made because DEBUG mode leaks a lot of information about your installation and may pose a security risk.

So, for a production setup, you should set INVENTREE_DEBUG=false in the configuration options.

Potential Issues

However, turning off DEBUG mode creates further work for the system administrator. In particular, when running in DEBUG mode, the InvenTree web server natively manages static and media files, which means that the InvenTree server can run "monolithically" without the need for a separate web server.

With DEBUG mode turned off, a separate web server is required for serving static and media files. You can find further information in the django documentation.

There are many different ways that a sysadmin might wish to handle this.

The docker production example provides an example using Nginx to serve static and media files, and redirecting other requests to the InvenTree web server itself.

You may use this as a jumping off point, or use an entirely different server setup.

Static Files

Static files can be served without any need for authentication. In fact, they must be accessible without authentication, otherwise the unauthenticated views (such as the login screen) will not function correctly.

Media Files

It is highly recommended that the media files are served in such a way that user authentication is required.

Refer to the docker production example for a demonstration of using nginx to serve media files only to authenticated users, and forward authentication requests to the InvenTree web server.


Last update: November 7, 2022