Install on a VPS
This guide installs Inventoros from source on a VPS with full root access. Examples cover Ubuntu 22.04+, CentOS / RHEL, and Debian, then the scheduler and queue worker, SSL and firewall setup. Inventoros needs PHP 8.4.1 or newer (8.4 and 8.5) and Node.js 20.19+ or 22.12+ to build the frontend.
Ubuntu 22.04+
- Update system packages:
sudo apt update && sudo apt upgrade -y
- Install the required packages. Ubuntu's own repositories do not ship PHP 8.4, so add the
ondrej/phpPPA first:
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt install -y php8.4 php8.4-cli php8.4-fpm php8.4-mysql \
php8.4-mbstring php8.4-xml php8.4-bcmath php8.4-curl \
php8.4-zip php8.4-gd php8.4-intl nginx mysql-server \
git curl unzip
- Install Composer:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
- Install Node.js and npm:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
- Set up the MySQL database:
sudo mysql -e "CREATE DATABASE inventoros;"
sudo mysql -e "CREATE USER 'inventoros'@'localhost' IDENTIFIED BY 'secure_password';"
sudo mysql -e "GRANT ALL PRIVILEGES ON inventoros.* TO 'inventoros'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
- Clone and set up Inventoros:
cd /var/www
sudo git clone https://github.com/Inventoros/Inventoros.git inventoros
cd inventoros
sudo composer install --no-dev --optimize-autoloader
sudo npm install && sudo npm run build
sudo cp .env.example .env
sudo php artisan key:generate
- Configure the environment. Edit
.envand update these values:
sudo nano .env
# Update these values:
APP_ENV=production
APP_DEBUG=false
APP_URL=http://your-domain.com
DB_DATABASE=inventoros
DB_USERNAME=inventoros
DB_PASSWORD=secure_password
- Set permissions:
sudo chown -R www-data:www-data /var/www/inventoros
sudo chmod -R 755 /var/www/inventoros
sudo chmod -R 775 /var/www/inventoros/storage
sudo chmod -R 775 /var/www/inventoros/bootstrap/cache
- Configure Nginx. Create the site configuration:
# /etc/nginx/sites-available/inventoros
server {
listen 80;
server_name your-domain.com;
root /var/www/inventoros/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Enable the site:
sudo ln -s /etc/nginx/sites-available/inventoros /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
- Access the web installer. Visit your domain to complete setup:
http://your-domain.com/install
The database step writes the connection you enter to .env (DB_CONNECTION, host, database and credentials) and creates the tables in that database. Finishing the installer (creating the admin account) sets APP_ENV=production and APP_DEBUG=false, so a site set up with the example .env does not stay in debug mode.
CentOS / RHEL
- Update the system and enable EPEL and Remi:
sudo dnf update -y
sudo dnf install -y epel-release
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
- Install PHP 8.4:
sudo dnf module reset php
sudo dnf module enable php:remi-8.4
sudo dnf install -y php php-cli php-fpm php-mysqlnd php-mbstring \
php-xml php-bcmath php-curl php-zip php-gd php-intl
- Install MySQL and Nginx:
sudo dnf install -y mysql-server nginx git curl unzip
sudo systemctl enable --now mysqld nginx php-fpm
- Install Composer:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
- Install Node.js and npm:
curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
sudo dnf install -y nodejs
- Set up the MySQL database:
sudo mysql_secure_installation
sudo mysql -e "CREATE DATABASE inventoros;"
sudo mysql -e "CREATE USER 'inventoros'@'localhost' IDENTIFIED BY 'secure_password';"
sudo mysql -e "GRANT ALL PRIVILEGES ON inventoros.* TO 'inventoros'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
- Clone and set up Inventoros, then edit
.envas in Ubuntu step 7 (includingAPP_ENV=productionandAPP_DEBUG=false):
cd /var/www
sudo git clone https://github.com/Inventoros/Inventoros.git inventoros
cd inventoros
sudo composer install --no-dev --optimize-autoloader
sudo npm install && sudo npm run build
sudo cp .env.example .env
sudo php artisan key:generate
- Set permissions and SELinux contexts:
sudo chown -R nginx:nginx /var/www/inventoros
sudo chmod -R 755 /var/www/inventoros
sudo chmod -R 775 /var/www/inventoros/storage
sudo chmod -R 775 /var/www/inventoros/bootstrap/cache
# SELinux permissions (if enabled)
sudo setsebool -P httpd_can_network_connect 1
sudo chcon -R -t httpd_sys_rw_content_t /var/www/inventoros/storage
sudo chcon -R -t httpd_sys_rw_content_t /var/www/inventoros/bootstrap/cache
- Configure Nginx. Use the same server block as Ubuntu in
/etc/nginx/conf.d/inventoros.conf, but change the PHP-FPM socket tofastcgi_pass unix:/run/php-fpm/www.sock;. Then:
sudo nginx -t
sudo systemctl restart nginx
- Configure the firewall:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Debian
- Update system packages:
sudo apt update && sudo apt upgrade -y
- Add the PHP repository (for PHP 8.4):
sudo apt install -y lsb-release apt-transport-https ca-certificates curl
sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
- Install the required packages:
sudo apt install -y php8.4 php8.4-cli php8.4-fpm php8.4-mysql \
php8.4-mbstring php8.4-xml php8.4-bcmath php8.4-curl \
php8.4-zip php8.4-gd php8.4-intl nginx mariadb-server \
git curl unzip
- Install Composer:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
- Install Node.js and npm:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
- Set up the MariaDB database:
sudo mysql_secure_installation
sudo mysql -e "CREATE DATABASE inventoros;"
sudo mysql -e "CREATE USER 'inventoros'@'localhost' IDENTIFIED BY 'secure_password';"
sudo mysql -e "GRANT ALL PRIVILEGES ON inventoros.* TO 'inventoros'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
- The remaining steps are identical to Ubuntu. Clone the repo, install dependencies, build assets, configure
.env, set permissions, and configure Nginx (Ubuntu steps 6 through 10):
cd /var/www
sudo git clone https://github.com/Inventoros/Inventoros.git inventoros
cd inventoros
sudo composer install --no-dev --optimize-autoloader
sudo npm install && sudo npm run build
sudo cp .env.example .env
sudo php artisan key:generate
Scheduler and queue worker
Every install needs the Laravel scheduler and a queue worker. The scheduler runs low-stock checks, scheduled cycle counts, scheduled report emails, shipment tracking and log pruning. The worker sends webhook deliveries and queued emails (purchase orders, invoices, approvals, shipment notices). Without them these jobs pile up and never run.
The repository ships systemd units in deploy/systemd/. Edit User, Group and WorkingDirectory in each file to match your server (nginx instead of www-data on CentOS / RHEL), then install them:
sudo cp /var/www/inventoros/deploy/systemd/inventoros-worker.service /etc/systemd/system/
sudo cp /var/www/inventoros/deploy/systemd/inventoros-scheduler.service /etc/systemd/system/
sudo cp /var/www/inventoros/deploy/systemd/inventoros-scheduler.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now inventoros-worker
sudo systemctl enable --now inventoros-scheduler.timer
If you prefer cron to the scheduler timer, add this to the web user's crontab (sudo crontab -u www-data -e) instead:
* * * * * cd /var/www/inventoros && php artisan schedule:run >> /dev/null 2>&1
After each deploy, run php artisan queue:restart so the worker picks up the new code.
Imports, exports and scheduled reports can run for up to 600 seconds. Queue
reservations must last longer, or another worker can pick up a job that is still
running. Database, Redis and Beanstalkd queues default to 660 seconds; keep any
DB_QUEUE_RETRY_AFTER, REDIS_QUEUE_RETRY_AFTER or
BEANSTALKD_QUEUE_RETRY_AFTER override above 600. For SQS, set the queue's
visibility timeout above 600 seconds in AWS. After changing these settings,
rebuild the configuration cache and restart workers.
SSL certificate
Ubuntu / Debian:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
sudo systemctl restart nginx
CentOS / RHEL:
sudo dnf install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
sudo systemctl restart nginx
Firewall
Ubuntu / Debian (UFW):
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
CentOS / RHEL (firewalld):
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload
Report an issue: https://github.com/Inventoros/Inventoros/issues
Need a hand?
Open an issue or start a discussion on GitHub and the community will help you out.