Want to run Supabase (Firebase Alternative) on VPS Fastpanel but encountering port 8000/3000 conflict errors? This article provides detailed instructions on deploying Supabase with Docker, separating domains for API and Studio Dashboard for the most stable system operation.
Supabase là một giải pháp thay thế mã nguồn mở tuyệt vời cho Firebase. Tuy nhiên, việc tự host (Self-host) Supabase trên một VPS đã cài sẵn Control Panel (như Fastpanel, CyberPanel…) thường gặp nhiều khó khăn, đặc biệt là vấn đề Reverse Proxy and Port Conflict.
By default, Supabase uses port 8000 for API Gateway, this port is often conflicted by other services (like Portainer or default Nginx). Additionally, the admin Dashboard (Supabase Studio) runs on port 3000 and needs to be properly configured to access.
In this article, DPS Media will share experience deploying Supabase on Ubuntu 24.04 using Fastpanel, with custom port configuration: API runs on port 8008 and Studio runs on port 3003.
1. Prepare resources
- VPS: Ubuntu 22.04 or 24.04 (Recommended minimum 4GB RAM).
- Fastpanel: Pre-installed.
- Docker & Portainer: Installed (See previous guide).
- Domain name: You need to prepare 2 subdomains:
studio.domain.com: Used for management interface.spb.domain.com: Used for API backend.
2. Download Supabase source code
Access SSH to VPS with root privileges and download Supabase's Docker deploy kit:
Bash
# Move to working directory
cd /opt
# Download source code from Github
git clone --depth 1 https://github.com/supabase/supabase
# Enter the Docker configuration directory
cd supabase/docker
3. Configure Docker Compose (Avoid port conflicts)
This is the most important step. We will not use the default port (8000) to avoid conflicts with Portainer or other services.
Open file docker-compose.yml:
Bash
nano docker-compose.yml
Make 2 important changes:
- Open port for Studio (Interface): Find service
studio, add sectionportsto map port 3003 of VPS to port 3000 of container. - Change port for Kong (API): Find service
kong, change map port to 8008.
The modified code will look like this:
YAML
services:
studio:
image: supabase/studio:2025...
# ... các config khác giữ nguyên
ports:
- "3003:3000" # Map Host 3003 -> Container 3000
kong:
image: kong:2.8.1
# ... các config khác giữ nguyên
ports:
- "8008:8000/tcp" # Map Host 8008 -> Container 8000 (API)
- "${KONG_HTTPS_PORT}:8443/tcp"
4. Configure environment variables (.env)
Copy sample file and edit:
Bash
cp .env.example .env
nano .env
You need to fill in strong passwords (Database, JWT Secret) and most importantly configure the URL to match the 2 prepared subdomains.
Mandatory parameters to edit:
Bash
# 1. Security (Generate strong random string yourself)
POSTGRES_PASSWORD=VeryStrongDbPassword!!!
JWT_SECRET=Long_Secret_JWT_String_At_Least_32_Characters
DASHBOARD_PASSWORD=WebLoginPassword!!!
# 2. API Port Configuration (Must match the yml file above)
KONG_HTTP_PORT=8008
# 3. Domain Configuration (Important)
# SITE_URL: Is the access address for Studio interface
SITE_URL=https://studio.domain.com
# SUPABASE_PUBLIC_URL: Is the API address (Studio will call this link to get data)
# NOTE: Must fill in API domain, DO NOT fill in Studio domain
SUPABASE_PUBLIC_URL=https://spb.domain.com
# API Auth: Also points to API domain
API_EXTERNAL_URL=https://spb.domain.com
# Redirect URL: Add studio domain as well to return to the right place after login
ADDITIONAL_REDIRECT_URLS=https://studio.domain.com,https://spb.domain.com
5. Start Supabase
After configuration is complete, run the following command for Docker to download and build the system:
Bash
docker compose up -d
Note: This process may take 5-10 minutes to download about 1GB images.
6. Configure Reverse Proxy on Fastpanel
To access the web without typing IP:3003, we use the Proxy feature of Fastpanel.
Page 1: Management interface (Studio)
- Create new site: Reverse Proxy.
- Domain:
studio.domain.com. - Upstream:
http://127.0.0.1:3003. - Extremely important: Go to Settings -> Static Content -> TURN OFF line “Use NGINX for static files”.
- Cài SSL Let’s Encrypt.
Page 2: API Backend (Supabase)
- Create new site: Reverse Proxy.
- Domain:
spb.domain.com. - Upstream:
http://127.0.0.1:8008. - Also TURN OFF line “Use NGINX for static files”.
- Cài SSL Let’s Encrypt.
(Note: Page spb when accessed directly will report 404 Not Found error, this is normal because API Gateway has no interface).
7. Kết quả & Đăng nhập
Now you access: https://studio.domain.com
- Log in with account:
supabase/ Password you set in.env.
Connection parameters for Dev:
- Project URL:
https://spb.domain.com - Anon/Service Key: Get in Dashboard (Settings -> API).
Conclusion
Separation Studio (Port 3003) and API (Port 8008 helps the Supabase system run smoothly on Fastpanel without interfering with other default services. Hope this guide helps you take control of your powerful Backend infrastructure.
Source: dps.media

