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

rotaercz's avatar

Is there an easy way to add Typesense using Laravel Forge?

So I have an existing web app using Laravel Forge. I'd like to add Typesense without having to provision a new server. I was wondering if there is an easy way to do this using Forge? My development environment is Laravel Sail if that makes any difference.

0 likes
6 replies
LaryAI's avatar
Level 58

Adding Typesense to an existing Laravel Forge server is relatively straightforward. Laravel Forge allows you to run custom shell commands on your server, which you can use to install Typesense. Here's a step-by-step guide to get you started:

  1. SSH into Your Server: First, you need to SSH into your server managed by Laravel Forge. You can do this from your terminal:

    ssh forge@your-server-ip
    
  2. Install Typesense: Once you're logged in, you can install Typesense. Typesense provides an installation script that you can use:

    curl -s https://install.typesense.org | bash
    

    This command downloads and runs the Typesense installation script.

  3. Configure Typesense: After installation, you'll need to configure Typesense. You can find the configuration file typically at /etc/typesense/typesense-server.ini. You can edit this file to set up your API key and other settings:

    nano /etc/typesense/typesense-server.ini
    

    Make sure to configure the api-key and other relevant settings according to your needs.

  4. Start Typesense Service: You can start the Typesense service with the following command:

    systemctl start typesense-server
    

    To ensure Typesense starts on boot, enable it with:

    systemctl enable typesense-server
    
  5. Configure Your Laravel Application: In your Laravel application, you will need to configure the client to connect to Typesense. If you're using Laravel Sail for your local development, you can add Typesense to your docker-compose.yml file to run it as a service alongside your application.

    For your production environment on Forge, you'll need to add the Typesense service provider and configure the .env file with your Typesense server details:

    TYPESENSE_HOST=your-server-ip
    TYPESENSE_PORT=8108
    TYPESENSE_API_KEY=your-api-key
    
  6. Install Typesense PHP Client: You will need to install the Typesense PHP client in your Laravel project to interact with Typesense:

    composer require typesense/typesense-php
    
  7. Index Your Data: With the client installed and configured, you can now index your data to Typesense. You'll need to write the logic to push your data to Typesense, which typically involves creating a command or job that reads from your database and indexes the data in Typesense.

  8. Test Your Setup: Finally, test your setup to ensure that your Laravel application can communicate with Typesense and that your data is being indexed and searched correctly.

Remember to check the official Typesense documentation for the most up-to-date installation instructions and configurations. Also, ensure that your server's firewall rules allow traffic on the port that Typesense is configured to use (default is 8108).

Please note that while Laravel Forge allows you to run these commands, you should always ensure that any additional services you install do not conflict with the existing setup and that you have the necessary resources (CPU, memory) to support running additional services on your server.

rotaercz's avatar

God damn. It's not just a button you can toggle on? haha

larasauce's avatar

I'd like to have the same thing they did for Meilisearch. But it looks like they've put Forge on autopilot for the past year (2024+) to focus on Cloud. Too bad. Forge is great for a lot of smaller apps/companies. Cloud, not so much.

zapps's avatar

I have some Live web apps and also wanted typesense. I also use forge.

The typesense installation process is easy. Its 2 steps. Its the config that will really slow you down depending on what you need. I also find that rarely does the product documentation actually help! It is forums and other developer experiences with the product that gets you through!

My advice would be provision a separate vps and setup with typesense. Save yourself alot of hassle. This way you can setup the config and secure typesense too. Typesense will be served over HTTPS and its how it should be in a production environment.

1 like
orphanedrecord's avatar

@zapps Do you have any specific links or tutorials that would help? Or can you provide more detail about your setup? I'm considering using Forge and Typesense on a future project. Any further suggestions would be appreciated!

Also, I saw the Typesense Docs are open source and perhaps we could help improve the Docs for Laravel integration.

dushano's avatar

If you can share some resources would be nice. I have hard time solving some problem connecting typesense and instant search etc.

Please or to participate in this conversation.