How to Install StockazNG on Debian Latest
Introduction
StockazNG is an open-source web-based inventory management system. It provides features such as inventory tracking, product categorization, and low stock alerts, among others. This tutorial will guide you through the installation of StockazNG on Debian Latest.
Prerequisites
Before proceeding with this tutorial, please ensure that you have the following:
- A Debian Latest installation
- sudo access
- Access to a terminal
Step 1: Install Required Packages
The first step is to ensure that all the necessary packages are installed. Open a terminal and run the following command:
sudo apt-get update && sudo apt-get -y install git python3 python3-pip python3-venv mysql-server libmysqlclient-dev
- The
gitpackage is used to clone the StockazNG repository from GitHub. - The
python3package is required to run the application. - The
python3-pippackage is a package manager for Python. - The
python3-venvpackage allows you to create Python virtual environments. - The
mysql-serverpackage is required to set up a MySQL database. - The
libmysqlclient-devpackage is required for Python's MySQL database connector.
Step 2: Clone StockazNG
The next step is to clone the StockazNG repository from GitHub. In the terminal, run the following command:
git clone https://dev.sigpipe.me/dashie/StockazNG.git
Step 3: Create a Python Virtual Environment
Once the repository is cloned, navigate to the StockazNG directory and create a Python virtual environment:
cd StockazNG
python3 -m venv env
Step 4: Activate the Virtual Environment
Next, activate the virtual environment:
source env/bin/activate
Step 5: Install Python Packages
Install the required Python packages with pip:
pip3 install wheel
pip3 install -r requirements.txt
Step 6: Set Up MySQL Database
Now it's time to create a MySQL database for StockazNG. Run the following command in the terminal to log in to MySQL as the root user:
sudo mysql -u root
Once you are logged in to MySQL, create a new database and user:
CREATE DATABASE stockazng;
GRANT ALL PRIVILEGES ON stockazng.* TO 'stockazng'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
In the above example, we have created a new database called stockazng and a new user called stockazng with the password password.
Step 7: Create Configuration File
Next, create a configuration file for StockazNG:
cp stockazng.cfg.example stockazng.cfg
Edit stockazng.cfg and add the database information:
DATABASE_USER = 'stockazng'
DATABASE_PASSWORD = 'password'
DATABASE_NAME = 'stockazng'
Step 8: Start the Application
To start the application, run the following command:
./stockazng.py
The application should now be running on http://localhost:8080.
Conclusion
In this tutorial, you learned how to install and configure StockazNG on Debian Latest. You also learned how to set up a MySQL database and create a user for the database. You can now start using StockazNG to manage your inventory.