Skip to content

Overview

Light Store can be installed using Docker & docker-compose.

This is the recommended installation method as it provides:

  • OS-agnostic deployment
  • Pre-configured components (PostgreSQL, Redis, Adminer, etc.)
  • Isolated environment
  • Easy updates and maintenance

Installing Docker

TIP

Skip this section if you already have Docker and docker compose installed.

You'll need Docker and docker-compose installed on your system. Choose your platform below:

Windows Users

You can also use WSL2 to run Docker natively in a Linux environment instead of Docker Desktop.

Existing Installation

If you have an old Docker version installed, remove it first:

bash
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

1. Set up Docker's apt repository

bash
# Add Docker's official GPG key
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

2. Install Docker packages

bash
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

3. Verify installation

bash
sudo docker run hello-world

Installing Light Store

Now that Docker is set up, you can proceed with installing Light Store:

  1. Download the Light Store package from BuiltByBit

  2. Extract the package:

    bash
    unzip Light\ Store\ v*.*.zip
    cd Light\ Store\ v*.*
  3. Start the containers:

    bash
    docker compose up -d --build
  4. Run the installation command inside the container:

    bash
    docker compose exec -it app php artisan app:install --env=docker

    Follow the prompts.

    No Interactive Shell

    If you can't get access to an interactive shell, you may also run:

    bash
    docker compose exec -it app php artisan app:install --env=docker --url=https://yoururl.com
  5. Configure the URL:

    • For HTTP: Use http://your-server-ip:8001 (default port)
    • For HTTPS: Check our Nginx with SSL guide for setting up HTTPS for the store

    Custom Port

    The default port (8001) can be modified in docker-compose.yml if needed.

  6. Set up the queue service:

    bash
    sudo nano /etc/systemd/system/lightstore.service

    Add the following content to the file:

    ini
    [Unit]
    Description=Light Store Queue Worker
    After=docker.service
    Requires=docker.service
    
    [Service]
    User=root
    Group=root
    Restart=always
    ExecStart=/usr/bin/docker exec store-app-1 php artisan queue:work
    StartLimitInterval=180
    StartLimitBurst=30
    RestartSec=5s
    
    [Install]
    WantedBy=multi-user.target
  7. Enable and start the queue service:

    bash
    sudo systemctl daemon-reload
    sudo systemctl enable lightstore
    sudo systemctl start lightstore

    Queue Status

    You can check the queue service status using:

    bash
    sudo systemctl status lightstore

Managing Your Installation

Here are some useful commands for managing your Light Store installation:

bash
# (Re)start store
docker compose up -d --build
# The --build flag may be ommited if no code changes have been made.
# However, it is recommended to re-build each time, in case changes were made.

# Stop store
docker compose down

# View logs
docker compose logs -f app

Upgrading

Upgrading the store is simple using Docker

  1. Download the new zip from the BuiltByBit page
  2. Shut down the store:
    bash
    docker compose down
  3. On the remote machine, delete the old folder (containing the docker-compose.yml file)

    WARNING

    Deleting this directory will not delete your data. Your app data is stored in Docker volumes. As long as said volumes are not deleted, the data will persist.

  4. Upload the new zip and unzip, like in the installation procedure
  5. Run compose up to start
    bash
    docker compose up -d --build