Host Your Portal
Deploy your generated APIMatic portal to any static host on your own domain.
An APIMatic portal is a static site. apimatic portal generate turns your src directory into a self-contained folder of HTML, CSS, JavaScript, and assets, so there's no server to run. You choose where it's deployed, which domain it lives on, who can reach it, and when it updates.
Static hosting is also fast, cheap, and works well behind a CDN.
Deploy your portal
1. Generate the portal
From the directory that contains src, run:
apimatic portal generate --destination=./portalAdd --force to overwrite changes. See portal generate in the CLI Reference for all flags.
2. Find the output folder
The folder you passed to --destination holds the complete site. That folder is what you deploy.
3. Deploy it to your host
Connect your host to a Git repository that contains the folder, or upload the folder directly. Any host that serves a folder of static files over HTTPS works.
4. Set up your domain
Point your custom domain at the host and turn on HTTPS. Then set the address the portal is served from in portal.site.url in apimatic.json, including any path (for example, a GitHub Pages project site at https://acme.github.io/docs):
{
"portal": {
"site": {
"url": "https://docs.example.com"
}
}
}See the apimatic.json reference.
sitemap.xml, llms.txt, and canonical links all use this address. If you host under a path, no robots.txt is generated, because crawlers only read it at the root of a host; if you control the root, add Sitemap: https://example.com/docs/sitemap.xml to its robots.txt.
Choose a host
| Host | Good to know |
|---|---|
| Netlify | Deploys from Git, with custom domains. |
| Cloudflare Pages | Serves your portal from Cloudflare's global network. |
| Vercel | Automatic HTTPS and preview deployments. |
| Microsoft Azure | Static Web Apps, or Blob Storage with static website hosting. |
| Amazon Web Services | S3 for the files, CloudFront in front for HTTPS and caching. |
Keep your portal up to date
Regenerate and redeploy the portal whenever your API definition or guides change. The simplest way is to add apimatic portal generate to your CI/CD pipeline, so every change to src publishes a fresh portal.
In CI, use Node.js 24 or later, and sign in with an API key instead of a browser session. Pin the CLI's major version, so a later major release doesn't change the pipeline:
npx @apimatic/cli@2 portal generate --destination=./portal --auth-key=$APIMATIC_API_KEYThen deploy the ./portal folder with your host's CLI or Git integration.