Cubed Docs
Deployment

Coolify & Dokploy

Self-hosted deploy panels. Push to deploy on your own box, with automatic HTTPS.

Coolify and Dokploy are self-hosted panels that build your project from Git, issue certificates and run it in Docker. They work almost identically here, so this page covers both.

Assumed: the panel is already installed on a server, a domain points at it, and you have seeded your Supabase project.

No database service, no volumes. Earlier versions of this guide had you provisioning Postgres inside the panel and mounting a volume for uploads. Neither is needed — Supabase holds both, so the container is disposable.

1. Add a Dockerfile

Both panels build from a Dockerfile. The theme does not ship one, so add this to the root of your project — next to package.json — and push it.

Dockerfile
package.json
next.config.ts
Dockerfile
FROM node:24-bookworm-slim

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm install

COPY . .

# Read during the build. The panel supplies the real values as build arguments.
# SUPABASE_URL matters most: the build bakes your Supabase hostname into the image
# loader and the Content-Security-Policy.
ARG PAYLOAD_SECRET=build-time-placeholder
ARG DATABASE_URI=postgresql://placeholder:placeholder@localhost:5432/postgres
ARG SUPABASE_URL

ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build

ENV NODE_ENV=production
EXPOSE 3000

CMD ["node", "node_modules/next/dist/bin/next", "start", "-p", "3000", "-H", "0.0.0.0"]

DATABASE_URI must start with postgres:// or postgresql://, even as a build placeholder. The theme rejects anything else outright, so an old placeholder like file:/tmp/build.db fails the build immediately.

There is no entrypoint script and no migration step. The container starts the site and nothing else.

2. Create the application

Add the resource

+ New → Application → Private Repository (with GitHub App), or Public Repository. Select your repository and the main branch.

Set the build pack

Build Pack: Dockerfile. Leave the Dockerfile location as /Dockerfile.

Set the port

Ports Exposes: 3000. This tells Coolify's proxy where to send traffic.

Set the domain

Under Domains, enter https://store.yourdomain.com. Coolify requests a Let's Encrypt certificate automatically once DNS points at the server.

3. Environment variables

Add these in the application's Environment Variables (Coolify) or Environment tab (Dokploy):

NameValue
TEBEX_TOKENYour Headless store token
SERVER_SECRETYour game server secret
PAYLOAD_SECRET64 random hex characters
NEXT_PUBLIC_SITE_URLhttps://store.yourdomain.com
DATABASE_URISupabase Session pooler string
SUPABASE_URLhttps://yourref.supabase.co
SUPABASE_SERVICE_ROLE_KEYYour service_role key

Three of these must also reach the build, not just the running container: PAYLOAD_SECRET, DATABASE_URI and SUPABASE_URL.

  • Coolify: tick Build Variable on each of the three.
  • Dokploy: add them under Build → Build Args as well.

Miss SUPABASE_URL at build time and the site deploys perfectly but your uploaded logo is blocked in the browser.

4. Deploy

Press Deploy. The first build takes five to ten minutes because it installs dependencies and builds the site inside the image.

Watch the logs for ✓ Ready in …, then:

Log in

https://store.yourdomain.com/admin, using your seeded credentials. Change the password immediately.

Everyday operations

On this page