- Home
- Skills
- DevOps & Cloud
- One-Box Server: Several Apps + Self-Hosted Supabase on 1 VPS
Works with the AI Agents you already use
One-Box Server: Several Apps + Self-Hosted Supabase on 1 VPS
When every small app needs its own hosting project and its own database project, the bills grow with the number of apps, not the traffic.
Free
One-Box Server: Several Apps + Self-Hosted Supabase on 1 VPS
Example session with this skill installed
앱 세 개를 서버 한 대로 옮겨줘. 지금은 호스팅 프로젝트 셋, DB 프로젝트 셋이야. (Move my three apps onto one server; today each has its own hosting and DB project.)
- Read your context and instructions
- Compiled the one-box server
Summary
First turn is a plan only. Nothing has been run on a server yet. It checks fit, fixes the values, and lays out the order; every step after this waits for your yes.
Fit check
Three low-traffic Next.js apps, each with Postgres + storage, no Realtime or Edge Functions, and you can answer alert mails -> fits. If one app later needs zero downtime or a second region, move that one back out.
Values to confirm (examples, replace with yours)
| App | Host | Port | DB tunnel |
|---|---|---|---|
| app1 | app1.example.com | 3010 | 54321 |
| app2 | app2.example.com | 3020 | 54322 |
| app3 | app3.example.com | 3030 | 54323 |
Also: backup bucket, alert address, ssh alias (myserver), server size (4 GB RAM recommended; building Next on the server peaked around 1.5-2.5 GB).
Order (one step at a time, each confirmed)
- Server prep:
prep.sh, reboot once. - Per app: clone ->
bootstrap-keys.sh(before the first db start) -> push secrets withenv-push.sh->dc <app> up -d --wait db->bootstrap-db.sh-> storage -> migrations with--dry-runshown first -> rest. - Edge: switch DNS host by host, staging CA for the first run, then
caddy-apply.sh. - Deploy each app with
deploy.sh; check the public URL returns 200. - Alerts and backups:
check.sh --testshould mail you; next morning confirm "backup ok", then runrestore-drill.shonce.
Traps I will avoid (from gotchas.md)
- Cron lines written in host time, because Ubuntu cron ignores
CRON_TZ. $doubled when merging env files, so values likepbkdf2$...are not cut by compose.notify pgrst, 'reload schema'after each migration, or new tables 404 until a restart.- Never re-create
.env.generated: a new JWT secret logs everyone out and breaks the anon key baked into builds.
Shall I start with step 1 on myserver?
Connects securely to your tools. The creator never sees your data.
About this skill
When every small app needs its own hosting project and its own database project, the bills grow with the number of apps, not the traffic. This skill is the template of a real setup that runs several apps on one VPS, generalised (app1, example.com) and with the mistakes it made written down.
Fit check first
It starts by asking what you run today, how many apps and roughly how many visits, then answers in one line whether this fits. It does not fit if you need zero downtime or multiple regions, nobody can answer alert mails, or you rely on Realtime, Edge Functions or a hosted dashboard.
What you get (templates/)
bin/dc—dc <app> <compose args>with fixed project name, folder, env file and compose file.edge/— one Caddy for TLS and routing of every host. Applied withcaddy reload(a bad file is rejected and the old config keeps serving).ops/— server prep (swap, Docker, firewall, unattended upgrades, timezone), key generation (Postgres password, JWT secret, anon/service JWTs, cron secret), DB bootstrap, env merge, SQL migrations recorded like the Supabase CLI (file and record in one transaction), host-side cron caller, alert mails (one per key per 6 hours, with the count held in between), hourly health check (disk, memory, OOM, containers, certificates, last backup), nightly backup to any S3-compatible bucket, monthly restore drill into a throwaway container, rollback of the app container only.app/— per-app compose, Dockerfile (Next.js standalone),deploy.sh(clean main, gate, push, build on the server, wait for healthy, fall back to the previous image if it does not come up; stops and lists pending migrations instead of applying them),env-push.sh(only allowed names, refuses if a required one is missing).gotchas.md— 44 traps hit in practice, one line each with the reason. Examples: Ubuntu cron ignoresCRON_TZ; compose--env-filecuts values at$;grep -qafter a pipe withpipefailturns a match into a failure; PostgREST needsnotify pgrst, 'reload schema'after a migration; restarting the Caddy container with a bad file takes every host down.
Rules it follows on a server
- Dump before any production DB write, say what will change, wait for an explicit yes.
- Never print secrets (
cat .env,env,docker inspect,compose configare off limits; it checks names only). - Touch one app at a time. No edge restarts, no
prune -a, no volume deletes. - Fix the cause when a check fails; never silence the alert.
Instructions are in Korean; scripts and comments are in English.
One server means one point of failure: no zero-downtime deploys, no multi-region. Covers Postgres, PostgREST and storage-api (auth optional), not Supabase Realtime, Edge Functions or Studio. Templates assume Next.js standalone. Linux-only scripts (check, backup, prep, caddy-apply, deploy) were syntax-checked, not run end to end on a fresh box; image tags should be checked before installing. Instructions are in Korean.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed today
- Free with an Agensi account
Requires
Permissions
Allowed Hosts