How to Install StockazNG on Manjaro
StockazNG is a free and open-source self-hosted web application for managing expenses and invoices. In this tutorial, we will guide you through the steps of installing StockazNG on your Manjaro system.
Prerequisites
- Manjaro Linux
- A terminal window
Installation
Open a terminal window on your Manjaro system.
Install the necessary dependencies:
sudo pacman -S git nginx php php-fpm php-pgsql composerClone the StockazNG repository:
git clone https://dev.sigpipe.me/dashie/StockazNG.gitNavigate to the project directory:
cd StockazNGInstall the required PHP packages:
composer installEdit the
config.phpfile with your database credentials:cp config.php.dist config.php nano config.phpIn the
config.phpfile, update the database section to match your PostgreSQL database configuration:'database' => [ 'dsn' => 'pgsql:host=localhost;dbname=stockazng', 'username' => 'postgres', 'password' => '', ],Create a new database in PostgreSQL:
sudo -u postgres createdb stockazngRun the following command to set up the database schema:
./bin/console doctrine:schema:createCreate a virtual host for StockazNG in the
/etc/nginx/sites-available/directory:sudo nano /etc/nginx/sites-available/stockazngAdd the following Nginx server block to the
stockazngfile:server { listen 80; server_name example.com; root /path/to/stockazng/web; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ ^/(index)\.php(/|$) { fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } location ~ \.php$ { return 404; } error_log /var/log/nginx/stockazng-error.log; access_log /var/log/nginx/stockazng-access.log; }Enable the StockazNG virtual host:
sudo ln -s /etc/nginx/sites-available/stockazng /etc/nginx/sites-enabled/Restart Nginx to apply the changes:
sudo systemctl restart nginxGrant the required permissions to the
var/directory:sudo chown -R www-data:www-data var/Finally, open your web browser and navigate to
http://localhostto access StockazNG.
Congratulations! You have successfully installed StockazNG on your Manjaro system. You can now start using it to manage expenses and invoices.