Selfhosted: APP_URL and Extra hosts

Dear community,
I am hosting IN myself on my QNAP NAS using the official docker files from github. And I can access it only with the local IP address: But I want to achieve the following:

  1. Use a new port, instead of 80. Example:8003
  2. I want to reach IN with the host name as long as im in the LAN: http://in.localhost:8003, using any device in the network.
  3. In the near future make it available with my subdomain name:

I cannot achieve 1) and 2) despite multiple attempts. I am totally confused at the configuration options:

a) extra_hosts: The official docker compose contains the following definitions under the extra_hosts for all the services: in5.localhost: I changed them to in.localhost:

b) APP_URL is set to “http://in.localhost:8003”. I kept it as it is.

Can someone please explain the use of these fields and how to confiure/adapt these fields to be able to reach IN with the url: http://in.localhost:8003 ?

I believe once I can acheive 1) and 2), doing 3) will be straight forward. Editing the DNS settings of my hosting provider and port forwarding in my router. Am i correct ?

Thank you.

  1. To change the port open the docker-compose.yml and under the nginx service change the port:
      - "8003:80"

Then docker-compose up -d to update the changes.

  1. If you want to reach InvoiceNinja, which is running on your NAS, from any device in the same network using a hostname, you need to use the hostname of your NAS, and it needs to be resolvable using DNS. Otherwise there is no way for other devices on the network to know which IP to look for. Fortunately, nowadays many devices register itself using mDNS. To see if this is the case for your NAS, get its hostname (try hostname in a shell) and add .local to it if it doesn’t end with that already.
    Then try: http://my-nas.local:8003. Make sure to update your APP_URL.
1 Like

Hi Patrick,
Thanks for the quick reply. The one about mDNS is very helpful. I can now access using the hostname instead of the IP.
Do you perhaps know what and how should the extra_hosts field be configured ? I know that would actually add an entry in the /etc/hosts file of the container. But what is it for ?

Thanks again.

Glad I could help. That hosts file is needed when you want to install InvoiceNinja locally on your own computer. So you shouldn’t need it. See: