Install Laramin from the command line
Install Laramin with one command, php artisan app:install. It checks your environment, builds the database, seeds starter data and records versions.
- Applies to
- Core 12.0 and later
- Who can do this
- Platform owner, Developer
- Where
- Command line, in the application folder
On this page
The command-line installer suits developers, CI pipelines and servers you can reach over SSH. It uses the same install steps as the web installer.
Before you start
- Have shell access to the server.
- Install PHP 8.3 or later with the required extensions, Composer 2.x, and Node.js 18 or later with npm.
- Create an empty MySQL 5.7 or 8.x database.
Steps
-
Copy the example environment file:
BashCouldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
cp .env.example .env -
Open
.envand setDB_CONNECTION,DB_HOST,DB_PORT,DB_DATABASE,DB_USERNAMEandDB_PASSWORD. SetAPP_URLto your site's address. -
Install the PHP dependencies:
BashCouldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
composer install -
Build the front-end assets:
BashCouldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
npm ci && npm run build -
Run the installer:
BashCouldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
php artisan app:install -
Wait for Installation complete. The command also tells you where it wrote the install log.
Tip: The wrapper scripts run steps 1 to 5 for you: ./install.sh on Linux or macOS, and .\install.ps1 in Windows PowerShell. Pass --fresh (or -Fresh in PowerShell) to rebuild an existing database.
Options
| Option | What it does |
|---|---|
--fresh | Drops all tables and rebuilds the database. This deletes everything in it. |
--no-seed | Skips database seeding. |
--no-modules | Skips the module seeders. Core seeders still run. |
--no-key | Doesn't generate a new APP_KEY. |
Without --fresh, the installer refuses to run against a database that already has tables.
Danger: --fresh drops every table in the database before it rebuilds. Never run it against a database that holds data you want to keep.
What happens next
The installer seeds a default super admin: admin@admin.com with the password 12345678.
Careful: Sign in and change that password straight away. See Change your password. If you ran the installer with --no-seed, no account is created, so there is nobody to sign in as.
Then add the scheduler to your crontab so that scheduled jobs run once a minute:
Couldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
* * * * * cd /path/to/laramin && php artisan schedule:run >> /dev/null 2>&1Replace the highlighted values with your own.
Next, sign in for the first time.
Thanks. That helps us decide what to write next.
Thanks for telling us what was missing.
You already answered for this article today. Thanks.
We got a lot of answers from your network just now. Try again in a few minutes.
We couldn't send that. Check your connection and try again.
Links in this article
Printed from help.laramin.in. The online article may have changed since.