| title | Self Hosting |
|---|---|
| description | This document explains how to host Atomic CRM and Supabase yourself. |
In order to facilitate self-hosting Atomic CRM with Supabase, we provide a few Make commands.
First, initialize the docker setup by running:
make docker-initThis command will ask you to allow writing an ./docker/.env file for Supabase. When it's done, feel free to customize this file. Refer to the Supabase documentation for details about each variable.
Once this is done, you can run the following command to start the development environment:
make docker-startTo setup the database and edge functions required by Atomic CRM migrations, run the following command, replacing the [POOLER_TENANT_ID] and [POSTGRES_PASSWORD] placeholders with the values from the Supabase ./docker/.env file:
PGSSLMODE=disable npx supabase db push --db-url "postgres://postgres.[POOLER_TENANT_ID]:[POSTGRES_PASSWORD]@[your-domain]:5432/postgres"PGSSLMODE=disable is required to access the local postgres instance.
Finally, update the frontend application .env file to target the local supabase instance:
FRONTEND_HTTP_HOST=true
FRONTEND_HTTP_PORT=3000
FRONTEND_HMR_PORT=3001
VITE_SUPABASE_URL=http://localhost:8000
VITE_SUPABASE_ANON_KEY=Put the ANON_KEY value from ./docker/.env
SUPABASE_SERVICE_ROLE_KEY=Put the SERVICE_ROLE_KEY value from ./docker/.envReplace the port of the VITE_SUPABASE_URL variable with the one you choose for SUPABASE_PUBLIC_URL in the Supabase ./docker/.env file.
If you edit any value in either the frontend .env or ./docker/.env files, you'll have to restart the docker containers.