In this post, you'll learn how to deploy MeiliSearch to production with Laravel Forge in easy-to-follow steps. Without too much introduction, let's get started and get it up and running.
What is MeiliSearch?
MeiliSearch, it's the "Next-generation search API" which is just like Algolia but it's open-source and free to use. By default, MeiliSearch is blazing fast, tolerant to typos, synonymous, comes with filterings, language support, and more.
What is Laravel Forge?
Forge allows you to painlessly create and manage PHP servers which include MySQL, Redis, Memcached, database backups, and everything else you need to run robust, modern Laravel applications.
Laravel Forge Server Types
At the time of this writing, Laravel Forge support 7 types of server and below you can see the full breakdown of what is offered by each server type. To run MeiliSearch, they have a dedicated "MeiliSearch Server" and everything that's necessary to run and operate MeiliSearch is managed automatically by Laravel Forge, so you don't have to worry about future updates and more. Laravel Forge Server Types Do note that by default you will need to have a server connected to Laravel Forge which you can do so by adding the server by pressing any of the providers below. In this case, Vultr and Hetzner are ready to add a new server. Laravel Forge Add Provider
Step 1: Create Server
Once you have set up a provider create a new server and add the credentials as follows. Make sure to save the sudo password and meilisearch password somewhere safe. Create a New MeiliSearch Server on Laravel Forge Do note that the server will take about 10 minutes to provision. Grab your coffee in the mean time ☕️ Laravel Forge Initializing MeiliSearch Server The site will be called "default" and you don't have to change the name, if you do then you can change the name from the "meta" tab within the "default" site. Laravel Forge Default Site
Step 2: Retrieve the API Keys from the MeiliSearch Sidebar
To retrieve the Public and Private Key you can access it by providing the "Master Password" from the "API Keys" page below. MeiliSearch API Keys Pressing "Reveal" will show you the "private" and "public" key like below. MeiliSearch Private and Public Key
Step 3: Update the Server Network (MeiliSearch-Server)
MeiliSearch Result Preview By now you should be able to Deploy MeiliSearch on Laravel Forge and on the next tutorial, you'll be learning to build the front-end for the search result so stay tuned for that. If you found this tutorial do share it with your friends and happy coding. 🎉
Leave a reply