Self-Hosting Supabase on Docker Swarm #27467
Replies: 3 comments 3 replies
-
gotten it working, this needs to be on supabase's official docs!! 😄 |
Beta Was this translation helpful? Give feedback.
-
Sorry for the ignorance, I'm trying to configure it, but I'm a beginner: Can I disregard the authentication part? |
Beta Was this translation helpful? Give feedback.
-
This worked like a charm with my portainer setup, Thanks. There was one more thing I would like to add. I originally had traefik labels with a different subdomain on supabase/studio also, and had the routing commented in kong.yml, it was a bad idea. |
Beta Was this translation helpful? Give feedback.
-
Hello Supabase community! I'm excited to share my experience of successfully setting up Supabase in a self-hosted Docker Swarm environment. Here's how I did it, along with my configuration details.
Environment Variables
I used the following environment variables, which I set using a simple bash script before running
docker stack deploy
:Setup Process
I started by following the Supabase self-hosting guide to generate API keys and other sensitive information.
For generating secure passwords and keys, I used a password manager to ensure strong, unique values for each required field.
I created a simple bash script to set these environment variables before running
docker stack deploy
.I modified the original Docker Compose file to work with Docker Swarm, mainly by adjusting the networking configuration and adding deployment constraints where necessary. You can find it below, at the end of this post.
After setting up the environment variables and modifying the Docker Compose file, I deployed the stack to my Swarm cluster using
docker stack deploy
.Key Modifications
The main changes I made to the original setup were:
depends_on
syntax./mnt/data/supabase
), replace it with your own supabase directory, I copied the docker/volumes directory in it.traefik
reverse proxy to handle incoming traffic to the Supabase services.Conclusion
Self-hosting Supabase on Docker Swarm has been a great experience. It provides the flexibility and control of self-hosting while leveraging the power and scalability of Docker Swarm.
I hope this information helps others in the community who are looking to self-host Supabase in a similar environment. Feel free to ask any questions, and I'll do my best to answer based on my experience!
docker-compose.yaml
Beta Was this translation helpful? Give feedback.
All reactions