When accessing Tersa from other devices on your network, you need to ensure Supabase is accessible.
By default, local Supabase only listens on localhost (127.0.0.1), which isn't accessible from other devices.
- Create a free account at https://supabase.com
- Create a new project
- Update your
.env.local:NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key SUPABASE_SERVICE_ROLE_KEY=your-service-role-key POSTGRES_URL=your-postgres-url
Create a .env.local that uses your machine's network IP:
# Replace with your machine's IP address
NEXT_PUBLIC_SUPABASE_URL=http://192.168.68.71:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-local-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-local-service-role-keyThen ensure Supabase is started with network binding (this may require Supabase CLI modifications).
- Install ngrok:
brew install ngrok - Start Supabase normally:
npx supabase start - Create a tunnel:
ngrok http 54321 - Use the ngrok URL in your
.env.local:NEXT_PUBLIC_SUPABASE_URL=https://your-subdomain.ngrok.io
Set up a reverse proxy (like nginx) on your machine to forward requests from your network IP to localhost:54321.
Exposing your local Supabase instance to your network can be a security risk. Only do this on trusted networks and for development purposes.
Once Supabase is accessible, you can access the app from other devices using:
http://YOUR_MACHINE_IP:3000
Make sure your Next.js dev server is also listening on all interfaces:
npm run dev -- --hostname 0.0.0.0or
pnpm dev --host