Skip to content
Manish Saraan
Go back

How to Self-Host Supabase with Coolify

How to Self-Host Supabase with Coolify

Want the power of Supabase, but on your own server, under your control, with a nice UI instead of wrestling raw Docker and docker-compose.yml files?

Set up Supabase on your own VPS using Coolify – a “self-hosted Heroku/Vercel” style platform.

By the end, you’ll have:

Why Self-Host Supabase?

You might want to self-host if:

Supabase is open source, so you’re allowed (and encouraged) to run it yourself. The “hard” part is orchestration, updates, SSL, and reverse proxy.

That’s where Coolify comes in.

Quick Primer: Supabase & Coolify

What is Supabase?

Supabase is basically a Firebase alternative built on PostgreSQL. Out of the box you get:

The official team provides Docker setups so you can self-host, but you usually have to maintain a docker-compose.yml yourself.

What is Coolify?

Coolify is a self-hosted PaaS. Think of it as:

“Heroku/Vercel, but you run it on your own VPS.”

With Coolify you get:

Put simply:

Supabase = your backend platform Coolify = your hosting control panel for that backend

Before You Start: Checklist

Here’s what you should have ready.

1. Server / Infrastructure

2. Domain & DNS

3. Basic Knowledge

You don’t need to be a DevOps guru, but:

4. Software (Coolify will help you here)

Coolify’s installer will handle:

So you don’t have to pre-install these, but it’s good to know they’re involved.


Step 1 – Set Up Your VPS and Install Coolify

1. Create the VPS

2. Point your domain to the VPS

In your DNS provider (e.g. Cloudflare):

Tip: If using Cloudflare, some people temporarily turn off the orange cloud (proxy) during setup to avoid SSL/proxy weirdness. You can turn it back on later once everything is stable.

3. SSH into the VPS

From your local machine:

ssh root@YOUR_VPS_IP

(or the non-root user with sudo rights)

4. Install Coolify

Coolify provides a single-line install script in their official docs.

The flow is:

  1. Go to the Coolify website.
  2. Copy the install command from their docs.
  3. Run it on your server as root (or via sudo).

The installer will:

5. Access the Coolify dashboard

Once installation finishes, you’ll see instructions like:

Open that in your browser and:

Nice. You now have your “self-hosted Heroku” running. Next: Supabase.


Step 2 – Create a Project in Coolify and Add Supabase

Inside Coolify:

  1. Go to the Projects tab.
  2. Click Add to create a new project.
  3. Name it something like supabase or backend.
  4. Choose Environment: production (you can add staging later if you like).

Now let’s add Supabase as a resource:

  1. Enter your new project.

  2. Click Add New Resource.

  3. Search for Supabase in the list of services/templates.

  4. Pick the Supabase template.

  5. Choose Destination / Server:

    • If you only have one server, just select it.
  6. Configure basic details:

    • Service name: supabase
    • Domain: supabase.yourdomain.com (if prompted)

Click Save (or equivalent). Coolify will create a stack for you, wired with Traefik, ready for env vars and deployment.


Step 3 – Configure Environment Variables in Coolify

Before you deploy, you need to set up the environment variables that make your Supabase instance actually usable.

In Coolify:

  1. Go to your Supabase resource.
  2. Find the Environment Variables section.
  3. Switch to any “developer view” or key/value editor there.

Let’s go through the key ones.

Database

If you don’t customize them, the template will usually use sensible defaults.

JWT & Keys

Supabase uses JWT secrets and keys for auth:

You can generate these using JWT tools or the official docs. The main idea:

URLs

You’ll likely need variables like:

The exact names can differ slightly depending on the template version, but the concept is the same: your Supabase URL(s) must match the domain you set up in Coolify.

OAuth (optional for now)

If you plan to support Google/GitHub login, you’ll use env vars like:

We’ll revisit OAuth in the advanced section – no need to wire it all up right this second.

Tip: Treat these env vars as secrets. Only store them in Coolify, a password manager, or your secret management system – never hardcode them in your codebase.


Step 4 – Log In to Supabase Studio and Test It

Open your browser and visit:

https://supabase.yourdomain.com

(or whatever domain you configured).

Coolify usually shows Service Specific Configuration for Supabase, which may include:

Use those credentials to log in.

Quick sanity check

Inside Supabase Studio:

  1. Go to Table editor.
  2. Create a new table, e.g. todos with a text column.
  3. Insert a test row.
  4. Hit the REST or SQL editor and check that you can query it.

If you want to test APIs:

You can find and copy the anon and service_role keys in:

Settings → API inside Supabase Studio.

At this point, you’ve got a working self-hosted Supabase on Coolify.


Wrap-Up: What You’ve Just Built

You now have:

From here, you can:


Already using Supabase’s hosted offering but thinking about alternatives? I wrote about why I migrated from Supabase to Vercel Blob for file storage — a different approach when self-hosting isn’t the right fit.


Share this post on:

Recent Posts