Self-Host Supabase using Docker in 24 Minutes (very easy)
HTML-код
- Опубликовано: 8 фев 2025
- Learn how to self-host Supabase, the open-source Firebase alternative, using Docker in just 24 minutes! This step-by-step guide makes it simple to set up your own Supabase server, perfect for building scalable applications on your own infrastructure. Follow along to get Supabase running quickly with Docker, even if you're a beginner.
Full guide: codecope.org/h...
Thanks another great video, very clear! Is there a way to add it to a server on Hertzner where N8N is already installed to reduce costs? In general is there a way to have one server on Hertzner withlots of different apps?
Thanks for your comment! :)
Yes, you can use Docker to containerize your server along with a tool like Nginx Proxy Manager for setting up reverse proxies to use multiple services on the same server.
Muchas gracias , Sabes por que no puedo crear usarios, he creado mi propio JWT pero no funciona ? create user error: {
"error": {
"message": "invalid JWT: unable to parse or verify signature, token signature is invalid: signature is invalid"
}
}
Antes de comprobar cualquier otra cosa, asegúrate de que la estructura de tu JWT sea válida. Un JWT válido consta de tres partes: header.payload.signature. Si está mal formado, Supabase lo rechazará. Puedes comprobar si es válido decodificándolo. Si no tienes un decodificador de JWT, puedes usar el que se encuentra en nuestro sitio web: codecope.org/tools/jwt-decode-encode/
@@codecope lo que no me funciona es habilitar el inicio de session de supabase, creo q es un error común , lo solucione con Kong pero me gustaria tener el Login de supabase, Saludos
Hi, great video! Is using supabase on selfhosting completely free, or not?
Yes, it's completely free. The only this you might have to pay for will be the server itself.
Normal storage does not seem to be working using this method… any ideas? It lets me create a bucket, but when I upload a file it just says file upload failed! Help! Great video
For S3 storage you would need to add a service like minIO to your docker-compose.yml file and set up a proxy for minIO inside the Nginx Proxy Manager.
@@codecopethanks! Can it be done without s3, like just store files directly on the server that is hosting the supabase instance?
Sure, you can store files directly on the server hosting your Supabase instance without using S3 (and minIO).
1. Modify your docker-compose.yml file to include a volume for file storage, like:
volumes:
- ./storage:/data/storage
2. Set up a custom API endpoint to handle file uploads. For example, using Node.js with Express, you could write a simple upload handler that saves files to the local directory (storage/).
3. Update your Nginx Proxy Manager (or Nginx config) to serve the local directory. Add something like this:
location /storage/ {
root /data;
autoindex on;
}
Make sure to secure the setup and limit access to authenticated users via Supabase’s auth or other methods.
Hope it helps! :)
Thanks for the tutorial. i followed all part. i can not create any bucket in minio. it fails. I don't know what to do. do u have update?
Make sure you set up minIO in the Nginx Proxy Manager as well as adding it corretly to the docker-compose.yml file.
It should looking similar to this:
version: '3.8'
services:
minio:
image: quay.io/minio/minio
container_name: minio
volumes:
- ./minio-data:/data
environment:
MINIO_ROOT_USER: your_root_user
MINIO_ROOT_PASSWORD: your_root_password
MINIO_SERVER_URL: storage.your-domain.com
command: server /data --console-address ":9090"
nginx:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./nginx-data:/data
- ./nginx-letsencrypt:/etc/letsencrypt
Looks good, but is the storage really working? This makes many times problem in self-hosted.
The normal storage works using this method, but you can set up S3 as well.
Alright, thank you. However, I have a server with a control panel, and I encountered an issue with linking the domain to the Supabase container. It is fully functional, but the domain and the HTTPS certificate are not being linked.
Which control panel do you use?
If you are using a reverse proxy like Nginx together with your control panel:
1. Configure the proxy to handle HTTPS for the domain.
2. Redirect HTTP traffic to HTTPS.
3. Ensure that the proxy forwards requests to the Supabase container.
Hello thanks , vice video.
✘ Container supabase-analytics Error
dependency failed to start: container supabase-analytics is unhealthy
same here. chatgpt fixed it, it was an auth. issue.
Please check that all your authentication-related environment variables are correctly set in your docker-compose.yml or .env file (Database credentials, API keys or tokens).
@@codecope working 🤗 I need to do email template working with supabase
@@rr7184 would love if y'all could open a Github Issue on what the problem was & what fixed it!
How to show the Edge functions in supabase studio ?
You can use "supabase functions new your-function-name" and then serve them via "supabase functions serve" inside the CLI.
@@codecope In the self-hosted version of Supabase, I noticed that the 'Edge Functions' tab, available in the cloud-hosted version for displaying logs, invocations, is missing. Is it possible to enable this tab in the self-hosted setup? If not, what are the alternatives for accessing logs, and other related information for edge functions in a self-hosted environment?
@@premjitofficialsame with Settings tab 😢
If it's not under settings and because in the self-hosted version of Supabase, the Edge Functions tab is not available since the cloud-hosted version uses Deno Deploy, there are some alternatives for Logging Edge Functions:
1. Supabase CLI Logging
Run:
supabase functions serve
This provides live logs in your terminal.
2. Custom Logging in Edge Functions
Add logging inside your function:
export default async (req: Request) => {
console.log("Incoming request:", req);
try {
const data = await req.json();
console.log("Request data:", data);
return new Response(JSON.stringify({ message: "Success" }), { status: 200 });
} catch (error) {
console.error("Error:", error);
return new Response(JSON.stringify({ error: "Internal Server Error" }), { status: 500 });
}
};
Redirect logs to a file:
supabase functions serve >> logs.txt 2>&1
3. Use an External Logging Service
Send logs to Logflare, Loki (Grafana), Elastic Stack, or a PostgreSQL table.
4. Dockerized Setup with Log Aggregation
If running Supabase in Docker, consider Promtail + Loki + Grafana for structured logging.
5. NGINX or Reverse Proxy Logs
If functions run behind NGINX or Traefik, enable logging in the proxy settings.
Hope these workarounds help.
@@premjitofficialNow Edge Functions are supported in the self-hosted version, they updated it.