Deploy a Claude Code App to Production: Hosting, CI/CD, Secrets

Deploying an app built with Claude Code: pick hosting, set up CI/CD with tests, manage secrets, add observability and keep the agent in guardrails.

Short answer

An app built with Claude Code is ordinary code in your repository, so production deployment follows normal engineering practice: choose hosting that fits the stack, run tests and builds in CI, keep secrets out of the repo and the agent's reach, and add logging and alerts. The difference is that you should encode these rules in CLAUDE.md and CI so the agent respects them in every future change.

On this page
  1. The advantage you start with
  2. Start with an inventory
  3. Choose hosting by architecture, not habit
  4. CI/CD: the pipeline is your quality gate
  5. Secrets: keep them away from the repo and the agent
  6. Write the rules down where the agent reads them
  7. Observability from the first deploy
  8. Releases and rollback
  9. When a team or SLA is needed
  10. FAQ
  11. Tools from the jocapps ecosystem

The advantage you start with

Unlike hosted app builders, Claude Code works in your own repository on your own machine or CI runner. Nothing is locked into a platform. You own the code, the stack choice and the deployment target from day one. The flip side is that nobody deploys it for you, and an agent that wrote 20,000 lines in a fortnight did not necessarily write a Dockerfile, a test suite or a sensible secrets strategy unless asked.

So the work is less "how do I get it out of the tool" and more "how do I put production discipline around fast agentic development".

Start with an inventory

Before choosing hosting, ask Claude Code itself to describe what it built. A prompt such as "list the runtime, framework, database, external services, environment variables and build commands this project uses" gives you a starting map. Verify it by reading package.json, pyproject.toml or equivalent, and check for:

  • Hard-coded URLs, API keys or test credentials in the source.
  • Local-only assumptions such as SQLite files, local file uploads or localhost callbacks.
  • Background work running inside web request handlers.
  • Missing database migrations (schema created by hand during development).

Each of these is a production incident waiting to happen. Fix them before deploying, ideally with the agent doing the work and you reviewing the diff.

Choose hosting by architecture, not habit

What Claude Code builtSensible hostingWatch out for
Static or Next.js front end with serverless API routesVercel, Netlify, CloudflareFunction timeouts on long AI calls
Node or Python API with PostgresRender, Fly.io, Railway, a managed container serviceConnection pooling, migrations on deploy
Several services and workersKubernetes or a managed container platformOverhead you may not need yet
Internal tool with strict data rulesYour own cloud account in an EU regionNetwork, SSO and audit requirements

Containerise unless there is a reason not to. A Dockerfile that Claude Code writes and you review makes the app portable between providers and makes local, CI and production behave the same.

CI/CD: the pipeline is your quality gate

With agentic development, CI is not optional, because it is the only reviewer that runs on every change. A minimal pipeline for a Claude Code project:

  1. Install dependencies from a lockfile.
  2. Lint and type-check.
  3. Run unit and integration tests against a disposable database.
  4. Build the production artefact or container image.
  5. Deploy to a staging environment automatically on merge to main.
  6. Promote to production with a manual approval or a tag.

GitHub Actions or GitLab CI both handle this well. Ask Claude Code to write the workflow, then read it carefully, especially anything involving credentials or deploy permissions.

Claude Code can also run inside CI, for example to review pull requests or fix failing tests. If you do this, give it a narrowly scoped token and never the production deploy credentials.

Secrets: keep them away from the repo and the agent

Agents read files. If a .env with production keys sits in the working directory, it can end up in a prompt, a log or a commit. Practical rules:

  • Production secrets live only in the hosting provider's secret store or a vault, injected at runtime.
  • Local development uses separate, low-privilege keys.
  • Add .env* to .gitignore and run a secret scanner in CI.
  • Use Claude Code's permission settings to deny reading secret files and running deploy commands locally.
  • Rotate any key that ever appeared in a chat or commit.

Write the rules down where the agent reads them

CLAUDE.md is loaded into Claude Code's context at the start of each session. Use it to make production constraints permanent rather than repeating them in every prompt:

## Production rules
- Never edit files in /infra or .github/workflows without being asked.
- All schema changes go through a new migration file; never alter existing ones.
- Every new endpoint needs a test and input validation.
- Do not log request bodies or personal data.
- Read config only via src/config.ts, never process.env directly.

Combine this with hooks or CI checks that enforce the same rules, because instructions guide the agent but do not guarantee compliance.

Observability from the first deploy

Add, at minimum:

  • Structured logs with a request ID, shipped to a log service you can search.
  • Error tracking with stack traces for both front end and back end.
  • Health and readiness endpoints used by the platform and an uptime monitor.
  • Basic metrics: request rate, error rate, latency, and for AI features, model call count, tokens and cost per day.

When something breaks, you can paste the stack trace and relevant logs into Claude Code and let it investigate, which works far better than describing symptoms.

Releases and rollback

Tag every release, keep the previous container image or build, and make rollback a single command. Run database migrations as a separate, reversible step, and avoid destructive migrations in the same release as the code that stops using a column.

When a team or SLA is needed

Many teams use Claude Code to build quickly and then realise they need someone accountable for the production system. OnlineAppCreator provides that: AI Code Engineers who set up hosting, CI/CD, secrets management and monitoring for agent-built codebases, and then operate them under an SLA. Because they work with the same agentic tools, they can keep pace with how fast your team ships. For B2B and public-sector clients, OnlineAppCreator also covers hosting in your own cloud tenancy and the documentation procurement asks for.

If your Claude Code project includes a mobile app, appsubmitter.io can take over store submissions and the store-side CI. See publishing a Claude Code app to the App Store and CI/CD for AI-built mobile apps. For the team side, our Claude Code workshop for engineering teams covers these guardrails hands-on.

FAQ

Where should I host an app built with Claude Code?

Anywhere that fits its architecture. Claude Code writes standard code, so a Next.js app suits Vercel or similar, while an API with Postgres suits a container platform. Containerising keeps your options open.

Can Claude Code deploy to production by itself?

It can run deploy commands if you let it, but we advise against giving it production credentials. Let it write and fix pipelines; let CI with reviewed workflows and manual approval do the deploying.

How do I stop Claude Code from leaking secrets?

Keep production secrets out of the working directory entirely, deny access to secret files in its permission settings, use a secret scanner in CI and rotate anything that was ever exposed.

What should go into CLAUDE.md for production apps?

Architecture boundaries, migration rules, testing requirements, logging and data protection rules, and which directories the agent must not change without explicit instruction.

Tools from the jocapps ecosystem

Want this done right, and fast?

Talk to our AI Code Engineers and AI architects. In a free 30-minute call we look at your idea, prototype or roadmap and tell you honestly what it takes to ship it.

24/7 call support in English and German.

Free call

Free intro call

Tell us which task an AI agent should take responsibility for. We show how our platform, AI Code Engineers and operations plug into your stack.

  • 30 minutes, no obligation
  • Honest feasibility check
  • Concrete next step
Rather talk now? 24/7 call support in English and German+49 761 519 751 50