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...

Комментарии • 28

  • @myworld342
    @myworld342 5 дней назад

    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?

    • @codecope
      @codecope  5 дней назад

      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.

  • @perdirot48765
    @perdirot48765 6 дней назад

    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"
    }
    }

    • @codecope
      @codecope  6 дней назад +1

      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/

    • @perdirot48765
      @perdirot48765 6 дней назад

      @@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

  • @alcomp5437
    @alcomp5437 24 дня назад

    Hi, great video! Is using supabase on selfhosting completely free, or not?

    • @codecope
      @codecope  24 дня назад

      Yes, it's completely free. The only this you might have to pay for will be the server itself.

  • @jamiek2039
    @jamiek2039 14 дней назад

    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

    • @codecope
      @codecope  14 дней назад

      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.

    • @jamiek2039
      @jamiek2039 14 дней назад

      @@codecopethanks! Can it be done without s3, like just store files directly on the server that is hosting the supabase instance?

    • @codecope
      @codecope  14 дней назад

      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! :)

  • @EasyHomeGrowing
    @EasyHomeGrowing 20 дней назад

    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?

    • @codecope
      @codecope  18 дней назад +1

      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

  • @jeazyee1079
    @jeazyee1079 Месяц назад

    Looks good, but is the storage really working? This makes many times problem in self-hosted.

    • @codecope
      @codecope  Месяц назад

      The normal storage works using this method, but you can set up S3 as well.

  • @m7mmadomar
    @m7mmadomar 24 дня назад

    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.

    • @codecope
      @codecope  23 дня назад

      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.

  • @rr7184
    @rr7184 29 дней назад +2

    Hello thanks , vice video.
    ✘ Container supabase-analytics Error
    dependency failed to start: container supabase-analytics is unhealthy

    • @dojuw
      @dojuw 29 дней назад

      same here. chatgpt fixed it, it was an auth. issue.

    • @codecope
      @codecope  28 дней назад

      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).

    • @rr7184
      @rr7184 28 дней назад

      @@codecope working 🤗 I need to do email template working with supabase

    • @saltcod63
      @saltcod63 22 дня назад

      @@rr7184 would love if y'all could open a Github Issue on what the problem was & what fixed it!

  • @premjitofficial
    @premjitofficial 28 дней назад

    How to show the Edge functions in supabase studio ?

    • @codecope
      @codecope  28 дней назад

      You can use "supabase functions new your-function-name" and then serve them via "supabase functions serve" inside the CLI.

    • @premjitofficial
      @premjitofficial 27 дней назад

      @@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?

    • @Steve.Goldberg
      @Steve.Goldberg 24 дня назад

      ​@@premjitofficialsame with Settings tab 😢

    • @codecope
      @codecope  6 дней назад +1

      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.

    • @Monuccestduletpou
      @Monuccestduletpou 14 часов назад

      @@premjitofficialNow Edge Functions are supported in the self-hosted version, they updated it.