Services & tools

Databases & services

MySQL/MariaDB, PostgreSQL, Redis/Valkey, Mailpit and Meilisearch, with ready-made .env values.

التوثيق متاح باللغة الإنجليزية، مثل أوامر LaraMonster وواجهته.

LaraMonster runs the databases and services Laravel apps usually need, each with a ready-made block of .env values. Their data lives in LaraMonster's home folder, separate from anything else on your computer.

ServiceDefault portUsed for
MySQL / MariaDB3306The most common Laravel database
PostgreSQL5432Postgres databases
Redis / Valkey6379Cache, queues, sessions, Horizon
Mailpit1025 (SMTP)Catching outgoing mail; see Mail inbox
Meilisearch7700Search with Laravel Scout

Installing and starting a service

  1. Open the Services page

    Each service shows whether it's installed and running.

  2. Install it if needed

    PostgreSQL, Mailpit and Meilisearch are downloaded as portable builds. MariaDB and Redis/Valkey are installed with your package manager (Homebrew, apt, dnf, pacman, zypper, winget or Scoop), which may ask for your password. An existing install on your computer is used when found.

  3. Start it

    Click Start. Turn on the switch to start it together with LaraMonster every time.

From the terminal:

$ laramonster services                     # list them with their state
$ laramonster service install postgres
$ laramonster service start mysql
$ laramonster service enable redis         # start with LaraMonster
$ laramonster service stop mysql

Connecting your app

Each service card has a .env block with a Copy button. Paste it into your project's .env (or use the site panel's Environment tab). Or print it:

$ laramonster service env mysql
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=laravel
DB_USERNAME=postgres
DB_PASSWORD=
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025

SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://127.0.0.1:7700
Local only. Services listen on 127.0.0.1 with the database's default user and no password. That's fine on your own computer; never copy these values to a server.

Creating a database

The new-project wizard creates the database for you. For an existing project, create it with any client (TablePlus, DBeaver, phpMyAdmin) or from the terminal:

$ mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE shop'
$ psql -h 127.0.0.1 -U postgres -c 'CREATE DATABASE shop'

Then set DB_DATABASE=shop and run php artisan migrate.

Changing a service's port

If a database is already running on your computer (say the system's own MySQL on 3306), LaraMonster doesn't fight it: when a project needs the service and the port is taken, it runs its own copy on the next free port and the .env block shows that port. To choose a port yourself:

$ laramonster service port mysql 3307

Where the data lives

Each service keeps its data under services/<name>/data in the LaraMonster home folder (see where its files live). Logs are on the Logs page, or with laramonster logs mysql.

To back up a database, use the usual tools while the service runs:

$ mysqldump -h 127.0.0.1 -u root shop > shop.sql
$ pg_dump -h 127.0.0.1 -U postgres shop > shop.sql