top of page

Your step-by-step guide to installing and configuring Typesense on GCE


If you've spent hours searching the internet for instructions on installing Typesense on Google Compute Engine without success well, you're not alone. We understand the frustration that comes with this challenge. Therefore, we decided to create a Typesense setup guide that can assist anyone who is in need of step-by-step support for installing Typesense. Our aim is to make the process easier and more accessible for everyone and provide a seamless installation experience for Typesense on Google Compute Engine.

Before we dive into the installation steps, let's first understand what Typesense is and why it's a great search engine alternative. Typesense is an open-source, fast, and easy-to-use search engine that offers robust search features, such as faceting, autocomplete, and typo tolerance. It is an excellent choice for building search engines for e-commerce websites, forums, and knowledge bases.

One of the main reasons to consider installing Typesense on Google Compute Engine is to improve the search capabilities of your application. While Google Cloud Firestore is a great database option, it doesn't have the most robust query capabilities, particularly for text search. If you want to make the search functionality of your application more user-friendly, you will need to use extensions like Typesense.

Firestore is a NoSQL document database that stores data in a hierarchical format called collections and documents. It is an excellent choice for building scalable and flexible applications. Firestore also offers powerful features such as real-time updates and offline support. However, regarding text search, Firestore's query capabilities are limited to simple text matching and exact matches.

Typesense, on the other hand, is an open-source, fast, and easy-to-use search engine that offers robust search features, such as faceting, autocomplete, and typo tolerance. It is an excellent choice for building search engines for e-commerce websites, forums, and knowledge bases. Typesense is specifically designed for text search and offers more advanced query capabilities than Firestore. Now, let's get to the installation steps. It's worth noting that there is not much documentation available in one place, and you may have to do a lot of trial and error to accomplish this.

Step 1: Create a VM Instance on Google Compute Engine by choosing the VM Configuration needed for your requirements. Step 2: Connect to the VM Instance using SSH. Step 3: Install Typesense Server on your VM Instance by running the appropriate command based on your OS. You can refer to the Typesense documentation for the commands for different OSs. Step 4: Note your External IP address. You can find this information in the Google Cloud Console. Step 5: Configure Ingress and Egress firewall rules to open port 443 for your External IP. Give higher priority to your firewall rules (set priority to 1 and 2). When you add firewall rules, note down the Target Tags. Target Tags are needed to be updated on the VM Instance. Step 6: Update network tags on your VM Instance. You can do this by going to the Google Cloud Console, selecting your VM Instance, and clicking on "Edit". Step 7: Add the following metadata to your VM Instance:

  • enable-config - TRUE

  • enable-guest-attributes - TRUE

Step 8: Run a connectivity test to check if the IP and Port are accessible. You can do this using a tool like telnet or nc. Step 9: Run the following command on the SSH window: sudo nano /etc/typesense/typesense-server.ini; this opens your config file Step 10: Change the api-port to 443 in your config file Step 11: Install the certificate and move the certificate using the following commands in the SSH window (You may be asked to add an A record in your DNS settings before you can generate the certificate):

  • sudo cp /etc/letsencrypt/live/YOUR_DOMAIN_NAME/fullchain.pem /etc/typesense-server/ssl/fullchain.pem

  • sudo cp /etc/letsencrypt/live/YOUR_DOMAIN_NAME/privkey.pem /etc/typesense-server/ssl/privkey.pem

Step 12: Restart the Typesense server using the following command: sudo systemctl restart typesense-server.

Congratulations! You have successfully installed Typesense on Google Compute Engine. It's worth noting that while the above steps may seem straightforward, the process can be challenging due to the lack of consolidated documentation. This blog post has made it easier for you to install Typesense on Google Compute Engine.

In conclusion, Typesense is a great search engine alternative that offers robust search features, and it's effortless to use. Installing Typesense on Google Compute Engine can be challenging, but by following the above steps, you should be able to get it up and running.


95 views0 comments

コメント


bottom of page