Skip to content

Command-line install ​

php artisan replora:install does everything the web installer does, in one command: server check, purchase code and modules, .env, tables and the first administrator. Use it on a VPS, in a Docker image or in a deployment script.

5 minutesDevOpsCommand lineSingle user · SaaS

Interactive ​

Run it in the application folder as the web server user and answer the questions:

bash
cd /var/www/replora
sudo -u www-data php artisan replora:install

It asks, in this order: Site address (suggested http://127.0.0.1:8000, what php artisan serve uses, unless APP_URL is already set), Purchase code, Database host (127.0.0.1), Database port (5432), Database name, Database user, Database password, Admin name, Admin email, Admin password (10+ characters) and, with the SaaS package, the Edition.

Every option ​

OptionDefaultWhat it does
--url=askedThe address people open the dashboard with, e.g. https://analytics.example.com (or http://127.0.0.1:8000 for php artisan serve). Saved as APP_URL; sign-in is set up for that host and port (SANCTUM_STATEFUL_DOMAINS), and the license is attached to its domain
--purchase-code=askedYour purchase code. See Your purchase code
--skip-licenseoffGo on without a code. Only builds that allow it (every module bundled); otherwise This copy needs a purchase code: use --purchase-code=…
--db-host=127.0.0.1PostgreSQL host name or IP address
--db-port=asked (5432)PostgreSQL port, 1–65535
--db-database=askedDatabase name: letters, numbers, _, $ and -, at most 63 characters
--db-username=askedDatabase user (one line, at most 80 characters)
--db-password=askedDatabase password (may be empty: pass --db-password=)
--admin-name=askedThe first administrator's name
--admin-email=askedTheir sign-in email
--admin-password=askedTheir password, at least 10 characters
--mode=asked with the SaaS package, else singlesingle or saas (saas needs the saas/ folder). Saved as REPLORA_MODE
--no-interaction / -noffNever ask: every value must be given as an option

Unattended install ​

For scripts, CI and container entrypoints pass every value and --no-interaction:

bash
php artisan replora:install --no-interaction \
  --url=https://analytics.example.com \
  --purchase-code="$REPLORA_PURCHASE_CODE" \
  --db-host=db --db-port=5432 --db-database=replora --db-username=replora --db-password="$DB_PASSWORD" \
  --admin-name="Alex Morgan" [email protected] --admin-password="$ADMIN_PASSWORD" \
  --mode=single

On an installed site the command refuses to run (Replora is already installed., exit code 1), so an entrypoint can call it on every start: check the exit code, or test for storage/app/replora-installed.json first.

Keep secrets out of your shell history

Options typed on the command line end up in ~/.bash_history and in the process list. In scripts, read them from environment variables as above, or leave the passwords out and type them when asked.

What it does ​

  1. Refuses on an installed site.
  2. Checks the server like the installer's first step and stops with every failed item and its fix (✗ PHP extension: zip — Enable the zip extension…).
  3. Prepares .env: copies .env.example when there is no .env and creates a fresh APP_KEY.
  4. Purchase code: asks the license server, installs the modules it sends (Downloading the modules… Checking the download… Installing the modules…), then prints Purchase code verified. Because this process started without the modules, the installation continues in a fresh process with the same options; you don't need to do anything.
  5. Validates the answers (address, host, port, names, email, password length, edition) and stops with the reasons.
  6. Database: tests the connection (Connecting to the database and creating tables…), writes the database, APP_URL, APP_ENV=production, APP_DEBUG=false, SESSION_DRIVER=file, CACHE_STORE=file, QUEUE_CONNECTION=database and SANCTUM_STATEFUL_DOMAINS to .env, and runs every migration.
  7. Administrator: creates the first user (an administrator with their own account) and refuses if any user exists (An account exists already. Sign in instead.).
  8. Finishes: writes REPLORA_MODE and the installed marker that closes the web installer, then prints Replora is installed. Sign in at https://…/login as ….

If .env can't be written at the end, the command prints a warning such as Add REPLORA_MODE=saas to .env (it could not be written).

More commands for a new installation ​

CommandWhen
php artisan replora:admin --name= --email= --password= --organization=Create another administrator (asks for anything left out). Useful when you are locked out
php artisan replora:core [--purchase-code=] [--force]Download the modules again (deleted or not copied modules/ folders)
php artisan replora:doctor [--single-server]Check the configuration for production and scaling
php artisan replora:healthRun the service checks of the System page
php artisan replora:recaptcha offSwitch reCAPTCHA off when a wrong key keeps everyone from signing in

Every command is listed in Commands.

Replora: see what your visitors see.