Deploy, Convert & Scale

Deploying a Claude Code App to Production: Domain, CI, SEO

Claude Code does not host anything itself: it writes and changes code in your repository, so deploying a Claude Code app means picking a normal hosting platform, wiring CI/CD, managing secrets and adding monitoring. The upside is total freedom of stack, and you can let Claude Code generate the deployment config, pipelines and checks as long as a human reviews them.

neooutput editorial team 4 min read Auf Deutsch lesen

Pick hosting that matches what Claude Code built

Choose hosting based on the framework in the repo, not on the AI tool that wrote it.

A Next.js app fits Vercel or Netlify; a Vite SPA fits any static host or Cloudflare Pages; a Node, Python or Go API with background jobs fits Fly.io, Railway, Render, Google Cloud Run or AWS; and a containerized monolith runs anywhere Docker runs. Ask Claude Code to explain the architecture first ('what processes, ports, databases and env vars does this app need?') and decide from that answer. If you have no strong preference, a managed platform with preview deployments saves weeks of DevOps.

If customers also expect the product in the App Store and Google Play, keep the production web app responsive and its authentication mobile-friendly. A WebView-based converter such as WebViewGold can then package the deployed app as native iOS and Android apps without a rewrite, with push notifications, in-app purchases and deep links configurable. It works best when the app adds genuine native value, since Apple's guideline 4.2 rejects apps that are only a website in a frame.

Let Claude Code write the deployment config, then review it

Claude Code is very good at producing Dockerfiles, platform config files and CI workflows, but every line that touches production deserves human review.

Typical prompt: 'Create a production Dockerfile with a multi-stage build, non-root user and health check, plus a GitHub Actions workflow that runs lint, typecheck and tests on pull requests and deploys main to our host.' Record the deployment conventions in CLAUDE.md (hosting provider, environments, migration command, forbidden actions) so every future session follows them. Use permission settings to stop the agent from running deploy commands or reading .env files on its own.

A useful pattern is to let Claude Code run in plan mode for infrastructure changes: it proposes the full set of files and commands, you review the plan, and only then does it write. For anything involving cloud credentials, run the actual provisioning yourself or through CI, so the agent's role stays limited to producing reviewable code.

  1. Ask Claude Code to inventory runtime requirements and env vars into a .env.example file.
  2. Generate Dockerfile or platform config and a CI workflow; review diff by diff.
  3. Create staging and production environments at your host.
  4. Run database migrations as an explicit, logged pipeline step.
  5. Deploy to staging, smoke-test, then promote to production.

Custom domain and HTTPS

Attach the domain at the hosting provider, create the DNS records it specifies and enforce HTTPS plus a single canonical hostname.

Most managed hosts issue certificates automatically. Add HSTS once you are sure HTTPS works everywhere, redirect www or apex to the canonical version, and update OAuth redirect URIs, CORS allowlists and email links to the production domain. Claude Code can grep the codebase for hard-coded localhost or preview URLs before launch.

Secrets: keep them out of the repo and out of the agent's context

Production secrets belong in the host's secret manager or a dedicated vault, never in committed files, and ideally never in the agent's context window either.

Commit only .env.example with placeholder values, add .env to .gitignore and deny Claude Code read access to real env files in its settings. Add a secret scanner (for example gitleaks) to CI or a pre-commit hook; Claude Code hooks can also run checks automatically after edits. Rotate any key that was ever pasted into a chat or committed.

SEO depends on the rendering model you choose

Because you control the stack, you can pick server-side rendering or static generation for public pages, which is the single biggest SEO decision.

If search traffic matters, ask Claude Code to use SSR or static generation for marketing and content routes, generate a sitemap, robots.txt, canonical tags, Open Graph metadata and structured data, and to keep authenticated app routes out of the index. Then verify with Google Search Console and a Lighthouse run rather than trusting the agent's claim that it is done.

Monitoring, alerts and rollbacks

Ship with error tracking, uptime checks, structured logs and a tested rollback path.

Wire Sentry or a similar tool on frontend and backend, send structured JSON logs to your host's log viewer or a log platform, and add a /health endpoint checked every minute by an external monitor. Make sure you can roll back with one click or one command, and practice it once. Claude Code can connect to monitoring tools through MCP servers, which makes 'investigate this production error' a realistic workflow, but keep production write access out of the agent's reach.

Frequently asked questions

Can Claude Code deploy my app by itself?

It can run deploy commands if you allow it, but the safer pattern is that Claude Code writes the CI/CD pipeline and humans approve merges that trigger deployment. Restrict deploy and production commands in its permission settings.

Which hosting is best for a Claude Code app?

Whatever fits the stack: Vercel or Netlify for Next.js and static sites, Fly.io, Railway, Render or Cloud Run for APIs and containers, a major cloud for enterprise requirements.

How do I stop Claude Code from seeing my production secrets?

Keep secrets in the host's secret store, commit only an example env file and add deny rules for env files in Claude Code's settings. Use separate, limited credentials for local development.

All insights