I'm trying to run Joplin Server on my Synology NAS DS220+ with Docker already installed. I'm inexperienced with Docker so I use Portainer to deploy a stack.
What I want to achieve is running Joplin Server without a reverse proxy and without port forwarding other than port 1194 for OpenVPN (OpenVPN already works). So I try to use localhost:22300 for local Joplin access, but the page 192.168.x.x:22300 does not load (192.168.x.x is my static NAS IP).
It only works, when I use APP_BASE_URL=https://joplin.mydomain.synology.me and use a reverse proxy source https, joplin.mydomain.synology, 443; target http, localhost, 22300; and port forwarding https 443 to my NAS IP in my router.
I've read in some threads on this forum, that local access should work with code given above. But I can't see any reason why it does not work.
Do you have any clue where I have to start looking for errors?
I've got a similar setup, but use an Ubuntu laptop running docker with a Joplin server container. I've got the APP_BASE_URL set as http://hostname:22300, and it works well. You do have to make sure your client can resolve hostname to the IP address of the Synology. I think there are various ways; hosts file, your router, maybe a pihole (very much recommended as another container on your synology) or perhaps your own DNS server if you're looking for something else to learn/set up.
For external access, I use OpenVPN into the same Ubuntu laptop, and client can then also sync using http://hostname:22300 as the sync target.
Works beautifully, so thanks to Team Joplin!
Thanks for the input, and it is good to know that my plan should work out.
I don't have problems with my clients (yet). The problem is that I can't access the Joplin Server by typing 192.168.x.x:22300 in my browser. If I get things right, this should work.
If I needed to edit my hosts file, what should I enter? Isn't 192.168.x.x:22300 the correct address to access the joplin server site within my LAN?
Does your Synology NAS have a name? What happens if you try to ping it by name?
If you can ping it by name, try hitting http://[name]:22300 and see what you get.
If you can't ping it by name, you could add an entry into your hosts file like this:
192.168.x.x name
Once you have, you should be able to ping it by name and access it by http://[name]:22300
(you will also have had to set the BASE_URL to http://[name]:22300 or Jopin Server won't let you in).
My NAS has a name. The hosts file was edited before I startet my Joplin project, I added the line 192.168.x.x mydomain.synology. me.
I can access the NAS UI with either mydomain.synolgy. me:5001, 192.168.x.x:5001 or NAS_name:5001.
If i try to ping any of these (without a port), I get four timeouts in all cases. Can this be an issue? All other services work. I also have paperless-ng via docker, that can be called with 192.168.x.x:8931 without any issues.
Ok to ping my did not work because of the synology firewall. When I disable it, I can ping my NAS local IP. Port 22300 was allowed by the firewall all the time.
Now I retried to use APP_BASE_URL=http://[NAS_name]:22300 and it works. It had to wait a bit after it worked in the same browser Portainer was active.
Syncing with my desktop client and mobile client works, but when I use OpenVPN, no connection can be established. Does [NAS_name]:22300 not work when accessing via VPN? What else can I use then?
Edit: I re-enabled the firewall. The firewall was not an issue at any time. Access to Joplin server only works with [NAS_name]:22300, but not with 192.168.178.50:22300, which I don't understand.
Access via OpenVPN to my NAS is possible with the NAS IP 192.168.x.x but not with the NAS name. This seems to be expected and has to solved with a DNS server, as I found out.
If Joplin was accessible via the NAS IP and only via the NAS name, it would be easier to connect with OpenVPN.
I'll try to figure out on how to set up the DNS server, then I will state here what is the end result.
I use OpenVPN and specify in its config that the VPN client should use my local DNS (that PiHole I mentioned earlier). Config line in server.conf is:
push "dhcp-option DNS 192.168.xx.x"
That means my Android phone can access Joplin using [NAS_name]:22300
I might use a PiHole, that would help as I see and have other benefits. But for now I want to keep things simple.
Do you have any idea why the hostname works and the IP adress not when accessing Joplin? In general it should work, and I'm curious what is the issue on my end.
So to summarize: You are able to call the Synology GUI with it's IP address, and you are also able to call a docker container with it's specified port via IP address, but joplin-server is not responding to the calls via IP address and the port specified in the docker file (22300)?
And everything, even joplin-server works with the hostname of the Synology NAS (at least without VPN)?
Hmm, I really don't know if I can help in this case...you could possibly try to map the container port 22300 to some other port on the host (for example port 80 or 2000 or something..) and point the ip address to that port:
In the docker compose file:
ports:
- "2000:22300"
In the browser:
[ip-address]:2000
With that.you can maybe check if it's the fault of the chosen port...
Unfortunately, this does not work either. With both APP_BASE_URL=http://hostname:22300 and APP_BASE_URL=http://192.168.x.x:22300 the container is not accessible.
I guess I have to use some of the known workarounds then.
But in general, using the IP instead of the hostname should work, right? So I assume that some configuration of my NAS blocks using the IP?