# Self-Hosting
## Local Installation
### Step 1: Clone the Repository
Clone the project repository to your local machine:
```bash
git clone https://github.com/petercat-ai/petercat.git
Install all necessary dependencies using Yarn:
yarn run bootstrap
Refer to Supabase Self-Hosting Guide:
# Get the code
git clone --depth 1 https://github.com/supabase/supabase
# Go to the docker folder
cd supabase/docker
# Copy the fake env vars
cp .env.example .env
# Pull the latest images
docker compose pull
# Start the services (in detached mode)
docker compose up -d
Copy the client environment configuration example file:
cp client/.env.local.example client/.env
Copy the server environment configuration example file:
cp server/.env.local.example server/.env
Open the server/.env
file and update the SERVICE_ROLE_KEY
field to match the value of SERVICE_ROLE_KEY
from the docker/.env
file in Supabase.
Navigate to the migrations
folder to prepare for database setup:
cd migrations
Install the Supabase CLI following the Supabase Getting Started Guide:
brew install supabase/tap/supabase
Apply the database migrations to your remote database:
# The postgres db URL can be found in the .env file from Step 4
supabase db push --db-url "postgres://postgres.your-tenant-id:[email protected]:5432/postgres"
If successful, you should see output similar to the following:
Connecting to remote database...
Do you want to push these migrations to the remote database?
• 20240902023033_remote_schema.sql
[Y/n] Y
Applying migration 20240902023033_remote_schema.sql...
Finished supabase db push.
Start the server with the following command:
yarn run server:local
Verify the server is running by opening http://127.0.0.1:8001/api/health_checker
in your browser.
Start the client with the following command:
yarn run client
Verify the client service by opening http://127.0.0.1:3000
in your browser.