Restrict typesense to localhost only

273 Views Asked by At

I am trying to host typesense in a self-hosted virtual machine. I don't want to expose the typesense to the public. I want to restrict access from localhost only. How can I restrict the typesense from accessing outside?

1

There are 1 best solutions below

2
On

You want to set the --api-address and --peering-address to 127.0.0.1 to ensure that Typesense is only listening for inbound connections from localhost.

These two parameters are documented here: https://typesense.org/docs/0.23.1/api/server-configuration.html#using-command-line-arguments

--api-address

Address to which Typesense API service binds. Default: 0.0.0.0

--peering-address

Internal IP address to which Typesense peering service binds. If this parameter is not specified, Typesense will attempt to use the first available internal IP.