Replies: 46 comments 31 replies
-
I'm the op of that issue on Reddit. Still no fix. It's not really an issue with the dashboard, it's an issue with the Database not connecting. None of the CLI will work either, because things like Auth are still stored in the Database which won't connect. I followed the same guides as the first time I successfully self-hosted supabase so I'm sure it's an issue with the update. As you've seen, I posted an issue on GitHub and Reddit over 10 days ago but got no support or help. I guess the expectation with self-hosting is that you are a developer who can fix these detrimental errors yourself instead of the Supabase team. This also came at the same time as the package updates (Flutter and JS), which were initially unannounced and made a lot of unexplained changes, so that might be a factor. |
Beta Was this translation helpful? Give feedback.
-
Understood, thank you very much for the explanation. |
Beta Was this translation helpful? Give feedback.
-
Hey all, I'm not entirely clear about this one yet - can you share more? It looks like when you are unable to use the official docker setup, using these steps here?
Now visit http://localhost:3000/ to start using Supabase Studio. Can you share some screenshots or errors that you're seeing? It sounds like "Connecting to Default Project" is displayed somewhere (maybe in the studio?) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Can you please share your docker version @NorkzYT ? (run |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I have
I got docker to work by deleting my original supabase directory and followed the official steps again (same as what @kiwicopple said to do) but got the same |
Beta Was this translation helpful? Give feedback.
-
Strange, I just did the steps again and it seems to be working
(On Macos) Are all the containers running for you? If not, can you please show the logs of any which are not running? |
Beta Was this translation helpful? Give feedback.
-
There's an issue with the
What it is on the master channel:
|
Beta Was this translation helpful? Give feedback.
-
I ran the same instructions from the repository Look at my example:
Remember that in |
Beta Was this translation helpful? Give feedback.
-
@NorkzYT This is what happens when I copy and paste the same basic commands:
It was fixed by adding the dashes. Still, though, the database won't connect. Was that fixed for you by following the |
Beta Was this translation helpful? Give feedback.
-
What docker compose version are you running? Run the following to check.
The database connected perfectly, and I had no issues in the logs of any container that was created with the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
You have an old Run the following to install the latest version.
|
Beta Was this translation helpful? Give feedback.
-
hey @NorkzYT - so is this one fixed for you now or still broken? I can't tell from this message: #10074 (comment) I think we are getting multiple conversations going on in this issue again and I'd love to focus specifically on the @NorkzYT 's issue first |
Beta Was this translation helpful? Give feedback.
-
I do agree.
I already know this, that is why I said "which is correct by Kong". |
Beta Was this translation helpful? Give feedback.
-
I also couldn't connect to the default project via the studio, but a change in the reverse proxy settings fixed it for me. I followed a tutorial before where not all service routes (rest, auth, realtime, storage) were considered in the reverse proxy config, and when trying to connect to the default project, it ended up starting requests with an 404 error as result. I got the idea from the caddy config from: https://www.safyah.com/blog/self-hosting-supabase-on-ubuntu-and-digital-ocean https://yourdomain.com {
reverse_proxy /rest/v1/* localhost:8000
reverse_proxy /auth/v1/* localhost:8000
reverse_proxy /realtime/v1/* localhost:8000
reverse_proxy /storage/v1/* localhost:8000
reverse_proxy * localhost:3000
basicauth / {
yourusername $yourhashedpassword
}
} The port :8000 from this example needs to be changed to the .env KONG_HTTP_PORT if different. API_EXTERNAL_URL=https://yourdomain.com
SUPABASE_PUBLIC_URL=https://yourdomain.com (this variable was probably replaced with PUBLIC_REST_URL and doesn't require /rest/v1/ at the end) |
Beta Was this translation helpful? Give feedback.
-
https://yourdomain.com { this doesn't work as a user can add a domain.com/'something' and get access |
Beta Was this translation helpful? Give feedback.
-
} |
Beta Was this translation helpful? Give feedback.
-
It didn’t work for me. If I visit the domain after doing this I just get a connection timeout. |
Beta Was this translation helpful? Give feedback.
-
yes it won't work user still can bypass |
Beta Was this translation helpful? Give feedback.
-
Issues with Self-hosted have been resolved, the initial setup using the guides works out of the box. Would you mind if we move this BYO security talk to a GH discussion? We could work on a community guide if these issues can be resolved on a discussion. |
Beta Was this translation helpful? Give feedback.
-
Same issue here, solved. In my case, the source of issue stands between the seat and the computer. I thought I followed the instructions of API keys generation well, but in fact, I didn't. Forgetting to also add the newly created keys in volumes/api/kong.yml (not just in .env) led to 401 Unauthorized when studio tries to access the API browser-side, and stuck on Connecting to default project. Hope this helps someone stumbling here! |
Beta Was this translation helpful? Give feedback.
-
Self Hosted Resolution with TraefikSupabase commit version: 00ac93d
Change the # Usage
# Start: docker compose up
# With helpers: docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up
# Stop: docker compose down
# Destroy: docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml down -v --remove-orphans
version: "3.9"
services:
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
studio:
container_name: supabase-studio
image: supabase/studio:20221214-4eecc99
restart: unless-stopped
# ports:
# - ${STUDIO_PORT}:3000/tcp
environment:
STUDIO_PG_META_URL: http://meta:8080
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DEFAULT_ORGANIZATION: ${STUDIO_DEFAULT_ORGANIZATION}
DEFAULT_PROJECT: ${STUDIO_DEFAULT_PROJECT}
SUPABASE_URL: http://kong:8000
SUPABASE_PUBLIC_URL: https://supabase.kong.domain.com
# Kept for backwards compatibility with studio:0.22.08
SUPABASE_REST_URL: ${API_EXTERNAL_URL}/rest/v1/
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
labels:
- traefik.enable=true
- traefik.docker.network=proxy
# Router
- traefik.http.routers.supabase-studio.rule=Host(`supabase.studio.domain.com`)
- traefik.http.routers.supabase-studio.entrypoints=websecure
# Services
- traefik.http.routers.supabase-studio.service=supabase-studio
- traefik.http.services.supabase-studio.loadbalancer.server.port=3000
# Middleware
- traefik.http.middlewares.upgrade-insecure-requests.headers.contentSecurityPolicy=upgrade-insecure-requests
networks:
- proxy
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
kong:
container_name: supabase-kong
image: kong:2.8.1
restart: unless-stopped
# ports:
# - ${KONG_HTTP_PORT}:8000/tcp
# - ${KONG_HTTPS_PORT}:8443/tcp
environment:
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /var/lib/kong/kong.yml
# https://github.com/supabase/cli/issues/14
KONG_DNS_ORDER: LAST,A,CNAME
KONG_PLUGINS: request-transformer,cors,key-auth,acl
KONG_NGINX_PROXY_PROXY_BUFFER_SIZE: 160k
KONG_NGINX_PROXY_PROXY_BUFFERS: 64 160k
volumes:
- ./volumes/api:/var/lib/kong:ro
labels:
- traefik.enable=true
- traefik.docker.network=proxy
# Router
- traefik.http.routers.supabase-kong.rule=Host(`supabase.kong.domain.com`)
- traefik.http.routers.supabase-kong.entrypoints=websecure
# Services
- traefik.http.routers.supabase-kong.service=supabase-kong
- traefik.http.services.supabase-kong.loadbalancer.server.port=8000
networks:
- proxy
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
auth:
container_name: supabase-auth
image: supabase/gotrue:v2.40.1
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: ${API_EXTERNAL_URL}
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
GOTRUE_SITE_URL: ${SITE_URL}
GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS}
GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP}
GOTRUE_JWT_ADMIN_ROLES: service_role
GOTRUE_JWT_AUD: authenticated
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_JWT_EXP: ${JWT_EXPIRY}
GOTRUE_JWT_SECRET: ${JWT_SECRET}
GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP}
GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM}
# GOTRUE_MAILER_SECURE_EMAIL_CHANGE_ENABLED: true
# GOTRUE_SMTP_MAX_FREQUENCY: 1s
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL}
GOTRUE_SMTP_HOST: ${SMTP_HOST}
GOTRUE_SMTP_PORT: ${SMTP_PORT}
GOTRUE_SMTP_USER: ${SMTP_USER}
GOTRUE_SMTP_PASS: ${SMTP_PASS}
GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME}
GOTRUE_MAILER_URLPATHS_INVITE: ${MAILER_URLPATHS_INVITE}
GOTRUE_MAILER_URLPATHS_CONFIRMATION: ${MAILER_URLPATHS_CONFIRMATION}
GOTRUE_MAILER_URLPATHS_RECOVERY: ${MAILER_URLPATHS_RECOVERY}
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: ${MAILER_URLPATHS_EMAIL_CHANGE}
GOTRUE_EXTERNAL_PHONE_ENABLED: ${ENABLE_PHONE_SIGNUP}
GOTRUE_SMS_AUTOCONFIRM: ${ENABLE_PHONE_AUTOCONFIRM}
MFA_ENABLED: ${MFA_ENABLED}
networks:
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
rest:
container_name: supabase-rest
image: postgrest/postgrest:v9.0.1.20220717
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
environment:
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS}
PGRST_DB_ANON_ROLE: anon
PGRST_JWT_SECRET: ${JWT_SECRET}
PGRST_DB_USE_LEGACY_GUCS: "false"
networks:
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
realtime:
container_name: realtime-dev.supabase-realtime
image: supabase/realtime:v2.1.0
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
environment:
PORT: 4000
DB_HOST: ${POSTGRES_HOST}
DB_PORT: ${POSTGRES_PORT}
DB_USER: supabase_admin
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_NAME: ${POSTGRES_DB}
DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
DB_ENC_KEY: supabaserealtime
API_JWT_SECRET: ${JWT_SECRET}
FLY_ALLOC_ID: fly123
FLY_APP_NAME: realtime
SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq
ERL_AFLAGS: -proto_dist inet_tcp
ENABLE_TAILSCALE: "false"
DNS_NODES: "''"
command: >
sh -c "/app/bin/migrate && /app/bin/realtime eval 'Realtime.Release.seeds(Realtime.Repo)' && /app/bin/server"
networks:
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
storage:
container_name: supabase-storage
image: supabase/storage-api:v0.26.1
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
rest:
condition: service_started
restart: unless-stopped
environment:
ANON_KEY: ${ANON_KEY}
SERVICE_KEY: ${SERVICE_ROLE_KEY}
POSTGREST_URL: http://rest:3000
PGRST_JWT_SECRET: ${JWT_SECRET}
DATABASE_URL: postgres://supabase_storage_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
FILE_SIZE_LIMIT: 52428800
STORAGE_BACKEND: file
FILE_STORAGE_BACKEND_PATH: /var/lib/storage
TENANT_ID: stub
# TODO: https://github.com/supabase/storage-api/issues/55
REGION: stub
GLOBAL_S3_BUCKET: stub
ENABLE_IMAGE_TRANSFORMATION: "true"
IMGPROXY_URL: http://imgproxy:5001
volumes:
- ./volumes/storage:/var/lib/storage
networks:
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
imgproxy:
container_name: supabase-imgproxy
image: darthsim/imgproxy:v3.11
environment:
IMGPROXY_BIND: ":5001"
IMGPROXY_LOCAL_FILESYSTEM_ROOT: /
IMGPROXY_USE_ETAG: "true"
volumes:
- ./volumes/storage:/var/lib/storage
networks:
- supabase
meta:
container_name: supabase-meta
image: supabase/postgres-meta:v0.52.1
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
environment:
PG_META_PORT: 8080
PG_META_DB_HOST: ${POSTGRES_HOST}
PG_META_DB_PORT: ${POSTGRES_PORT}
PG_META_DB_NAME: ${POSTGRES_DB}
PG_META_DB_USER: supabase_admin
PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
# Comment out everything below this point if you are using an external Postgres database
db:
container_name: supabase-db
image: supabase/postgres:14.1.0.89
healthcheck:
test: pg_isready -U postgres -h localhost
interval: 5s
timeout: 5s
retries: 10
command:
- postgres
- -c
- config_file=/etc/postgresql/postgresql.conf
- -c
- log_min_messages=fatal # prevents Realtime polling queries from appearing in logs
restart: unless-stopped
# ports:
# # Pass down internal port because it's set dynamically by other services
# - ${POSTGRES_PORT}:${POSTGRES_PORT}
environment:
POSTGRES_HOST: /var/run/postgresql
PGPORT: ${POSTGRES_PORT}
POSTGRES_PORT: ${POSTGRES_PORT}
PGPASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATABASE: ${POSTGRES_DB}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ./volumes/db/realtime.sql:/docker-entrypoint-initdb.d/realtime.sql
- ./volumes/db/roles.sql:/docker-entrypoint-initdb.d/roles.sql
- ./volumes/db/data:/var/lib/postgresql/data
networks:
- supabase
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #
networks:
proxy:
external: true
supabase:
name: "supabase" Tested, achieved, and made by: @jameswong3388 |
Beta Was this translation helpful? Give feedback.
-
Hi @NorkzYT Richard, Thanks so much for sharing your Self Hosted Resolution with Traefik, mate :) |
Beta Was this translation helpful? Give feedback.
-
THANK YOU! Thank you @NorkzYT for your work! You saved my life! Couldn’t we add this config to that one supabase-traefik repository (linked on supabase docs page)? It could help many others <3. Unfortunately the linked repo wasn’t updated for more than 3 years and looks kinda outdated … → https://github.com/supabase-community/supabase-traefik Have a good night! |
Beta Was this translation helpful? Give feedback.
-
GitHub PR has been made. If you can, please do test and advise if there are any issues. |
Beta Was this translation helpful? Give feedback.
-
Since this discussion has been resolved and the supabase-traefik repository is up-to-date with the solution, this discussion shall now be closed. Good day to all. |
Beta Was this translation helpful? Give feedback.
-
This needs an overhaul. A step by step guide on how to achieve Traefik with Supabase. Kindly someone help. |
Beta Was this translation helpful? Give feedback.
-
Please review https://github.com/supabase-community/supabase-traefik. |
Beta Was this translation helpful? Give feedback.
-
Old Solution:
#11228 (comment)
Latest Solution:
https://github.com/supabase-community/supabase-traefik
Old Issue:
I tried both the following repositories and none of them worked.
https://github.com/supabase-community/supabase-traefik
https://github.com/supabase/supabase/tree/master/docker
First off, the unofficial Traefik setup that is supported by the community is outdated.
The main self-hosting guide containers all work, although the Dashboard gets stuck, and I need to get this running as soon as possible.
I even found the following issue about it:
#8721
Does this mean that self-hosting is currently not possible with the bug introduced in the above issue?
I have made a
help
post about this in theSupabase Official
discord, and so far no one has responded.In the
r/Supabase
Reddit, there is a similar post.https://www.reddit.com/r/Supabase/comments/ycwude/comment/iuwa3az/?utm_source=share&utm_medium=web2x&context=3
I tried changing the following
.env
variables but no luck.Sadly I have been working on this for over 12 hours, and this is my very first experience with Supabase, a very horrible one at that.
Originally posted by @NorkzYT in #4934 (comment)
Beta Was this translation helpful? Give feedback.
All reactions