Installing manually
Introduction
Light Store is built on top of the Laravel framework and provides a powerful interface for managing your store.
Therefore, deployment steps for Laravel apply. This guide outlines the steps to deploy Light Store on a fresh installation of a Ubuntu 24.04 full-root server.
Prerequisites
Before you begin, this guide will assume a fresh installation of a Ubuntu 24.04 full-root server.
System Preperation
Install Dependencies
apt -y install software-properties-common curl apt-transport-https ca-certificates gnupg
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
# If you are on Ubuntu 22.04 and up, you can skip this stepcurl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
apt update
# Add universe repository if you are on Ubuntu 18.04apt-add-repository universe
apt -y install php8.3 php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} mariadb-server nginx tar unzip git
Install Composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Uploading the code
Upload the store files to your server. You can do it via FTP or SSH.
# Make a directory for the store files:mkdir /var/www/lightstorecd /var/www/lightstore# Extract the files if uploaded as .tar.gz:tar -xzvf lightstore.tar.gz# ...or unzip the files if uploaded as .zip:unzip lightstore.zip# Make sure to adjust permissions:chmod -R 755 storage/* bootstrap/cache/
Install & Setup Database
It is possible to use the panel with a local SQLite database. However, it is advised to use a MySQL database for production instead.
mysql -u root -p
# Change 'yourPassword' below to be a unique passwordCREATE USER 'lightstore'@'127.0.0.1' IDENTIFIED BY 'yourPassword';CREATE DATABASE lightstore;GRANT ALL PRIVILEGES ON lightstore.* TO 'lightstore'@'127.0.0.1' WITH GRANT OPTION;exit
Copy over the default environment settings file, install composer dependencies, and then generate a new application encryption key.
cp .env.example .envcomposer install --no-dev --optimize-autoloader
# Only run the command below if you are installing this app for# the first time and do not have any data in the database.# This will override the existing APP_KEY in the .env file.php artisan key:generate --force# Link the storage:php artisan storage:link
Environment Configuration
Copy over .env.example
to .env
and change the database connection information to match the credentials you created in the previous step.
DB_DATABASE=lightstoreDB_USERNAME=lightstoreDB_PASSWORD=yourPassword
Database Setup
Now we need to setup all of the base data for the Panel in the database you created earlier. The command below may take some time to run depending on your machine. Please DO NOT exit the process until it is completed! This command will setup the database tables that power lightstore.
php artisan migrate --force --seed
Webserver configuration
For nginx you can create a file in /etc/nginx/sites-available/ called lightstore.conf and add the following:
server { listen 80; listen [::]:80; server_name yourdomain.com; root /var/www/lightstore/public;
index index.php;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; }}
Then run the following commands to enable the site and restart nginx:
sudo ln -s /etc/nginx/sites-available/lightstore.conf /etc/nginx/sites-enabled/sudo systemctl restart nginx
For nginx you can create a file in /etc/nginx/sites-available/ called lightstore.conf and add the following:
server { listen 80; listen [::]:80; server_name yourdomain.com; return 301 https://$host$request_uri;}
server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name yourdomain.com; root /var/www/lightstore/public;
index index.php;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; }}
Then run the following commands to enable the site and restart nginx:
sudo ln -s /etc/nginx/sites-available/lightstore.conf /etc/nginx/sites-enabled/sudo systemctl restart nginx
For apache you can create a file in /etc/apache2/sites-available/ called lightstore.conf and add the following:
<VirtualHost *:80> ServerName yourdomain.com ServerAlias www.yourdomain.com DocumentRoot /var/www/lightstore/public <Directory /var/www/lightstore/public> AllowOverride All Require all granted </Directory></VirtualHost>
Then run the following commands to enable the site and restart apache:
sudo ln -s /etc/apache2/sites-available/lightstore.conf /etc/apache2/sites-enabled/lightstore.confsudo a2enmod rewritesudo systemctl restart apache2
For apache you can create a file in /etc/apache2/sites-available/ called lightstore.conf and add the following:
<VirtualHost *:80> ServerName yourdomain.com ServerAlias www.yourdomain.com Redirect permanent / https://yourdomain.com/</VirtualHost>
<VirtualHost *:443> ServerName yourdomain.com ServerAlias www.yourdomain.com DocumentRoot /var/www/lightstore/public <Directory /var/www/lightstore/public> AllowOverride All Require all granted </Directory> SSLEngine on SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem</VirtualHost>
Then run the following commands to enable the site and restart apache:
sudo ln -s /etc/apache2/sites-available/lightstore.conf /etc/apache2/sites-enabled/lightstore.confsudo a2enmod rewritesudo systemctl restart apache2
Be sure to replace yourdomain.com
with your domain name.
Fix the permmisions of lightstore with the following command:
chown -R www-data:www-data /var/www/lightstore/*
Cronjob
You’ll need to do is create a new cronjob that runs every minute to process specific Light Store tasks. Open crontab using sudo crontab -e
and then paste the line below.
* * * * * php /var/www/lightstore/artisan schedule:run >> /dev/null 2>&1
Create Queue Worker
Create a new file in /etc/systemd/system/
called lightstore.service
and add the following:
[Unit]Description=Light Store Queue Worker
[Service]User=www-dataGroup=www-dataRestart=alwaysExecStart=/usr/bin/php /var/www/lightstore/artisan queue:workStartLimitInterval=180StartLimitBurst=30RestartSec=5s
[Install]WantedBy=multi-user.target
Then run the following commands to enable the service and start it:
sudo systemctl enable --now lightstore.service
Rebuilding assets
In case of needing to rebuild assets, you can do so by using Node.js.
If you do not have Node.js installed, install it using either apt or nvm
(node version manager, recommended):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Restart your shell.
Then install the version 22 of Node.js:
nvm install 22
Once Node.js is installed, you can install the dependencies for the project:
cd /var/www/lightstorenpm install
Finally, you can build the assets:
npm run build