Can’t connect using `psql` after following Supabase Self-Hosting Docker guide

Hey everyone! I’m trying to self-host Supabase using the official Docker guide (https://supabase.com/docs/guides/self-hosting/docker) Everything seems to be running fine (Docker containers are up), but I’m having trouble connecting to the database using psql. Here’s the command I’m using:
psql 'postgres://postgres:your-super-secret-and-long-postgres-password@localhost:5432/postgres'
psql 'postgres://postgres:your-super-secret-and-long-postgres-password@localhost:5432/postgres'
And here’s the exact error I’m getting:
psql: error: connection to server at "localhost" (::1), port 5432 failed:
FATAL: password authentication failed for user "postgres"
psql: error: connection to server at "localhost" (::1), port 5432 failed:
FATAL: password authentication failed for user "postgres"
What I’ve checked: - Docker containers are running normally (docker ps) - The password I'm using is the same as the one in the .env file (POSTGRES_PASSWORD) - Postgres is listening on port 5432 - I can exec into the Postgres container from Docker
Self-Hosting with Docker | Supabase Docs
Learn how to configure and deploy Supabase with Docker.
No description
No description
68 Replies
inder
inder2mo ago
grep for a TENANT_ID variable inside .env file and add the value to username
postgres://postgres.<TENANT_ID_VALUE_HERE>...restOfTheUrl
postgres://postgres.<TENANT_ID_VALUE_HERE>...restOfTheUrl
You haven't even mentioned the issue you're facing Also this is a user helping forum, not monitored by supabase
Owen
Owen2mo ago
Someone fu**king system not working
No description
Owen
Owen2mo ago
Live server down, but fuc**kng support not response 😑😑 The biggest mistake in life is using supabase.
inder
inder2mo ago
No one will be able to help you with this here. As I said this forum is not monitored by supabase. You'll have to contact supabase support. If you're a pro, you get priority support.
Owen
Owen2mo ago
Yes, pro but support team not response
inder
inder2mo ago
It can take some time. How did you come to conclusion that its a DDOS attack?
Owen
Owen2mo ago
The biggest mistake in life is using supabase.😑😑 now I realise that Too much REST requests at a time
inder
inder2mo ago
Have you checked logs? Are you sure it isn't your own app?
Owen
Owen2mo ago
Yes yes Main problem, the support system is very very bad…
inder
inder2mo ago
If you think that its an authenticated user making a lot of requests, you can ban that user
Owen
Owen2mo ago
Possible to change project url/Google authentication url? In suppabase
Owen
Owen2mo ago
Message me in my inbox.
inder
inder2mo ago
You can post your queries in a new post.
Owen
Owen2mo ago
Actually we need a good developer for our project So can you help me anyv
P0sseid0n
P0sseid0nOP2mo ago
Isn’t TENANT_ID just for Supavisor? I’m not using Supavisor, just exposing the Postgres container port and connecting directly with psql. So I don’t think the tenant ID should matter here, right?
P0sseid0n
P0sseid0nOP2mo ago
No description
No description
inder
inder2mo ago
Yes, you're right. I just saw your screenshots. Usually people try to connect directly that's why thats my first response Did you change the password before, run the containers and then reset to default?
P0sseid0n
P0sseid0nOP2mo ago
Nope I didn’t change anything Just followed the official install docs cloned the repo and ran Docker
inder
inder2mo ago
Let me try it Try one thing Right now you're setting port as - ${POSTGRES_PORT}:${POSTGRES_PORT} Try - ${POSTGRES_PORT}:5432
garyaustin
garyaustin2mo ago
Also make sure your password does not have any special characters in it.
P0sseid0n
P0sseid0nOP2mo ago
Same error
inder
inder2mo ago
I'm able to connect
No description
inder
inder2mo ago
No description
P0sseid0n
P0sseid0nOP2mo ago
I have no idea what i'm doing wrong it's the same as yours
inder
inder2mo ago
Take down the containers and try resetting the db. I don't think this has anything to do with this but just to make sure
docker compose down -t0
docker compose down -t0
and delete the directory volumes/db/data. Then start the containers.
P0sseid0n
P0sseid0nOP2mo ago
nothing
No description
P0sseid0n
P0sseid0nOP2mo ago
No description
inder
inder2mo ago
Do you have wsl installed? Maybe its some windows issue
P0sseid0n
P0sseid0nOP2mo ago
yes i do the docker install automatically
inder
inder2mo ago
?
P0sseid0n
P0sseid0nOP2mo ago
docker install the wsl
inder
inder2mo ago
Yes, but first take down these containers
P0sseid0n
P0sseid0nOP2mo ago
I meant that Docker installs WSL automatically during its installation. Do you think i should reinstall wsl ?
inder
inder2mo ago
Which VM did it install? It must be mentioned in docker desktop
P0sseid0n
P0sseid0nOP2mo ago
It doesn`t install a VM
No description
P0sseid0n
P0sseid0nOP2mo ago
Sorry for my bad english I'm really trying hard
inder
inder2mo ago
Try installing ubuntu. Its available in windows store
P0sseid0n
P0sseid0nOP2mo ago
And then I install Docker in it?
inder
inder2mo ago
Yes, you will be able to just run a script for that https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script They detect wsl environment in the script. Before running the script, open it and remove the sleep
inder
inder2mo ago
No description
P0sseid0n
P0sseid0nOP2mo ago
I think it might conflict with my Docker Desktop
inder
inder2mo ago
No It won't as long as you don't have containers exposed on same ports I've felt that docker actually runs faster in wsl. It is still running in virtualized environment like on windows but still faster
P0sseid0n
P0sseid0nOP2mo ago
Alright, I’ve installed Docker. Should I follow the Supabase documentation steps again now?
inder
inder2mo ago
Yes
P0sseid0n
P0sseid0nOP2mo ago
More errors
No description
inder
inder2mo ago
This with a new clone? At the top of terminal I see that you are in /mnt/c/... directory? Maybe that's what causing permission issues. This is the first time I saw this issue with supabase Try running it inside your ubuntu user home folder cd ~
P0sseid0n
P0sseid0nOP2mo ago
it worked
No description
inder
inder2mo ago
But this is via supavisor have you tried directly connecting to db?
P0sseid0n
P0sseid0nOP2mo ago
Yes it works too
No description
inder
inder2mo ago
Great
P0sseid0n
P0sseid0nOP2mo ago
The problem is the Windows
inder
inder2mo ago
Can you test one thing Take down these containers, run in windows and in the connection string use 127.0.0.1 instead of localhost
P0sseid0n
P0sseid0nOP2mo ago
nothing
No description
inder
inder2mo ago
I still believe it should've worked. Do you have some db client installed on your system like pgadmin or dbeaver? If you do, maybe try connecting with that.
P0sseid0n
P0sseid0nOP2mo ago
Yes I already tested on Beekeer and it gave the same error
P0sseid0n
P0sseid0nOP2mo ago
No description
inder
inder2mo ago
Well then no theory left to test. I'd actually suggest that you remove docker desktop and use docker in wsl and install lazydocker in wsl https://github.com/jesseduffield/lazydocker
P0sseid0n
P0sseid0nOP2mo ago
Would it be possible for me to replace the supabase/postgres image with the official postgres image? I have others project using the oficial image and works great
inder
inder2mo ago
You can but you'll have to run all the migration scripts manually. https://github.com/supabase/postgres/tree/develop/migrations Personally I don't think its worth going through that
P0sseid0n
P0sseid0nOP2mo ago
I don't want to stop using docker desktop I need to find other alternatives
inder
inder2mo ago
Was the connection not successful even with supavisor? Is your docker-desktop updated to latest version? Maybe instead of using env variables in ports, try passing hardcoded values - 5432:5432
P0sseid0n
P0sseid0nOP2mo ago
Yes. Yes. didnt worked
inder
inder2mo ago
If you have other windows machine available, try on that. I can't think of any other reason why this isn't working.
P0sseid0n
P0sseid0nOP2mo ago
I tested on another Windows machine and got the same error.
inder
inder2mo ago
I'll test it on a windows pc and let you know. you're on windows 11?
P0sseid0n
P0sseid0nOP2mo ago
yes

Did you find this page helpful?