Summary
I have installed Mattermost on Ubuntu server and planing to run it in production with a small team. I have followed the official guide and use Nginx as reverse proxy. I am getting stuck in chaging the postgresql password in the env file. Whenever I do it, nginx stops working with an error (502). Hoq should I do that? Is there anything else from a security perspective I should consider?
Also, how would I simply update Mattermost to a new version with this setup now?
Hi Stefano! It’s great to hear that you’re setting up Mattermost for your team!
To change the PostgreSQL password in the .env file without disrupting Nginx, make sure to update the corresponding database credentials in your Mattermost configuration file as well.
thank you John for the reply! So to clarify should I change also the password in the service or just the env and update the compose file? or do you mean the config file of Postgres?
I was thinking of changing the password in the env file and then use the postgres command inside the container to update it but I am not sure that’s enough and it’s not 100% clear from the documentation.
I followed the official doc to install it with docker so I have nginx as well as a container
Hi Stefano, you’re on the right track! After updating the password in the .env file, you’ll also need to change the PostgreSQL password inside the container to ensure everything aligns. You can use the PostgreSQL command within the container to update it, but make sure to also update the Mattermost configuration file (config.json) to match the new credentials.
Thank you John, I tried changing it on the postgres command line and on the env file (docker compose file uses the env variables). Still not working because what I see in the config.json is the following:
UPDATE: I checked the data and the database I am really using is the one inside the ENV file. But if I change the password to it I still get a 502 bad gateway, so it means that the config file is really not a reference. What should I do?
this is the command I am using for starting and stopping everything:
sudo docker compose -f docker-compose.yml -f docker-compose.nginx.yml up -d
sudo docker compose -f docker-compose.yml -f docker-compose.without-nginx.yml down