Deploy on Cloudflare
NulSEO runs on Cloudflare Workers in your own Cloudflare account. One command creates everything it needs: the Workers, a D1 database, KV namespaces and an R2 bucket.
This page is for the operator, the person who deploys and looks after the server.
Before you start#
You need:
- Node 22.6 or newer and pnpm (
corepack enablesets pnpm up). - A Cloudflare account on the Workers Paid plan. Site audits, AI visibility setup and JavaScript rendering make more outgoing requests than Cloudflare's free tier allows, and stop part-way without it.
- R2 turned on. Open R2 in the Cloudflare dashboard once. Cloudflare asks for a payment method, even inside the free R2 allowance.
- A workers.dev subdomain. Open Workers & Pages in the dashboard once to create it. It becomes part of your NulSEO address unless you use your own domain.
- A DataForSEO account. See DataForSEO key.
Optional, for extra features:
- An OpenRouter key for the Assistant and AI research. See OpenRouter key.
- A Google Cloud OAuth client for Search Console and Analytics. See Google sign-in.
- A Google Maps key for Local SEO maps. See Google Maps.
1. Get the code#
Clone your NulSEO repository and install its dependencies:
git clone <your NulSEO repository URL> nulseo
cd nulseo
corepack enable
pnpm install2. Log in to Cloudflare#
Run these once per machine:
pnpm alchemy login deploy/alchemy/alchemy.run.ts
pnpm alchemy cloudflare bootstrapThe default login scopes are enough. The bootstrap step installs a small state-store Worker in your account that keeps track of what the deploy created.
3. Create .env.selfhost#
Copy the template:
cp deploy/.env.selfhost.example .env.selfhostSet DATAFORSEO_API_KEY. Leave AUTH_MODE=password, which gives you email-and-password accounts. Everything else is optional:
| Variable | What it does |
|---|---|
DATAFORSEO_API_KEY | Required. Keyword, ranking, backlink, local and AI answer data. |
OPENROUTER_API_KEY | The Assistant (Vespa), AI research and prompt suggestions. |
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET | Search Console and Analytics connections. |
GOOGLE_MAPS_API_KEY | Live maps in Local SEO and its reports. |
CUSTOM_DOMAIN | Serve NulSEO on your own hostname, such as seo.example.com. See Use your own domain. |
NULSEO_OPERATOR_SECRET | Turns on the admin command line (see below). At least 32 random characters. |
CRAWLER_ACCESS_SECRET | Lets site audits store Shopify crawler signatures. At least 32 random characters. Do not change it once set. |
RESEND_API_KEY, EMAIL_FROM | Send email through Resend. See Email (optional). |
Generate random secrets with openssl rand -hex 32.
4. Deploy#
pnpm deploy:selfhost --yesThis creates the database, KV namespaces and R2 bucket, applies database migrations, deploys the Workers and generates the session secret. The secret is kept in your Cloudflare account, so later deploys keep everyone signed in. --yes lets the deploy run without stopping to ask questions.
The deploy prints your NulSEO address at the end.
5. Create the first account#
Open the printed address straight away and create the first account. It becomes the Owner.
Registration closes as soon as the first account exists. From then on, the sign-up page is shut and nobody can create an account without an invitation. Until that first account exists, anyone who finds the address could claim it, so do this step immediately.
If you prefer, create the first account from your terminal instead, before anyone opens the address (see Admin command line).
Invite people#
NulSEO is invite-only. An Owner or Admin opens Settings → Organization and invites someone by email. NulSEO copies an invitation link for you to send yourself and, if you set up email, also emails it. The invited person opens the link, sets a password and joins your workspace with the role you chose. See Team and roles.
People without an invitation can ask for one on the request-access page at https://nulseo.com/request-access. Their requests wait under Settings → Access requests for an Owner or Admin to approve or decline.
Email (optional)#
NulSEO works without email: every invitation is a link you copy and pass on, and passwords are reset from the admin command line. To have NulSEO send email itself, use Resend:
- Create a Resend account and verify the domain you will send from. Resend refuses mail from a domain that is not verified.
- Create an API key in Resend.
- Add these to
.env.selfhostand deploy again:
RESEND_API_KEY=re_...
EMAIL_FROM="NulSEO <access@send.example.com>"
# Optional: where notices about new access requests go.
# Unset, they go to the Owner of the first organisation.
ACCESS_REQUEST_NOTIFY_EMAIL=you@example.comWith both RESEND_API_KEY and EMAIL_FROM set, NulSEO sends:
- Access request notices to you when someone fills in the request-access form, and a confirmation to the person who asked.
- Invitation emails when you invite a teammate or approve an access request. The link is still copied for you.
- Password reset links, when someone uses the forgot-password link on the sign-in page.
If a send fails, the reason is written to the Worker's logs, and the invitation link still works when you pass it on yourself.
Admin command line#
Without email, password resets are done from a terminal, as are accounts outside the invitation flow:
- Set
NULSEO_OPERATOR_SECRETin.env.selfhostand runpnpm deploy:selfhost --yes. This turns on an operator endpoint that only answers requests carrying that secret. - Run the command from your NulSEO checkout, with your server's address in
NULSEO_URL. The password is read from standard input, so it never appears in your shell history or the process list.
Create an account:
read -rs -p 'Password: ' password; echo
printf '%s\n' "$password" | NULSEO_URL=https://nulseo.com pnpm selfhost:admin create-user you@example.com 'Your Name'
unset passwordReset a password:
read -rs -p 'New password: ' password; echo
printf '%s\n' "$password" | NULSEO_URL=https://nulseo.com pnpm selfhost:admin reset-password you@example.com
unset passwordA reset signs that person out everywhere. You can also keep NULSEO_URL in .env.selfhost instead of typing it each time.
Use your own domain#
Set CUSTOM_DOMAIN=seo.example.com in .env.selfhost and deploy. The domain must be a zone in the same Cloudflare account; the deploy attaches it to the Worker and creates the DNS record and certificate. Do not add the domain by hand in the dashboard, because each deploy removes custom domains that CUSTOM_DOMAIN does not name.
To serve a bare domain and its www too, list both, the main address first: CUSTOM_DOMAIN=example.com,www.example.com. NulSEO permanently redirects the others, and the old workers.dev address, to the first one.
If several stages deploy from the same .env.selfhost, use CUSTOM_DOMAIN_<STAGE> instead (for example CUSTOM_DOMAIN_SELFHOST for pnpm deploy:selfhost), so only that stage claims the domain.
Sign-in and MCP connections then work only on that address. Set it before creating accounts if you can. Changing it later signs everyone out, and agents have to reconnect to the new MCP address. If you use Search Console or Analytics, add the new redirect URIs in Google Cloud too (see Google sign-in).
Search engines#
A new deployment stays out of search results. https://nulseo.com/robots.txt turns every crawler away, and every page is sent with an X-Robots-Tag: noindex header.
To let search engines index the public pages (the landing page, the blog and this help centre), set PUBLIC_INDEXING=true in .env.selfhost and deploy. robots.txt then allows those pages and points to a sitemap at https://nulseo.com/sitemap.xml. Sign-in pages, shared reports, the API and the app itself are never indexed, whatever the setting.
If several stages deploy from the same .env.selfhost, use PUBLIC_INDEXING_<STAGE> instead (for example PUBLIC_INDEXING_SELFHOST=true for pnpm deploy:selfhost), so a test stage is not indexed alongside the real one.
Health check#
Open https://nulseo.com/api/health. It returns JSON with "status": "ok" when everything is configured, or "status": "issues" with a list of checks, each with a status and a hint. It covers configuration (which keys are set) and the database. It never shows secret values.
Point an uptime monitor at it if you want to know when something breaks.
Update NulSEO#
Pull the latest code and deploy again:
git pull
pnpm install
pnpm deploy:selfhost --yesDatabase migrations run as part of the deploy. Accounts, projects and settings are kept.
Logs and troubleshooting#
- Check
https://nulseo.com/api/healthfirst. - For server errors, open the Worker's Logs in the Cloudflare dashboard, or run
pnpm exec wrangler tailfor live logs. - If a Google connection fails with
redirect_uri_mismatch, see Google sign-in. - If paid lookups stop with a spend cap message, the Owner can raise the cap in Usage & caps. See Spend caps and usage.
Remove NulSEO#
To delete everything the deploy created, including all your data:
pnpm alchemy destroy deploy/alchemy/alchemy.run.ts --env-file .env.selfhost --stage selfhostThis cannot be undone.