This guide walks you through a full production installation of Leo Counter on any modern Linux distribution — Fedora, Ubuntu, Debian, Arch, and others — using the automatedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
install.sh script. By the end you will have a running instance managed by systemd, so Leo Counter starts automatically when your machine boots and can be controlled with standard service commands.
Prerequisites
Before running the installer, make sure your system satisfies the following requirements. Docker Engine must be installed and the daemon must be running:docker compose subcommand (note: no hyphen):
docker group. Without this, the installer will fail when it tries to contact the Docker daemon without sudo:
newgrp docker) for the group change to take effect. Verify with:
Installation
Clone the Repository
Open a terminal and clone Leo Counter into the directory where you want it to live permanently. The installer will register this exact path in the systemd unit file, so choose carefully:
Configure Your .env File
If no Open The full set of relevant variables from Save the file. If the installer is already paused waiting for you, press Enter to continue. Otherwise proceed to the next step.
.env file exists, the installer copies .env.example automatically and then pauses so you can edit it. You can also create it manually before running the installer:.env in your preferred editor and set at minimum the four critical variables:.env.example is shown below for reference:Run the Installer
Verify the Installation
Open All eight containers (
http://localhost:8080 in your browser. You should see the Leo Counter registration page. Create your administrator account to complete the setup.You can also verify that all containers are healthy:leo_counter_app, leo_counter_queue, leo_counter_scheduler, leo_counter_reverb, mariadb_server, leo_counter_redis, phpmyadmin, mailhog) should show a status of Up.What install.sh Does
Detailed breakdown of all 13 installer phases
Detailed breakdown of all 13 installer phases
The script executes the following steps in strict order, aborting with a descriptive error message if any phase fails:
-
Requirement validation — Checks that
dockeris inPATH, that the Docker daemon is reachable, and thatdocker compose(v2) is available. -
.envcreation — If no.envexists, copies.env.exampleto.envand pauses for the operator to fill in credentials. -
Storage directory structure — Creates the directories Laravel requires at runtime:
storage/app/public,storage/app/data/movimientos,storage/framework/cache/data,storage/framework/sessions,storage/framework/views,storage/logs, andbootstrap/cache. Adds.gitkeepfiles so Git tracks the empty directories. -
Base permission adjustment — Runs
chmod 775onstorage,storage/framework,storage/logs,storage/app, andbootstrap/cacheto ensure the containerised web server can write to them. -
Build argument extraction — Reads
REVERB_APP_KEY,REVERB_APP_ID,REVERB_APP_SECRET,REVERB_HOST,REVERB_PORT,REVERB_SCHEME, andVITE_API_URLfrom.env. These values are injected as Docker build arguments so Vite can bake the correct WebSocket endpoints into the compiled JavaScript bundle. -
Docker image build — Runs
docker compose build --no-cachewith all extracted build arguments. Building from scratch ensures no stale layers are reused. -
Support services start — Brings up
db(MariaDB),redis,mailhog, andphpmyadminwithdocker compose up -d. -
Database health wait — Polls the MariaDB container’s health check (
mariadb-admin ping) every two seconds for up to 60 seconds. Exits with an error and prints the last 20 database log lines if the timeout is exceeded. -
Application container start — Brings up the
appcontainer (leo_counter_app) withdocker compose up -d appand waits for Apache/PHP to become responsive. -
Laravel setup — Inside the
appcontainer, runs in sequence:php artisan config:clear(flushes the build-time config cache so.envvalues take effect)php artisan migrate --forcephp artisan db:seed --forcerm -rf public/storagethenphp artisan storage:link --force(removes any stale symlink before recreating it)php artisan config:cache,route:cache,view:cache,event:cache
-
HTTP health check — Sends a
curlrequest tohttp://localhost:8080. If the response is not HTTP 200 or 302, the script prints the last 30 lines ofstorage/logs/laravel.logas a diagnostic aid. -
systemd service registration — Writes
/etc/systemd/system/leo-counter.service(usingsudo), sets theWorkingDirectoryto the current path, runssystemctl daemon-reload, and enables the service so it starts on boot. -
Final service start — Runs
docker compose up -dto bring up the remaining containers:queue-worker,scheduler, andreverb.
Service Ports
| Service | URL / Address | Purpose |
|---|---|---|
| Leo Counter App | http://localhost:8080 | Main web interface |
| PhpMyAdmin | http://localhost:8082 | MariaDB visual admin |
| Mailhog | http://localhost:8025 | Local email capture |
| Reverb WebSockets | ws://localhost:8085 | Real-time event bus |
Maintenance Commands
Managing the systemd Service
The installer registersleo-counter.service with systemd. Use these commands to control the application:
Direct Docker Compose Commands
If systemd is unavailable or you prefer working directly with Docker:Updating Leo Counter
To pull new code and rebuild:Checking Logs
When something goes wrong, the first place to look is the Laravel application log:If you see a blank or missing
storage/logs/laravel.log, the container may not have write access to the storage directory. Check that the directory permissions are set correctly (chmod 775 storage storage/logs) and that the Docker volume mount is working (docker compose exec app ls -la storage/logs).