How to connect Meilisearch on Laravel Forge


2 min read

Hi, today I'm going to show you how to connect a Meilisearch server to a Laravel Forge server app.

As you might know, Laravel Forge supports 7 types of server and one of them is Meilisearch. The Meilisearch instance must have its own server - for testing purposes or light web applications the $5 DigitalOcean is fine

First of all you will need to create the Meilisearch server:

CleanShot 2022-03-17 at 08.57.01.png

Once it's been created, you will need to go to the Network tab on your Meilisearch server and allow the connection to your Laravel application - You will need to the same thing on your Laravel application Network tab

CleanShot 2022-03-17 at 09.00.38.png

Now we need the get the MEILISEARCH_KEY to use on our Laravel application. To do so, you will need to go to the Meilisearch tab and enter the Master Password that Laravel Forge showed/sent you.

CleanShot 2022-03-17 at 09.13.42.png

You will then need to copy the Default Admin API Key and assign it into your Laravel application MEILISEARCH_KEY .env file key

CleanShot 2022-03-17 at 09.13.53.png

Your MEILISEARCH_HOST should be http://YOUR_MEILISEARCH_SERVER_IP however, if you change your default site and assign a domain/sub-domain, you will need to give the following value http://YOUR_MEILISEARCH_DOMAIN (https if you have installed a SSL certificate)

You don't need to specify the 7700 port as Laravel Forge will proxy the port 80 to

That's all there is to it.

If you have any questions, please leave a comment below.