Trouble connecting to self-hosted Joplin server

Operating system

Linux

Joplin version

2.9.7

Desktop version info

Not sure of the Joplin version. Don't know how to find out at this stage.

Not got as far as using a Desktop App yet

What issue do you have?

I am trying to install self-hosted Joplin server on headless Linux Ubuntu Server 24.04 using Docker. I have never used Docker before so I am clueless. As far as I know I have installed Docker and Joplin correctly (no obvious errors that I have seen). The problem start when I try to connect to the server. For example when I use 'http://[host name]:22300' in the browser I get 'This site cannot be reached' error. If I try 'curl http://[local host]:22300' on the server I get 'curl: (7) Failed to connect to localhost port 22300 after 0 ms: Couldn't connect to server'.

The joplin-docker-compose.yml file I used to create everything is as follows:
services:
db:
image: postgres:16
volumes:
- ${POSTGRES_DATA_PATH:-./joplin/postgres}:/app_data/apps/docker/joplin
ports:
- "5432"
restart: always
environment:
- POSTGRES_PASSWORD=[My Password]
- POSTGRES_USER=joplin
- POSTGRES_DB=joplindb
app:
image: joplin/server:latest
container_name: joplin-server
depends_on:
- db
ports:
- "8080:8080"
restart: always
environment:
- APP_PORT=8080
- APP_BASE_URL=http://[host name]:22300
- DB_CLIENT=pg
- POSTGRES_PASSWORD=[My Password]
- POSTGRES_DATABASE=joplindb
- POSTGRES_USER=joplin
- POSTGRES_PORT=5432
- POSTGRES_HOST=db

'merlin' is the name of my host server.

I start Docker as follows:
sudo docker compose -f joplin-docker-compose.yml up -d

When I issue 'sudo docker ps' at the terminal I get the following:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
78f61fa852d7 joplin/server:latest "tini -- yarn start-…" 10 hours ago Up 10 hours 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp joplin-server
af5503e11577 postgres:16 "docker-entrypoint.s…" 10 hours ago Up 10 hours 0.0.0.0:32768->5432/tcp, [::]:32768->5432/tcp docker-db-1

To the uninitiated (me) this seems OK.

I have not installed nginx. Do I need to? I only intend to use Joplin at home, no internet access.

When I try to access the Joplin server to setup the Admin profile (using http://[host name]:22300) I cannot connect to it. Please tell me what I am missing.

Regards, StuartM

@stuartm welcome to the forum.

From a quick glance it seems that you are setting all ports to 8080 (including the one inside the container that Joplin is using and is best left alone), and then saying that the client should connect on port 22300.

Initially try:

ports:
  - "22300:22300"
restart: always
environment:
  - APP_PORT=22300
  - APP_BASE_URL=http://[host name]:22300

OR

You could try just setting - APP_BASE_URL=http://[host name]:8080 with your original settings and trying to connect using that. I've never tried that! The first option is more the Joplin published way and it may be better to get it working before applying customisation.

Also if you call the docker file docker-compose.yml or compose.yml and you are in the same folder as that file you can start the server using just docker compose up -d (saves a little typing!)

If you want to use HTTPS you will need to set up a reverse proxy (such as nginx) to handle the certificates. If your server is not on the Internet and you do not have strangers on your network it's probably not needed unless you just want punish yourself and learn how to do it! :slight_smile:

EDIT

In your compose file use the actual latest Joplin Server version number. The tag "latest" seems to lag behind.

image: joplin/server:3.7.1