FATAL: password authentication failed for user "postgres", after "docker-compose up -d" on your EC2 AMI

I encountered the same error because a postgres instance already existed on the machine. My solution was just to start completely from scratch ensuring no postgres instance exists already so the passwords are not out of sync. (see – CentOS 7 enabled setup.sh) Sounds like you’re running a setup script; are you running it more than once? Try starting from a completely new machine without postgres.

1 Like

Thanks, but were you using Docker? because I am using docker so I get rid of the container many times and did the installation back and even with that I am still getting the same issue.

I was using docker – basically followed all this: CentOS 7 enabled setup.sh
It’s possible your issue’s distinct from mine though.

Hi all,
I starting back with a new computer on which nothing was installed on it.
Same issue. Here is the process I am following.

  1. I install docker and docker-compose.
  2. I am downloading the sources of Redash on Github.
  3. I am running ./setup.sh
  4. I am getting an error saying that port 80 is busy, so I go within docker-compose.yml and I am changing port from 80:80 to 90:80.
  5. I am launching back ./setup.sh and I am getting the issue FATAL: password authentication failed.

I changed the password through env but it is not changing anything. I read that it was better to change it directly into postgres but I have no idea about how to do it as I installed it through Docker.

Can someone give me a hand on it? Thank you,

setup.sh was designed to be run on a clean VM therefore it’s not idempotent and supposed to run once. If you run it multiple times, you will end up in an unknown state.

But what it does is somewhat simple:

  1. Install Docker.
  2. Create directories.
  3. Create config file.
  4. Create docker compose configuration and start services.

If you’re trying to start Redash locally, you have two simpler options:

Option 1: If you want to setup Redash for development, use the Developer Guide as reference. But the gist is that you use the docker-compose.yml file from the repo top level along with a few more steps.

Option 2 If you want to setup Redash locally but not for development, then you can use the Docker Compose file from setup and follow the following steps:

  1. Create a directory to keep the configuration.

  2. Copy setup/docker-compose.yml there and update the Docker Image reference (line 3) to use version 8. Also you can remove the nginx service.

  3. Create a env file in the same directory. It should have the following contents:

    POSTGRES_PASSWORD=your password
    REDASH_COOKIE_SECRET=some random string
    REDASH_SECRET_KEY=some random string
    REDASH_DATABASE_URL=postgresql://postgres:{the same password you used above}@postgres/postgres

    If this is local and just for testing, you can remove POSTGRES_PASSWORD and change REDASH_DATABASE_URL to be postgresql://postgres@postgres/postgres.

I hope you have more success with these steps now. :pray:


Thank you for your hard work, I tried solution 2, and I am ending up with this error:
http://localhost:90/login?next=http%3A%2F%2Flocalhost%3A90%2F (this is what is appearing in my address bar) with this error message:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I forgot a step:

You need to create the database schema, so run:

docker-compose run --rm server create_db
1 Like

thanks I am going to test that

Sorry but even by testing this, I am getting:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user “postgres”
(Background on this error at: http://sqlalche.me/e/e3q8)
though I removed all my containers and images and started back.

Are you running this from the same folder where you have your env file and docker-compose.yml file? It seems like the run command isn’t using the same configuration as your other containers.

Also, did you change the path to the env file in docker-compose.yml or left it as /opt/redash/env? If it’s the later, did you put the file there?

hold on I am sending you the screenshot right away.


The env_file directive in docker-compose.yml need to match the location of the env file. In your case it seems to be /var/www/html/redash/env.

still the same mistake.

hold on, there are two places for env_file

You might still have a problem, because once Postgres started and created its data volume, you can’t change the password. So you might need to update the env file to use a Postgres URL with no password (this is the default) or scrape everything and start over.

a new error message: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) fe_sendauth: no password supplied
(Background on this error at: http://sqlalche.me/e/e3q8)

Looks like it does expect some password. I would do:

  1. docker-compose down
  2. Delete /opt/redash/postgres-data (it might exist from the time you tried setup.sh and contain bad data).
  3. docker-compose up.

I wish it would have work but I am getting this now.