© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
raph

Supabase docker keep database on update

When I update Supabase I lose my database, I tried to presist the data by doing this in my yml file. I am doing some thing wrong? Each time I stop and start the container and new container is created and my data is lost. Please advise.

  # 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.21
    command: postgres -c config_file=/etc/postgresql/postgresql.conf
    restart: unless-stopped
    ports:
      - ${POSTGRES_PORT}:5432
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - ./volumes/db/data:/var/lib/docker/volumes/1c348aa63f846262ae48c2137bb77eb031cda8355ac18454f8b9412254d5d2ae/_data
      # - ./volumes/db/init:/docker-entrypoint-initdb.d
  # 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.21
    command: postgres -c config_file=/etc/postgresql/postgresql.conf
    restart: unless-stopped
    ports:
      - ${POSTGRES_PORT}:5432
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - ./volumes/db/data:/var/lib/docker/volumes/1c348aa63f846262ae48c2137bb77eb031cda8355ac18454f8b9412254d5d2ae/_data
      # - ./volumes/db/init:/docker-entrypoint-initdb.d


I missing something I should change?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase Database
SupabaseSSupabase / help-and-questions
4y ago
Selfhost Supabase on Microsoft Azure Docker
SupabaseSSupabase / help-and-questions
3y ago
Initializing docker database
SupabaseSSupabase / help-and-questions
4y ago
Beginner: How to Update Supabase Database from Typescript
SupabaseSSupabase / help-and-questions
5mo ago