I cant browse the kobo by ip

Hi dear,

I installed kobo toolbox on my server but without domin and it works correctly in same pc,
when I browse kf.kobo.local. But i cant access to server from another pc by browser when i enter the ip server in browser.

Although i added roule to hostes file

192.168.88.77 kf.kobo.local kc.kobo.local ee.kobo.local


Unfortunately, this is a limitation of the current setup. The NGINX container depends on the hostname to figure out what service you’re trying to reach (KPI, KoBoCAT, or Enketo).

If you use a custom Docker setup, you can assign different port numbers to each service and eliminate the need for hostnames, but I don’t have a step-by-step walkthrough available for that now.

If you’re using a server that many people will access, then you really should use HTTPS with a real DNS name (it’s a security risk if you do not). If you’re just accessing from a few clients on a LAN, then maybe you can configure the hosts file on each client computer. Also, many inexpensive routers designed for people’s homes allow the configuration of custom DNS records: this is a solution you could use if you do not have a dedicated DNS server on your LAN. For that, you may be interested in the OpenWrt Project.

1 Like

Thank you for your time

But how i can get ports number that docker assigned it to every service(KPI, KoBoCAT, or Enketo) and can i access to services if i connect to server by ip and port if i get on it

Ex:

192.168.88.77:3388

There’s quite a bit of tedious work involved to accomplish this, and you’d really have to weigh the effort carefully against how hard it would be to set up some kind of DNS instead. However, if you really must use port numbers, here are some places to start. This isn’t an exhaustive guide, and you should proceed only at your own risk. I might not be able to help again for weeks or months if you get stuck, although others in the community may be able to give assistance. There are no guarantees.

You would not have to worry about the ports that each application listens on, but you would have to change the NGINX configuration and then configure the applications to communicate with each other by port number instead of hostname. Let’s use this example:

$ docker ps
CONTAINER ID   <snip>   PORTS                  NAMES
05e709982b7a   <snip>   0.0.0.0:80->80/tcp     kobofe_nginx_1
1dac2d1fc448   <snip>   8000/tcp               kobofe_kpi_1
f76c4ebed1f3   <snip>   8000-8001/tcp          kobofe_kobocat_1
8cc92847a458   <snip>   8005/tcp               kobofe_enketo_express_1
4fb977f49306   <snip>   6379/tcp               kobobe_redis_cache_1
bce62dd536a7   <snip>   5432/tcp               kobobe_postgres_1
a06c464d189a   <snip>   27017/tcp              kobobe_mongo_1
34cadeccbbfa   <snip>   6379/tcp               kobobe_redis_main_1

Assuming that the IP of my host here is 10.1.2.3, I would usually have three hostnames pointing to that address:

  • kf.my.host → 10.1.2.3
  • kc.my.host → 10.1.2.3
  • ee.my.host → 10.1.2.3

NGINX would receive requests for all three on port 80, and the proxy_pass directive would tell it how to route traffic based on the HTTP Host header:

  • kf.my.host → port 8000 of the KPI container,
  • kc.my.host → port 8001 of the KoBoCAT container,
  • ee.my.host → port 8005 of the Enketo container.

All of those application ports can stay the same, but to avoid using hostnames, you’d have to make NGINX listen on three ports instead of one. Let’s say you picked 81, 82, and 83. You’d then change the three server blocks (for KPI, KoBoCAT, and Enketo) in the NGINX configuration to listen on ports 81, 82, and 83, respectively, instead of having them all set to 80. That would let you stop relying on server_name to route the traffic. See this configuration template.

You would also have to configure Docker to publish ports 81, 82, and 83 of the NGINX container instead of just 80. See ports in this example Docker Compose configuration override file.

Finally, you would have to tell the applications how to communicate with each other via ports instead of hostnames. We haven’t tested this in a long time, but you should be able to do it by hard-coding KOBOFORM_URL, KOBOCAT_URL, ENKETO_URL, and all the …INTERNAL_URL environment variables. Here’s one file that you would have to change, but it’s not the only one.