# Launch a website from scratch

For an AI agent helping someone go from "I want a website" to a live site on its
own domain: pick a name, register it, choose hosting, build the site, publish it,
and check it's live. Every step works from the MCP server (in ChatGPT, Claude or
any client) and from the API.

## Before you start: the account

The person needs a Porkbun account with a verified email and phone, and a way to
pay for the domain.

- **Connecting:** in ChatGPT or Claude, they add the Porkbun connector and sign in
  ([Connect ChatGPT or Claude](https://porkbun.com/llms/guides/connect-chatgpt-or-claude)).
  Other agents get keys with the [key handoff](https://porkbun.com/llms/guides/getting-started);
  a person without an account can create one on the approval page.
- **Verifying:** purchases need a verified email and phone. The agent can do both
  with codes the person reads out ([Verify an account](https://porkbun.com/llms/guides/verify-the-account)).
  About one in five new accounts also gets an identity check at signup: until it's
  done, every call returns `ACCOUNT_VERIFICATION_REQUIRED` with a `verificationUrl`
  to hand them.
- **Paying:** from account credit, or straight from their card or in USDC for this
  one purchase (`pay_with_card` / `pay_with_usdc`). The first hosting term is a free
  15-day trial, so hosting needs no payment up front.
  ([Buy a domain from an agent](https://porkbun.com/llms/guides/buy-a-domain-from-an-agent) has every option.)

## 1. Find a name

Suggest a handful and check them in one call:

- MCP `check_domains` with up to 25 names (API: `POST /domain/checkDomain` with `{"domains": [...]}`).

Tell the person both prices. Many names have a cheap first year (`firstYearPromo`)
and renew at `additional.renewal.price`, which can be much higher: a `.site` at
$1.96 renews at $28.84. A `.com` costs the same every year.

## 2. Register it

1. Rehearse: `register_domain` with `dry_run: true` and `cost_cents` from step 1. It
   returns `wouldSucceed`, the cost and the balance, and charges nothing.
2. Confirm the price with the person, then call it again without `dry_run`.

New domains come with Porkbun's nameservers, so the hosting step can follow straight away.

## 3. Choose the hosting

`list_hosting_plans` returns every plan with `bestFor` and `featuresText` in plain
words. In short:

| They want | Choose | Why |
|---|---|---|
| A site you build and keep up for them: a small business page, portfolio, landing page | **Secure Static Hosting** ($3/month) | Cheapest and fastest. You write the files and publish them with `deploy_site`. |
| To edit pages or post a blog themselves, or a shop or plugins | **Cloud for WordPress** (from $12/month) | They get WordPress; you can still edit it with `wordpress_request`. |
| Just a page of links for a social profile | **Link in Bio** ($3/month) | One page of links, edited with the Link in Bio tools. |

If unsure, ask: "Will you want to change the site yourself, or should I handle updates?"

Then `create_hosting` with the plan's `sku`, `acknowledged_cost_cents` set to its
`price`, and `agree_to_terms: "yes"`. Tell the person it starts with a free 15-day
trial and then renews at the plan price. The call can take 30 seconds or more; wait
for it.

## 4. Build the site

**Static:** write the pages (an `index.html`, a stylesheet, any images) and publish
them with `deploy_site`. Send text files as `{path, text}`, exactly as written, and
images as `{path, content}` in base64. Show the person a description or preview of
the content before publishing, since files at the same path are replaced.

**WordPress:** use `wordpress_request` to create and edit pages and posts (read a
page with `context: "edit"` first, then send it back changed), and
`wordpress_upload_media` for images. Site title and tagline need
`as_administrator`. See [Provision a WordPress site and edit it](https://porkbun.com/llms/guides/publish-to-wordpress).

**Link in Bio:** see [Build a Link in Bio page](https://porkbun.com/llms/guides/build-a-link-in-bio-page).

## 5. Wait for the new domain, then check

A brand-new domain usually starts working within a few minutes: the registry has to
publish it first, and the HTTPS certificate is issued once it resolves. Now and then a
registry is slower (up to an hour or so). Until then the site shows nothing, which is
normal.

- Tell the person this up front, so a blank page doesn't look like a failure.
- To check, load `https://<domain>/` (or ask them to). Don't hammer it in the first
  minutes: if a resolver is asked before the registry publishes the name, it may keep
  answering "doesn't exist" for a while afterwards.
- The HTTPS certificate follows automatically once the name resolves; `http://` may
  work a few minutes before `https://` does.
- If it still doesn't load after a few hours, check `get_domain` (status `ACTIVE`)
  and `get_nameservers` (Porkbun's), then contact support.

## 6. Hand it over

Tell the person what they have and what it costs from now on:

- the domain and its renewal date and price;
- the hosting plan, when the free trial ends, and that it then renews (they can turn
  that off with `update_hosting_auto_renew`);
- how to change the site later: ask you again; or for WordPress, log in to wp-admin;
- if someone else should be able to edit it with their own AI assistant,
  [share the site](https://porkbun.com/llms/guides/share-site-access).


---

## More

- Guides (how-tos): https://porkbun.com/llms/guides
- Help articles (knowledge base) as Markdown: https://porkbun.com/llms/kb
- Topic index: https://porkbun.com/llms
- Full reference (one file): https://porkbun.com/llms-full.txt
- OpenAPI spec (full schemas): https://porkbun.com/api/json/v3/spec
- Short overview: https://porkbun.com/llms.txt
- Official MCP server: https://porkbun.com/mcp (`npx -y @porkbunllc/mcp-server`)
- Create API keys: https://porkbun.com/account/api
