#community-help

Setting Up and Accessing Remote Typesense Instance.

TLDR Kyle had trouble accessing a Typesense instance remotely. Jason helped them realize the solution lies in server configuration, opened ports, and necessary SSL certificates for individual sub-domains along with enabling CORS.

Powered by Struct AI

3

13
14mo
Solved
Join the chat
Sep 02, 2022 (14 months ago)
Kyle
Photo of md5-d62c888559aeefb5fc083766631ff05e
Kyle
03:37 PM
Hey there, so this feels a little junior but I'm migrating from Algolia and tested out Meilisearch but I found them both to have some limitations that didn't make sense for my usage. I'm trying to spin up my first docker instance to run Typsesense on and I was able to successfully pull and install it to docker but I'm not exactly sure how to access it remotely. I can ping the Typesense server with curl <http://localhost:8108/health> while in my docker console and get back a status {"ok":true} but I'm not sure how to access it remotely. It's hosted on a DigitalOcean droplet with it's own IP address but when I try to ping that ip it times out.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:57 PM
Could you make sure port 8108 is open in the firewall rules for your droplet?
03:58
Jason
03:58 PM
On a side note, if you’re running on a droplet, instead of worrying about Docker, I’d recommend just installing one of the native binaries (via DEB / RPM). Docker will be one less thing to worry about
Kyle
Photo of md5-d62c888559aeefb5fc083766631ff05e
Kyle
04:10 PM
That might be easier true.
04:35
Kyle
04:35 PM
Able to set it up on a DEB binary and I confirmed there's no firewall rules. Is this down to the native configuration for typesense possibly not having cors enabled and having the api address not set?
04:38
Kyle
04:38 PM
Ahh okay, I was able to reach it externally so long as the port was in the url.

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:39 PM
By default Typesense will bind to all available IPs on the server
Kyle
Photo of md5-d62c888559aeefb5fc083766631ff05e
Kyle
04:41 PM
Affirmative, apologies I'm still new to the backend side of things. Appreciate the help

1

07:01
Kyle
07:01 PM
I suppose final question on this matter. If I want to access the typesense instance from a remote server. ex. <http://typesense.mywebsite.com|typesense.mywebsite.com> I would assume I would just create and A Record for my DNS settings for the subdomain.

What things do I need to configure on the server side? I figured enabling cors and setting the cors domains would link it externally but I'm still not getting a response when I ping the health.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:16 PM
CORS is independent of DNS. You would have to do both
07:17
Jason
07:17 PM
You also want to probably get an SSL certificate from say LetsEncrypt and setup typesense on port 443 with the SSL certificate and key, so it’s secure over the internet
Kyle
Photo of md5-d62c888559aeefb5fc083766631ff05e
Kyle
07:29 PM
Gotcha, I did both but it sounds like the SSL might be the issue. If my domain already has a certificate on the main domain through Google Trust Services do I need to further configure things on the back end then for a subdomain?

Currently hosting through firebase.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:32 PM
Unless it’s a wildcard SSL cert, you need separate SSL certs for each sub-domain as well

1