{"id":34307,"date":"2025-12-07T16:53:48","date_gmt":"2025-12-07T09:53:48","guid":{"rendered":"https:\/\/dps.media\/?p=34307"},"modified":"2025-12-07T16:53:51","modified_gmt":"2025-12-07T09:53:51","slug":"guide-to-hosting-supabase-on-fastpanel-with-docker-portainer-resolving-port-conflicts","status":"publish","type":"post","link":"https:\/\/dps.media\/en\/guide-to-hosting-supabase-on-fastpanel-with-docker-portainer-resolving-port-conflicts\/","title":{"rendered":"For example, an article on VnExpress may cost VND 30 million, but with the same budget, you could book 10 articles on other industry-specific news websites. These supporting articles play an important role in driving backlinks and building broad brand visibility when customers search for your brand name on Google."},"content":{"rendered":"<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Supabase is an excellent open-source alternative to Firebase. However, self-hosting Supabase on a VPS with a pre-installed Control Panel (like Fastpanel, CyberPanel\u2026) often encounters many difficulties, especially the issue of <strong>Reverse Proxy<\/strong> and <strong>Port Conflict<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Supabase uses port <code data-no-translation=\"\">8000<\/code> 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 <code data-no-translation=\"\">3000<\/code> and needs to be properly configured to access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, <strong>DPS Media<\/strong> will share experience deploying Supabase on Ubuntu 24.04 using Fastpanel, with custom port configuration: <strong>API runs on port 8008<\/strong> and <strong>Studio runs on port 3003<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Prepare the Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>VPS:<\/strong> Ubuntu 22.04 or 24.04 (Recommended minimum 4GB RAM).<\/li>\n\n\n\n<li><strong>Fastpanel:<\/strong> Pre-installed.<\/li>\n\n\n\n<li><strong>Docker &amp; Portainer:<\/strong> Installed (See previous guide).<\/li>\n\n\n\n<li><strong>Domain name:<\/strong> You need to prepare 2 subdomains:\n<ul class=\"wp-block-list\">\n<li><code data-no-translation=\"\">studio.domain.com<\/code>: Used for management interface.<\/li>\n\n\n\n<li><code data-no-translation=\"\">spb.domain.com<\/code>: Used for API backend.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">500,000\u20131,500,000<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Access SSH to VPS with root privileges and download Supabase's Docker deploy kit:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code data-no-translation=\"\"># Di chuy\u1ec3n \u0111\u1ebfn th\u01b0 m\u1ee5c l\u00e0m vi\u1ec7c\ncd \/opt\n\n# T\u1ea3i source code t\u1eeb Github\ngit clone --depth 1 https:\/\/github.com\/supabase\/supabase\n\n# V\u00e0o th\u01b0 m\u1ee5c ch\u1ee9a c\u1ea5u h\u00ecnh Docker\ncd supabase\/docker\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">SEO<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the most important step. We will not use the default port (8000) to avoid conflicts with Portainer or other services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open file <code data-no-translation=\"\">docker-compose.yml<\/code>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code data-no-translation=\"\">nano docker-compose.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Make 2 important changes:<\/strong><\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Open port for Studio (Interface):<\/strong> Find service <code data-no-translation=\"\">studio<\/code>, add section <code data-no-translation=\"\">ports<\/code> to map port 3003 of VPS to port 3000 of container.<\/li>\n\n\n\n<li><strong>Change port for Kong (API):<\/strong> Find service <code data-no-translation=\"\">kong<\/code>, change map port to 8008.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The modified code will look like this:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">YAML<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code data-no-translation=\"\">services:\n  studio:\n    image: supabase\/studio:2025...\n    # ... c\u00e1c config kh\u00e1c gi\u1eef nguy\u00ean\n    ports:\n      - \"3003:3000\"  # Map Host 3003 -&gt; Container 3000\n\n  kong:\n    image: kong:2.8.1\n    # ... c\u00e1c config kh\u00e1c gi\u1eef nguy\u00ean\n    ports:\n      - \"8008:8000\/tcp\" # Map Host 8008 -&gt; Container 8000 (API)\n      - \"${KONG_HTTPS_PORT}:8443\/tcp\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Push keywords to the top of search results<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Copy sample file and edit:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code data-no-translation=\"\">cp .env.example .env\nnano .env\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You need to fill in strong passwords (Database, JWT Secret) and most importantly configure the URL to match the 2 prepared subdomains.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mandatory parameters to edit:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code data-no-translation=\"\"># 1. B\u1ea3o m\u1eadt (T\u1ef1 t\u1ea1o chu\u1ed7i ng\u1eabu nhi\u00ean m\u1ea1nh)\nPOSTGRES_PASSWORD=MatKhauDbCucManh!!!\nJWT_SECRET=Chuoi_JWT_Bi_Mat_Dai_It_Nhat_32_Ky_Tu\nDASHBOARD_PASSWORD=MatKhauDangNhapWeb!!!\n\n# 2. C\u1ea5u h\u00ecnh Port API (Ph\u1ea3i kh\u1edbp v\u1edbi file yml \u1edf tr\u00ean)\nKONG_HTTP_PORT=8008\n\n# 3. C\u1ea5u h\u00ecnh Domain (Quan tr\u1ecdng)\n# SITE_URL: L\u00e0 \u0111\u1ecba ch\u1ec9 truy c\u1eadp Giao di\u1ec7n Studio\nSITE_URL=https:\/\/studio.domain.com\n\n# SUPABASE_PUBLIC_URL: L\u00e0 \u0111\u1ecba ch\u1ec9 API (Studio s\u1ebd g\u1ecdi v\u00e0o link n\u00e0y \u0111\u1ec3 l\u1ea5y data)\n# L\u01afU \u00dd: Ph\u1ea3i \u0111i\u1ec1n domain API, KH\u00d4NG \u0111i\u1ec1n domain Studio\nSUPABASE_PUBLIC_URL=https:\/\/spb.domain.com\n\n# API Auth: C\u0169ng tr\u1ecf v\u1ec1 domain API\nAPI_EXTERNAL_URL=https:\/\/spb.domain.com\n\n# Redirect URL: Th\u00eam c\u1ea3 domain studio v\u00e0o \u0111\u1ec3 login xong quay v\u1ec1 \u0111\u00fang ch\u1ed7\nADDITIONAL_REDIRECT_URLS=https:\/\/studio.domain.com,https:\/\/spb.domain.com\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Before agreeing to sign the contract, make sure you have gone through the negotiation checklist below. This is your tool for taking the initiative in every negotiation regarding<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After configuration is complete, run the following command for Docker to download and build the system:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code data-no-translation=\"\">docker compose up -d\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Note: This process may take 5-10 minutes to download about 1GB images.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Request the latest original rate card (bearing a red stamp or sent from an official email address) for comparison.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To access the web without typing <code data-no-translation=\"\">IP:3003<\/code>, we use the Proxy feature of Fastpanel.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Page 1: Management interface (Studio)<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Create new site: <strong>Reverse Proxy<\/strong>.<\/li>\n\n\n\n<li>Domain: <code data-no-translation=\"\">studio.domain.com<\/code>.<\/li>\n\n\n\n<li>Upstream: <code data-no-translation=\"\">http:\/\/127.0.0.1:3003<\/code>.<\/li>\n\n\n\n<li><strong>Extremely Important:<\/strong> Go to Settings -&gt; Static Content -&gt; <strong>TURN OFF<\/strong> line <em>\u201cUse NGINX for static files\u201d<\/em>.<\/li>\n\n\n\n<li>Install Let's Encrypt SSL.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Page 2: API Backend (Supabase)<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Create new site: <strong>Reverse Proxy<\/strong>.<\/li>\n\n\n\n<li>Domain: <code data-no-translation=\"\">spb.domain.com<\/code>.<\/li>\n\n\n\n<li>Upstream: <code data-no-translation=\"\">http:\/\/127.0.0.1:8008<\/code>.<\/li>\n\n\n\n<li>Also <strong>TURN OFF<\/strong> line <em>\u201cUse NGINX for static files\u201d<\/em>.<\/li>\n\n\n\n<li>Install Let's Encrypt SSL.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(Note: Page <code data-no-translation=\"\">spb<\/code> when accessed directly will report 404 Not Found error, this is normal because API Gateway has no interface).<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Results &amp; Login<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now you access: <strong><code data-no-translation=\"\">https:\/\/studio.domain.com<\/code><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in with account: <code data-no-translation=\"\">supabase<\/code> \/ Password you set in <code data-no-translation=\"\">.env<\/code>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Connection parameters for Dev:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Project URL:<\/strong> <code data-no-translation=\"\">https:\/\/spb.domain.com<\/code><\/li>\n\n\n\n<li><strong>Anon\/Service Key:<\/strong> Get in Dashboard (Settings -&gt; API).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Separation <strong>Studio (Port 3003)<\/strong> and <strong>API (Port 8008<\/strong> 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.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Source: dps.media<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>You want to run Supabase (Firebase Alternative) on VPS Fastpanel but encounter port 8000\/3000 conflict errors? This article provides detailed instructions on how to deploy Supabase with Docker, separating domains for API and Studio Dashboard to ensure the system runs most stably. Supabase is an excellent open-source alternative solution [\u2026]<\/p>","protected":false},"author":1,"featured_media":34308,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,1621],"tags":[],"class_list":["post-34307","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","category-fastpanel"],"acf":[],"rankmath_keywords":{"primary":"","secondary":[""]},"yoast_keywords":{"primary":"","secondary":[]},"yoast_focuskw":"","rankmath_focuskw":"","seo_keywords":{"primary":"","secondary":[""]},"_links":{"self":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/posts\/34307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/comments?post=34307"}],"version-history":[{"count":0,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/posts\/34307\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/media\/34308"}],"wp:attachment":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/media?parent=34307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/categories?post=34307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/tags?post=34307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}