Install InvenTree with Docker
Table of Contents
Requirements #
Download jq:
apt install jq
Save the version number of the latest release:
export INVENTREE_VERSION="$(wget -q -O- 'https://api.github.com/repos/inventree/InvenTree/releases/latest' | jq -r '.tag_name')"
Docker #
Required Files #
Create a directory for InvenTree:
mkdir /opt/inventree
Download the docker-compose.yml:
wget -q -O "/opt/inventree/docker-compose.yml" "https://raw.githubusercontent.com/inventree/InvenTree/refs/tags/${INVENTREE_VERSION}/contrib/container/docker-compose.yml"
Download .env file:
wget -q -O "/opt/inventree/.env" "https://raw.githubusercontent.com/inventree/InvenTree/refs/tags/${INVENTREE_VERSION}/contrib/container/.env"
Download Caddyfile file:
wget -q -O "/opt/inventree/Caddyfile" "https://raw.githubusercontent.com/inventree/InvenTree/refs/tags/${INVENTREE_VERSION}/contrib/container/Caddyfile"
Configure #
cd /opt/inventree
Configure the environment variables:
nano .env
Initial Database Setup #
docker compose run --rm inventree-server invoke update
Create Administrator Account #
docker compose run inventree-server invoke superuser
Start #
Start Docker containers:
docker compose up -d