Light Docs
Alternative installation methods

Installing manually

Learn how to set up Light Store on your host machine.

Overview

Installing this app manually may prove cumbersome as there are many steps to be done. We've simplified the process into an automatic script - which will install everything manually. Alternatively you may follow the Docker installation to install using Docker manually. Using Docker for installation is the recommended way of installing the store.

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.

Dependencies Installation

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

# Add PostgreSQL repository
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

apt update

# Add universe repository if you are on Ubuntu 18.04
apt-add-repository universe

apt -y install php8.3 php8.3-{common,cli,gd,pgsql,mbstring,bcmath,xml,fpm,curl,zip} postgresql postgresql-contrib nginx tar unzip git

Composer Installation

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Code Upload

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/lightstore
cd /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/

Database Setup

It is possible to use the panel with a local SQLite database. However, it is advised to use PostgreSQL for production instead.

# Switch to postgres user to create the database
sudo -u postgres psql

# Create a new user and database
CREATE USER lightstore WITH PASSWORD 'yourPassword';
CREATE DATABASE lightstore;
GRANT ALL PRIVILEGES ON DATABASE lightstore TO lightstore;
\q

Copy over the default environment settings file, install composer dependencies, and then generate a new application encryption key.

cp .env.example .env
composer 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

Back up your encryption key (APP_KEY in the .env file). It is used as an encryption key for all data that needs to be stored securely (e.g. user passwords). Store it somewhere safe - not just on your server. If you lose it all encrypted data is irrecoverable -- even if you have database backups.

Environment Setup

Copy over .env.example to .env and change the database connection information to match the credentials you created in the previous step.

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=lightstore
DB_USERNAME=lightstore
DB_PASSWORD=yourPassword

Web Server Configuration

Be sure to replace yourdomain.com with your domain name.

Permissions Setup

Fix the permissions of lightstore with the following command:

chown -R www-data:www-data /var/www/lightstore/*

Scheduled Tasks

You'll need to 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

Queue Worker Setup

Create a new file in /etc/systemd/system/ called lightstore.service and add the following:

[Unit]
Description=Light Store Queue Worker

[Service]
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/lightstore/artisan queue:work
StartLimitInterval=180
StartLimitBurst=30
RestartSec=5s

[Install]
WantedBy=multi-user.target

Then run the following commands to enable the service and start it:

sudo systemctl enable --now lightstore.service

Asset Building

In case of needing to rebuild assets, you can do so 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/lightstore
npm install

Finally, you can build the assets:

npm run build