Install with an AI assistant
这个页面目前仅提供英文版本。
This page is written for an AI assistant that can run commands, such as Claude Code or Codex. Send it this prompt:
Read https://jant.me/docs/install.md and help me set up a Jant site.
The assistant confirms where you want to host the site, follows the matching guide, and stops for steps only you can complete — such as signing in to Cloudflare or setting your admin password.
Instructions for the assistant
You are helping the user set up a Jant site (a self-hosted, single-author blog). Work through the steps below in order, and respond in the user's language.
1. Check before asking
Inspect the local environment first without asking:
- Whether the current directory is already a Jant project (
package.jsondepends on@jant/core). If it containswrangler.toml, the target host is Cloudflare. - Whether it is a git repository and what remotes it has.
node --version(Jant requires Node.js 24 or later).docker --versionanddocker compose version, if Docker on this machine is a candidate.
If the user's initial message already specifies a repository, host, or domain, treat that as answered.
2. Ask once
Ask only the unanswered questions in a single message, listing each default so "use the defaults" is a complete answer:
- Where should the site run?
- Cloudflare (default): no server to maintain; a personal blog typically fits in the free tier.
- Your own server, with Docker: you manage the server.
- Hosted Jant: managed at jant.me for $10.46/year.
- Local machine only for now: try Jant locally before deploying.
- Do you have a custom domain ready? Default: no (the site starts on the host's default address; a domain can be added later).
- Only for Docker:
- Target machine: an SSH host (e.g.
user@server) or this machine. - Whether a reverse proxy with HTTPS (Caddy, Nginx, Traefik) is already running there. Default: no.
- Database: SQLite (default) or Postgres.
- Media storage: local disk (default) or S3-compatible storage.
- Target machine: an SSH host (e.g.
State in one or two sentences what you are about to do, then begin.
3. Follow the matching guide
Read the target guide before running commands from it. Every documentation page is also served as raw Markdown by appending .md to its URL.
| Answer | What to do |
|---|---|
| Cloudflare, no project yet | Run npm create jant@latest <directory>, then follow Local development first, then deploy. npm run deploy provisions the D1 database, R2 bucket, and AUTH_SECRET on the first run. |
| Cloudflare, project in the current directory | Follow the same section starting from npm run deploy. |
| Cloudflare, deployed via one-click button | Clone the created repository and run npm install and npm run dev. See Clone locally. Pushing to main triggers deployment. |
| Docker | Follow Deploy with Docker on the target server. Generate AUTH_SECRET directly into .env without printing it: printf 'AUTH_SECRET=%s\n' "$(openssl rand -base64 32)" >> .env. If using a domain, read the reverse-proxy section. |
| Hosted Jant | Point the user to Use Hosted Jant. Sign-up and billing are handled directly by the user; stop here. |
| Local machine only | Run npm create jant@latest <directory>, then npm run dev, and share http://localhost:3000. |
Inside a create-jant project, always use its package scripts (npm run deploy, never wrangler deploy directly). See the project's AGENTS.md for available scripts. With pnpm or Yarn, use pnpm run <script> or yarn <script>.
4. Hand back steps only the user can do
Pause, explain the exact action and where to perform it, and wait for confirmation before continuing:
- Cloudflare sign-in: run
npx wrangler login, which opens a browser for approval. - Enabling R2: if deployment reports R2 is not enabled, ask the user to open the R2 dashboard and click Enable R2.
- Selecting a Cloudflare account: when deployment lists multiple accounts.
- API tokens and repository secrets: such as GitHub Actions deployment secrets.
- DNS records: at any registrar or DNS provider you cannot access.
- Creating the admin account: give the user the site URL to set their email and password on
/setup. If they plan to bind a custom domain, bind it first (see Before going live).
5. Do not
- Never print, commit, or echo
AUTH_SECRET, API tokens, or passwords in chat. - On a server already running other services, ask before stopping any service, removing volumes (
docker compose down -v), or overwritingdata/or.env. - Never modify Cloudflare or DNS settings the user did not ask for. Offer optional enhancements at the end instead.
6. Finish
Setup is complete once the site URL loads the /setup screen. Report to the user:
- The site URL.
- Remaining manual steps: creating the admin account, and on Cloudflare any uncompleted items from Before going live (custom domain, R2 public access).
- How to upgrade later (Upgrading):
npm install @jant/core@latest && npm run deployon Cloudflare, ordocker compose pull && docker compose up -don Docker.
For a newly created Cloudflare project, remind the user to commit the files updated during first deploy (including wrangler.toml).