How to Install Inventree on nixOS

Inventree is an open-source platform for managing inventory, it can track items, their categories, and their locations. If you want to use Inventree and have nixOS latest as your operating system, you can follow the below steps to install it:

  1. Open the terminal on nixOS

  2. Update the local package list using the below command:

    sudo nix-channel --update
    
  3. Install the inventree package using nix-env:

    nix-env --install inventree
    
  4. Create a system service file for Inventree using the below command:

    sudo nano /etc/systemd/system/inventree.service
    
  5. Add the below content in the Inventree service file:

    [Unit]
    Description=Inventree Service
    After=network.target
    
    [Service]
    Type=simple
    User=inventree
    Group=inventree
    WorkingDirectory=/var/opt/inventree
    ExecStart=/opt/inventree/inventree/bin/python3 /opt/inventree/inventree/manage.py runserver 0.0.0.0:8000
    
    [Install]
    WantedBy=multi-user.target
    

    You can change the working directory and service executable command based on the location of your Inventree installation.

  6. Create a user and group for Inventree using the below command:

    sudo useradd -r -m -U -d /var/opt/inventree -s /usr/sbin/nologin inventree
    
  7. Set the ownership and permissions for the /var/opt/inventree directory using the below command:

    sudo chown inventree:inventree /var/opt/inventree && sudo chmod 750 /var/opt/inventree
    
  8. Reload the daemon using the following command:

    sudo systemctl daemon-reload
    
  9. Start the service using the below command:

    sudo systemctl start inventree
    

You have successfully installed and started Inventree on your nixOS system. You can now access the Inventree using your browser by opening localhost:8000 in your browser.

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!