Unable to install mattermost via docker without-nginx (no ports showing)

For feature requests, please see: http://www.mattermost.org/feature-requests/.

For troubleshooting questions, please post in the following format:

I can’t see any ports open on containers.

Description: Ubuntu 22.04.1 LTS
ifb-user@mattermost:~/matterm$ docker compose version Docker Compose version v2.10.2
Mattermost version version: "2.4"

Steps to reproduce
Dear all,
I am quite lost I must say. Well, I am not a docker expert nor a proper sys admin, so…

Following Install Mattermost via Docker — Mattermost documentation, I installed the ‘without-nginx’ version.
It is successful (up to a point).

Expected behavior

Observed behavior
But am unable to get the nginx connection working.

Question 1
The containers are up and running, however the command docker ps shows this:

dd3db8105cd1 mattermost/mattermost-enterprise-edition:7.1 "/entrypoint.sh matt…" 3 hours ago Restarting (1) 38 seconds ago matterm-mattermost-1
420f12e4740e postgres:13-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 5432/tcp matterm-postgres-1

Why don’t we see any ports showing?

Question 2
Is this doc Configure NGINX as a proxy for Mattermost server — Mattermost documentation still up-to-date?

Thanks. I keep looking.

PS: I haven’t changed anything of note, simply filling out appropriate vars in .env; and I already have our own certificates.

Hi froggypaule and welcome to the Mattermost forums!

Your container is restarting and this usually indicates problems with the configuration.
Can you share the output of docker logs dd3db8105cd1 (or whatever the container ID is for the mattermost container then)?

Hello @agriesser ! many thanks for responding so rapidly.

Actually your are quite right!

but where are these files? in the container itself? –
sorry for being such a beginner

got my answer: in volumes/… etc; I’ll report as soon it is fixed

This sounds like you forgot to run the chown command as mentioned in the documentation.
Step 3 on https://mattermost.com/deploy/:

mkdir -p ./volumes/app/mattermost/{config,data,logs,plugins,client/plugins,bleve-indexes} && sudo chown -R 2000:2000 ./volumes/app/mattermost



ifb-user@mattermost:~/matterm$ ls -lrt volumes/app/mattermost/config total 0

the dir is empty???

Finally, please teach how to introduce code without using the quote? Many thanks… lines don’t get broken…

and I did the chown previously … but I’ll do it again, let’s see.

The directory is empty because the config.json file will be written at the start, based on the configuration options gathered from the .env file.

Please ty the following:

docker-compose -f docker-compose.yml -f docker-compose.without-nginx.yml down
chown -R 2000:2000 ./volumes/app/mattermost
docker-compose -f docker-compose.yml -f docker-compose.without-nginx.yml up

Leave out the -d for the docker-compose command here so we can immediately see the logs in the console.
Please post any error messages here then so we can have a look.

Did it,
Actually, this is where is goes pearshape
matterm-mattermost-1 | Error: failed to load configuration: could not create config file: open /mattermost/config/config.json: permission denied

OK, then let’s start over new, please.
Stop the containers and remove the volumes directory again and create a new hierarchy as outlined in step 3 in the documentation. Once done, start the containers again - there’s most likely an empty directory mapped somwhere which causes troubles now and since we’re at the beginning, let’s not waste time with that :slight_smile:

correct! many thanks!
(let’s cross fingers!)

redid the whole lot, exactly as in Install Mattermost via Docker — Mattermost documentation

bad news: we still have the same pb.

There is one thing I forgot to say:
mattermost is installed in a passwd-less user home.
But surely this makes no difference (sudo is done via my sudo credentials)

So I am quite stuck: what stupid thing could have happened???

Well, the link you posted talks about several different docker deployment options and also contains examples for creating a SSL certificate and using nginx, but you said you do not want to use nginx at all, so the 4-step instructions from Deploy Your Self-Hosted Mattermost Server | Mattermost should be enough to get you going.
If you want to also use nginx and SSL, we will need to prepare for a few more things, but using the 4-steps with just the DOMAIN changed in the .env file, there’s nothing that can go wrong (did that a few hundred times already).

You do not need to use sudo for the commands, in fact, it will not help you at all because when you use sudo, the current working directory will change and the container will not find your .env file or the volumes folder, so please do not use sudo with the docker-compose commands.

I understand what you say, but well.
The thing left to do for me is this time to try the with-nginx deployement. I’ll report here if I am lucky.

Many thanks for your time.

No problem, we can also try the without-nginx variant, but I’d need to see the full console log then to find out what could be the problem.

just a last question for now: this mattermost docker should run on rootless docker right?
(this is my setting)

…just asking…

Yes, you will only require root permissions when you try to bind ports < 1024, but basically it should work (if the dockerd setup is correct).

No access to volumes is solved: see config.json cannot be created: permission denied · Issue #106 · mattermost/docker · GitHub
In short: rootless docker containers map the uids within the host user namespace.