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:
And here’s the exact error I’m getting:
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 DockerSelf-Hosting with Docker | Supabase Docs
Learn how to configure and deploy Supabase with Docker.


68 Replies
grep for a TENANT_ID variable inside .env file and add the value to username
You haven't even mentioned the issue you're facing
Also this is a user helping forum, not monitored by supabase
Someone fu**king system not working

Live server down, but fuc**kng support not response 😑😑
The biggest mistake in life is using supabase.
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.
Yes, pro but support team not response
It can take some time.
How did you come to conclusion that its a DDOS attack?
The biggest mistake in life is using supabase.😑😑 now I realise that
Too much REST requests at a time
Have you checked logs? Are you sure it isn't your own app?
Yes yes
Main problem, the support system is very very bad…
If you think that its an authenticated user making a lot of requests, you can ban that user
Possible to change project url/Google authentication url? In suppabase
Message me in my inbox.
You can post your queries in a new post.
Actually we need a good developer for our project
So can you help me anyv
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?


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?
Nope I didn’t change anything
Just followed the official install docs
cloned the repo and ran Docker
Let me try it
Try one thing
Right now you're setting port as
- ${POSTGRES_PORT}:${POSTGRES_PORT}
Try - ${POSTGRES_PORT}:5432
Also make sure your password does not have any special characters in it.
Same error
I'm able to connect


I have no idea what i'm doing wrong
it's the same as yours
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
and delete the directory
volumes/db/data
. Then start the containers.nothing


Do you have wsl installed? Maybe its some windows issue
yes i do
the docker install automatically
?
docker install the wsl
Yes, but first take down these containers
I meant that Docker installs WSL automatically during its installation.
Do you think i should reinstall wsl ?
Which VM did it install?
It must be mentioned in docker desktop
It doesn`t install a VM

Sorry for my bad english
I'm really trying hard
Try installing ubuntu. Its available in windows store
And then I install Docker in it?
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

I think it might conflict with my Docker Desktop
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
Alright, I’ve installed Docker. Should I follow the Supabase documentation steps again now?
Yes
More errors

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 ~
it worked

But this is via supavisor
have you tried directly connecting to db?
Yes it works too

Great
The problem is the Windows
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
nothing

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.
Yes I already tested on Beekeer and it gave the same error

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
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
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
I don't want to stop using docker desktop
I need to find other alternatives
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
Yes. Yes. didnt worked
If you have other windows machine available, try on that. I can't think of any other reason why this isn't working.
I tested on another Windows machine and got the same error.
I'll test it on a windows pc and let you know.
you're on windows 11?
yes