Hostinger Supabase Tutorial 2026 - How to Self Host Supabase
📺 ดูคลิป · 👁️ 8,591 views · 📅 2026 · ⏱️ 14:12 · 🌐 Websites / WordPress / Hosting / Builders
📌 สรุป
คลิปนี้สอนวิธี self-host Supabase บน Hostinger VPS แบบ step-by-step โดยใช้ Coolify เป็น control panel สำหรับ deploy ผ่าน Docker โดยไม่ต้องเขียนโค้ด เหมาะกับคนที่ต้องการ Supabase backend เป็นของตัวเองแทน Supabase Cloud เพื่อประหยัดค่าใช้จ่ายระยะยาวหรือควบคุม data เอง จบคลิปได้ Supabase dashboard พร้อมใช้บน custom subdomain พร้อม HTTPS
🔑 ประเด็น / ขั้นตอนหลัก
- ซื้อ Hostinger VPS แนะนำแผน KVM 2 (2 vCPU, 8GB RAM, 100GB NVMe, 8TB bandwidth) เลือก billing 12 เดือนคุ้มสุด และเลือก OS With Panel → Coolify
- ตั้งค่า VPS ครั้งแรก: generate root password เก็บไว้ให้ดี, จดบันทึก VPS IP address ไว้ใช้ภายหลัง
- เข้า Coolify panel สร้าง root account → เลือก server type = This Machine → สร้าง project แรก (Docker engine ติดตั้งอัตโนมัติ)
- ใน Coolify: Add Resource → ค้นหา Supabase → กด Deploy รอสักครู่จน containers ขึ้นสถานะ Running healthy
- หลัง deploy สำเร็จ ให้เข้า Environment Variables บันทึก 3 ค่าสำคัญ: SERVICE_URL_SUPABASEKONG (Supabase URL), SERVICE_SUPABASEANON_KEY (anon key), Supabase service key
- บันทึก Supabase dashboard username/password จาก General tab แล้วเปิด dashboard ผ่าน link ใน Coolify
- Edge Functions บน self-hosted ต่างจาก Supabase Cloud ตรงที่ไม่ manage อัตโนมัติ ต้องสร้าง Docker image เพิ่มเองตาม Supabase self-hosting doc
- เชื่อมต่อ app (Lovable, Base44 ฯลฯ) ใช้ Supabase URL + anon key ที่เก็บไว้ หรือดูรายละเอียด format เพิ่มที่ Connect page ใน dashboard
- ตั้ง custom subdomain: ไปที่ Hostinger Domains → DNS → เพิ่ม A Record ชื่อ supabase ชี้ไปที่ VPS IP, TTL 60
- กลับ Coolify → เข้า Supabase Kong Settings → ลบ default domain → ใส่ https://supabase.yourdomain.cloud:8000 → Save → Restart เพื่อให้ HTTPS ทำงาน
🛠️ เครื่องมือ / บริการ / ลิงก์ที่พูดถึง
- Hostinger VPS — แผน KVM 2 ราคาถูกสุดถ้าซื้อ 12 เดือน + ได้ domain ฟรี 1 ปี (.tech หรือ .cloud) — hostinger.com (link affiliate ในคลิป)
- Coolify — open-source self-hosting control panel, deploy Supabase ผ่าน Docker ไม่ต้องเขียน config เอง — coolify.io
- Supabase — open-source Firebase alternative (DB, Auth, Storage, Edge Functions, API) — supabase.com
- Lovable — no-code app builder เชื่อมต่อ Supabase ได้โดยตรง — lovable.dev
- Base44 — no-code app builder รองรับ Supabase — base44.com
- Supabase self-hosting Edge Functions docs — supabase.com/docs (ลิงก์ในคลิปจะแนบให้)
💡 เอาไปใช้ / ข้อสังเกต
- คลิปนี้เป็น affiliate content ของ Hostinger ชัดเจน (ลิงก์ discount 10% + free domain) — Metics Media ใช้ tutorial เป็น funnel หลักดึง traffic ไป convert ผ่าน affiliate VPS
- Self-host Supabase ช่วยประหยัดได้จริงถ้าใช้งาน project หลายตัว เพราะ Supabase Cloud คิดค่าใช้จ่ายต่อ project ส่วน VPS จ่ายครั้งเดียวรันได้หลาย instance
- Coolify ลดความซับซ้อนของ Docker deployment ลงมากสำหรับคนไม่เก่ง DevOps — เป็น stack ที่ practical มากสำหรับ indie builder หรือ solopreneur
- 3 ค่าที่ต้องเก็บทันทีหลัง deploy: Supabase URL, anon key, service key — ขาดค่าไหนค่าหนึ่งเชื่อมต่อ app ไม่ได้
- Edge Functions บน self-hosted ยุ่งยากกว่า Cloud version เพราะต้อง manage Docker image เอง — ถ้าใช้ Edge Functions เยอะควรชั่งใจระหว่าง self-host กับ Cloud tier
📄 Transcript เต็ม (English, 2,646 คำ)
- Hey, I'm Caleb and in this video I'll show you how to set up Supabase on a Hostinger VPS step by step. First, we'll set up the VPS in a control panel using a beginner-friendly template. Then we'll deploy Supabase, save the keys you'll need to start connecting apps, learn about configuring Edge Functions, and finally secure your Supabase dashboard on a custom subdomain. By the end, you'll have a working Supabase setup that's ready to connect to tools like Lovable, Base44, or anything else you're building. To get started, click the link you see on screen right here or use the first link in the video description. That link will take you to the correct page for the setup and get you an extra 10% off your VPS plan. And once you go to that link, you'll be brought to this page right here. Go ahead and click on Claim deal. And that's gonna scroll you down to the plan options here. For Supabase, I'd recommend going with the KVM 2 plan. It's gonna give you two virtual CPU cores, eight gigabytes of RAM, 100 gigabytes of NVMe disc space, and eight terabytes of bandwidth. And if you need more or less resources later on, you can always downgrade or upgrade your plan if you need to. But for this video, I'll go with KVM 2. So I'll click on Choose plan. Start by choosing your billing period. By default, this is gonna be set to 24 months, however, you can switch it to 12-month and one-month plans as well. I wouldn't recommend going with the one-month plan because it ends up being way more expensive later on. To still get plenty of savings and go right in the middle, I'm gonna go with the 12-month plan. You can choose if you wanna toggle on daily auto-backups. And below this you can choose your server location. Just select whatever is closest to you. Next, select your operating system. Click on OS With Panel, then click on Coolify. Coolify is gonna be the control panel that we use to deploy Supabase, and this is gonna be built on top of Ubuntu, which is our operating system. I'm gonna confirm that we want to use this template. Then I'm gonna scroll back up to the top here. And as you can see, our coupon here is applied to give us an extra 10% off. Make sure you don't forget to use the first link in the video description to automatically apply this discount. From here, click on Continue, and then you'll have to go ahead and create a Hostinger account. Once you've gone ahead and created your Hostinger account and gone through the checkout process, I'll meet you at the next step. When you're here, go ahead and click on Get started. From here you have the option to add an SSH key or create a root password. For now, we're gonna go with this option. Click on Generate, and then you want to copy this password here and then save it somewhere safe. You'll use this password to log into your VPS, so make sure you keep it safe and don't share it with anybody else. From here, go down and click on Next. You can choose if you want to instal a free malware scanner. Whenever I'm setting up my VPS for the first time, I do like to leave this turned off. So for now, I'm just gonna click on Finish setup. And now Hostinger is gonna set up your VPS. This can take a few minutes, so I'm gonna go ahead and fast-forward to whenever it's complete. All right, now your VPS is ready to go. From here, click on Manage VPS. And this right here is gonna be your VPS dashboard. If you want to adjust your settings, your operating system and control panel, set up backups and monitoring, adjust security settings, or configure a domain, you can do all of that here. And on the screen here, you'll also find your VPS IP address, which is gonna be important 'cause we need this later. So go ahead and copy this and then save that somewhere safe as well. And then after you save that, go to the top right and click on Manage panel. And now we need to create a root user for Coolify. Coolify is the control panel that we're gonna use to deploy Supabase. So go ahead and fill out this information here. And once you're done, go down and click on Create Account. Then click on Let's go! For our server type, click on This Machine, then click Create "My First Project." With that, we've configured our server, our first project, and our Docker engine is now installed and running. Now from here, go down and click on Deploy Your First Resource. From here, click on Accept and Close. And we'll close out of this. So during the onboarding there, we actually created our first project. If you wanna navigate back to your project, go to the left and click on Projects and you'll see My first project. From here, click on Add Resource and it's gonna bring you back to this page here. Now, at the top here, let's search for Supabase and you'll see it appear down here. Go ahead and click on it. And then you're gonna see a bunch of auto-generated information appear here, like your Supabase dashboard username and password. And then below that you'll see all of the different services that are gonna be installed. For now, I'm gonna go back to the top and I'll leave this information alone for now. We can always customise things later on if we want to. For now, let's go ahead and deploy Supabase. Go to the top right here and click on Deploy. And now Coolify is gonna begin deploying Supabase. This can also take a few minutes, so I'm gonna fast forward to whenever it's complete. Okay, and after a few minutes, you should see that the containers are now started and healthy. Once this is done, go to the top right and click on this X. And right here at the top you should see that this says Running healthy. And then if I scroll down here, down the page, you'll see all the services are also listed as running and healthy. From here, let's scroll back up, and we wanna go into our environment variables. Click in here. And on this screen here, we're gonna look to copy and save three different environment variables. We're gonna do this so that way you can start connecting apps later on. The first one we're looking for here is our Supabase URL, that's listed as SERVICE_URL_SUPABASEKONG. Go ahead and click the eyeball button here. And then I'm gonna copy this and save it somewhere safe. Keep in mind that this is the default URL from Coolify. We're gonna set up a custom subdomain with a security certificate later in the video. And if you do that, you'll use your new subdomain as your main Supabase URL going forward. Either way, here in the environment variables, you can always find your current URL. Next we're gonna scroll down here. Then we're gonna find SERVICE_SUPABASEANON_KEY. Go ahead and click on the eyeball, then copy this, save it as well. And then right underneath this, you're gonna find the Supabase service key. Once again, click on that eyeball, copy this, and save it as well. Okay, and with that done, you now have copied and saved the three environment variables that you need for connecting apps. And if you ever need to update or change out your environment variables, you'll do it here in this tab. From here, click into General. Now, we need to copy down our dashboard username and password. Keep in mind that you can change these if you want to, but in my case I'll just leave them as default for now. Then I'm gonna copy over my password and save this as well. And then from here, to open your Supabase dashboard, go to the top and hover over Links and click this link here. Start by pasting in your username and then your password as well. Click Sign in. And then you'll be brought to your Supabase dashboard. On the left-hand side, you're gonna find your navigation. And the first thing I wanna talk about here are Edge Functions. With Supabase, Edge Functions are used for running small bits of server-side code on demand, like handling webhooks, calling external APIs, or doing anything you don't want to expose in your front end. And whenever you're self-hosting Supabase, setting up Edge Functions works a little bit differently. So to learn more, let's go ahead and click on Edge Functions and then scroll down the page to where it says Self-hosting Edge Functions. Since we're self-hosting Supabase, the main difference here is that Edge Functions aren't managed automatically like with Supabase Cloud. So to learn more about self-hosting Edge Functions, click on Docs and then scroll down to the Docker configuration. If you wanna set up Edge Functions using Docker, you'll copy this code here. Then I'm gonna go back to Coolify, click into Projects, I'll click into my project, then click New. And then here you can create a Docker image to set up Edge Functions within your project. And if you need more help with this, just refer to the self-hosting Supabase doc here. I'll make sure to leave a link to this in the description. Next, let's talk about connecting apps. Let's go back to our Supabase dashboard and click on Connect. And this connect page is basically your copy-and-paste hub. It's gonna show you your database connection details in different formats, plus examples for other common frameworks. You can easily switch the type, source, and method depending on what you're connecting. Now, for apps like Lovable or Base44, you'd usually just paste in your Supabase URL and the keys we saved earlier into those apps. Now, let's go ahead and close out of this here. All right, so right now my Supabase dashboard is working, but if you look up here, it shows as not secure. That's totally normal at this stage because we're just accessing it through a basic URL. So now let's go ahead and secure this on a custom subdomain so it feels like a real dashboard that you can trust and use the long term. I'll start by switching back over to Hostinger. To keep everything organised, I'm gonna connect a domain through Hostinger. And since I went with a 12-month plan, I actually get a free domain that I can use for the setup. So back here on Hostinger, I'm gonna click on Domains, then Domain portfolio. And here you'll see it says Claim your free domain. So I'll click on Claim domain, and here you can switch it from .tech to .cloud if you want to. These are the two extensions that are included with the VPS plan, but if you want to use a .com or something else, you absolutely can, you just have to buy it and connect it using the same steps I'm about to show you. So I'll switch mine to .cloud, and then I'll type in tutorialtesting and click Check availability. As you can see, this domain is available and it's free for the first year. So click on Claim domain. And then your domain is gonna be registered to you. Click on Continue. Go down and click on Skip. And as you can see here, you'll have to verify your email to fully complete your domain registration. So make sure you do that to keep your services active, just check the email that's listed here and look out for a verification email that should be arriving soon. So now that our domain is claimed, the next step is updating our DNS settings so the subdomain points to our VPS. So from here I'm gonna click on DNS and Nameservers. Then I'm gonna scroll down and we're gonna start by adding in a new A record. For the name, change this to supabase. And for Points to, we wanna change this to our VPS IP address. That's why we copied and saved it earlier. If you need to find your VPS IP address again, just click on VPS here. So I'm gonna find my VPS IP address, and then I'm gonna paste it in right here. I'm gonna change the TTL to 60 and click on Add Record. Click on Confirm. So now when I type in supabase.tutorialtesting.cloud, once I make some changes within Coolify, it's gonna point directly to my Supabase dashboard. To finalise these changes, let's go to the top here and go back to Coolify. Click into your projects. Click into your first project here. Click into your Supabase service. Then I'm gonna scroll down to my list of services here and find Supabase Kong. On the right, click into Settings, and we'll delete this default domain here. Now, I'm gonna type in my new domain like this, https://supabase.tutorialtesting.cloud. Now, keep in mind this is gonna be your custom domain here. Now, at the end of this here, go ahead and type :8000. As you can see, the service requires port 8000 to function correctly, so that's why we're adding this here at the end of our domain. Now, I'm gonna go to the top here and click on Save. And now we'll need to restart this service. So go to the top here and click on Restart. This is gonna take a few minutes to complete as well. Okay, and once this is done, go to the top right and click on this X. Now, I'm gonna open up a new tab, and in the address bar, go ahead and type in your custom subdomain. I'll go ahead and type in mine now. supabase.tutorialtesting.cloud. And here you need to sign in with your Supabase username and password again. Once you have that info filled out, click on Sign in. And now if I go to the domain here at the top and click on the Settings, you can see the connection is now secure. So now everything is configured properly for connecting our subdomain and our Supabase dashboard. All right, now that everything is set up and secure, let me show you the main places that you'll actually use inside Supabase day to day. So first is the project overview. This is basically your home base. And then on the left-hand side you'll find your navigation. Here you'll find your table editor, your SQL editor. You can find more information about your database here. Under Authentication, you can set up user accounts. Underneath that you'll find Storage. This is for file uploads where you can upload things like images, videos, and documents. And at the bottom here you'll see API Docs. I'll click into this here. This is a great place to go if you want the official guidance for connecting your app and using Supabase's API. And then down here in the bottom left, you've also got more guides and the full API reference if you want to go deeper. So at this point, you're fully set up. Supabase is deployed, it's secured, and you know where all of the main tools are. And also if you're following along and you haven't set up your VPS yet, make sure you use the first link in the video description. It's gonna take you to the correct Hostinger page for this setup and get you the lowest price available. Thank you for watching this video. I really hope it helped you out. And with that said, I'll see you in the next video.