Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stratboy's avatar

Deploy a Sail installation with mailisearch vs typesense?

I never did a real deploy with Laravel, except a simply one just to demo Dreeze on a shared host. I'm not a sys admin. I was wandering: given that my current app is a Sail/Docker install of a non-profit, low traffic project (and thus I shouldn't spend a lot for hosting, so for example Forge shoud not be an option), where should I deploy? And will be easier to deploy meilisearch or typesense? I read the deploy docs of both, didn't understand too much but I guess that being my current environment a Docker one, could be different, maybe easier. Not sure.

0 likes
1 reply
LaryAI's avatar
Level 58

Deploying a Laravel application with Sail, along with either Meilisearch or Typesense, can be done using Docker. Since you are already using Sail, which is a Docker-based solution, it should be relatively straightforward to add either Meilisearch or Typesense to your setup. Below, I'll provide a step-by-step guide for both options.

Deploying with Meilisearch

  1. Add Meilisearch to your docker-compose.yml file:

    version: '3'
    services:
        # Other services like app, db, etc.
        meilisearch:
            image: getmeili/meilisearch:latest
            ports:
                - "7700:7700"
            volumes:
                - meilisearch_data:/meili_data
            environment:
                MEILI_NO_ANALYTICS: "true"
    
    volumes:
        meilisearch_data:
    
  2. Update your Laravel configuration:

    In your .env file, add the following:

    MEILISEARCH_HOST=http://meilisearch:7700
    
  3. Install the Laravel Scout and Meilisearch driver:

    composer require laravel/scout meilisearch/meilisearch-php
    
  4. Configure Scout to use Meilisearch:

    In your config/scout.php file, set the driver to meilisearch:

    'driver' => env('SCOUT_DRIVER', 'meilisearch'),
    
  5. Run your Docker containers:

    ./vendor/bin/sail up -d
    

Deploying with Typesense

  1. Add Typesense to your docker-compose.yml file:

    version: '3'
    services:
        # Other services like app, db, etc.
        typesense:
            image: typesense/typesense:latest
            ports:
                - "8108:8108"
            volumes:
                - typesense_data:/data
            environment:
                TYPESENSE_API_KEY: "your-typesense-api-key"
                TYPESENSE_DATA_DIR: "/data"
                TYPESENSE_ENABLE_CORS: "true"
    
    volumes:
        typesense_data:
    
  2. Update your Laravel configuration:

    In your .env file, add the following:

    TYPESENSE_HOST=http://typesense:8108
    TYPESENSE_API_KEY=your-typesense-api-key
    
  3. Install the Laravel Scout and Typesense driver:

    composer require laravel/scout typesense/typesense-laravel-scout
    
  4. Configure Scout to use Typesense:

    In your config/scout.php file, set the driver to typesense:

    'driver' => env('SCOUT_DRIVER', 'typesense'),
    
  5. Run your Docker containers:

    ./vendor/bin/sail up -d
    

Choosing Between Meilisearch and Typesense

Both Meilisearch and Typesense are excellent search engines, and the choice between them can depend on your specific needs:

  • Meilisearch is known for its ease of use and speed. It is a good choice if you want a simple setup and fast search capabilities.
  • Typesense offers more advanced features like multi-tenant support and fine-grained control over search behavior. It might be a better choice if you need more customization and control.

Given that you are already using Docker with Sail, deploying either Meilisearch or Typesense should be relatively straightforward. Choose the one that best fits your project's requirements and follow the steps above to integrate it into your Laravel application.

Please or to participate in this conversation.