Deploying
Everything deloc deploy does, and how to bend it for monorepos, CI, custom build outputs, restricted access, and link previews.
The deploy pipeline
Every deploy goes through these steps:
- Auth check — read token from config or
DELOC_TOKEN; prompt login if missing. - Detect source — use
--dirif given, otherwise look for a build output directory near the current folder. - Build if needed — if no build output exists and
--no-buildwasn't passed, run the project's build command. - Zip — archive the build output, skipping ignored patterns.
- Validate — ensure an
index.htmlis present, warn on suspicious filenames, check import maps. - Upload — POST to
/api/uploadwith the zip and metadata. - Poll — wait for the API to finish processing (usually ~1s).
- Output — print the URL and copy it to clipboard.
Framework detection
Deloc auto-detects common frameworks by scanning package.json scripts and checking for known output directories:
dist/— Vite, Svelte, Vue, library buildsbuild/— Create React App, Remixout/— Next.js static export.next/— Next.js (needs static export mode)build-statics/— custom builds
If your build output is elsewhere, pass --dir. If you already built it yourself, pass --no-build.
output: 'export' in next.config.js) to work with Deloc. Deloc serves static assets only — no server-side rendering at request time.Naming and updating
The app name comes from --name, or falls back to your package.json name, or the current folder. It's slugified into the URL path.
Re-deploying from the same directory with the same name updates in place.The URL, password, domain restrictions, OG image, and data files all survive. Pass a new --name to publish a second copy.
Visibility and access control
Public (default)
No flags = public. Anyone with the URL can view. The free-tier Deloc branding badge renders in the bottom corner.
Password-protected
Viewers see a password gate served by the Cloudflare Worker before any static asset loads. Enter the password once per browser session.
Domain-restricted (Pro Unlimited and above)
Viewers sign in with Google or Microsoft; only addresses under the allowed domains are granted access. No IT setup required on the customer side — anyone with a Google/Microsoft account at an allowed domain can view.
--password [value]Viewer password. Omit the value to auto-generate a strong one.--publicRemove any existing password.--domain-restrict <csv>Comma-separated email domains. Pro Unlimited+ only.OG images for link previews
When someone pastes your URL into Slack, Teams, or iMessage, a preview card renders. Set a custom image with the og command:
PNG only. Max 2MB. Recommended 1200×630 (the standard Open Graph aspect). The image is served with proper OG and Twitter Card meta tags at every URL in the app.
What gets uploaded
The zip includes everything under your build output except:
node_modules/.git/.DS_Storeand other OS junk- Patterns in any
.gitignoreat the root
.env, credentials.json, service-account.json, keys, certificates — and warns before upload. If one slips through, the static site is served as-is (these are readable). Always deploy a build output, not your source tree.Tier-based size limits
Deploys over your per-deploy cap fail with a 413. Deploys that would push total storage over the cap fail with "Storage limit exceeded". Bandwidth overruns don't kill the app on paid tiers — they show a friendly upgrade page. On free tier, the Deloc badge upgrades to a prominent banner.
Deploying from CI
GitHub Actions example:
Create the token with deloc tokens create "GitHub Actions" on your machine, then store it in the repo's DELOC_TOKEN secret. See Account & tokens.