How to Deploy an App Built with Claude Code
Deploy Claude Code apps in 7 steps: Git, Docker, secrets, test locally, choose a platform, add a database, monitor. Vercel and Render for beginners, Northflank for enterprise.
- Deploy Claude Code apps by pushing to GitHub, containerizing with Docker, securing secrets, testing locally, choosing a platform, adding a database, and setting up monitoring
- Test your app inside a Docker container before pushing to production, not just in development mode
- Use environment variables for all secrets and credentials; never commit passwords or API keys to Git
- Vercel and Render are the fastest starting points for beginners; Northflank adds enterprise features; Hetzner + Coolify wins on cost for sustained traffic
- Set up error tracking (Sentry) and logs monitoring on day one of production, not when something breaks
Deploying a Claude Code app is a seven-step sequence: initialize Git, containerize your code, secure your environment variables, test locally, pick a platform, add a database, then audit for production readiness. Do these steps in order. Skip the security or testing steps, and you will ship broken code. This guide walks you through each one.
How do I initialize Git and push my Claude Code app to GitHub?
Start with version control. You already have a working app from Claude Code; now it needs to live somewhere safe. Open your project directory in your terminal. Run git init to create a Git repository. Create a .gitignore file and add it to your repo--use GitHub's Node.js template if your app is JavaScript, or Python if it is Python. Add your files with git add., then commit with git commit -m "Initial commit".
Now push to GitHub. Create a new repository on GitHub.com (free). Then run the commands GitHub shows you: git remote add origin <your-repo-url> and git push -u origin main. Your code is now backed up and ready for deployment platforms to pull from.
This is the moment most people relax. Do not. Your app is not deployed yet--it is just saved. The next six steps are what actually puts it in front of users.
How do I containerize my Claude Code app with a Dockerfile?
A Dockerfile is a recipe that tells your deployment platform how to run your app. You do not need to write it from scratch. Tell Claude Code: "Create a production-ready Dockerfile for this Node.js/Python app." It will generate something like this: FROM node:18, RUN npm install, COPY.., EXPOSE 3000, CMD ["npm", "start"]. Copy that into a file called Dockerfile in your project root.
Before you push, test it. Run docker build -t myapp. && docker run -p 3000:3000 myapp on your machine. Then open a browser and navigate to the local development server. Does your app boot? Does it respond? If yes, push the Dockerfile to GitHub. If no, fix the error before moving forward.
A Dockerfile is not optional. It tells your hosting platform (Render, Vercel, Northflank, or Hetzner) exactly how to run your code without you being in the room.
How do I set up and protect environment variables and secrets?
Your app needs secrets: API keys, database passwords, third-party tokens. Never hardcode them into your source code. Never push them to GitHub. Instead, create a .env.local file in your project root with real values for local development. Add .env.local to .gitignore so Git never tracks it. Push only a .env.example file with placeholder values like DATABASE_URL="your-database-url-here".
On your deployment platform, paste your real secrets into their environment variables UI. Vercel, Render, Northflank, and Hetzner (via Coolify) all have a secrets panel. Your platform injects these values at runtime, so your code can read them with process.env.DATABASE_URL or os.getenv("DATABASE_URL") without seeing the actual values in Git.
Test this locally. In your terminal, run export DATABASE_URL="real-url" && npm run dev. Watch your logs to confirm your app reads the variable correctly. This step is where most deploys fail--a missing or misspelled environment variable.
How do I test my app locally before pushing to production?
Testing in production is how you learn your app does not work at 2 AM on a Sunday. Test locally first. Run your Dockerfile locally as if it were production: docker build -t myapp. && docker run -p 3000:3000 myapp. This is not the same as npm run dev. It runs your app the way your host will run it.
Walk through every critical flow: user signup, create something, save it, retrieve it. Check your browser DevTools console for errors. Check your app's terminal logs for warnings. Then test failure modes. What happens if the database goes down? If an API times out? If a user submits invalid data? If an image upload fails? Build error handling for these before you ship. Ask Claude Code to add try-catch blocks and fallback UI.
Load testing is optional at first, but try it anyway: open your app in 10 browser tabs and click things fast. Does it stay responsive? Does it log errors? Run this test every time you add a database query or an external API call.
What platforms can I deploy to, and what are the tradeoffs?
You have five solid options for deploying Claude Code apps. Here is the honest comparison:
Vercel: Best for Next.js and React apps. Free tier includes one project. Serverless (no servers to manage). Deploy on every Git push. Included database (Postgres) on paid tier. Built-in monitoring and logs. Best for: simple apps, fast shipping, no DevOps. Tradeoff: usage-based pricing scales with traffic.
Render: Full-stack apps without headaches. Postgres included even on free tier (limited). Deploy on Git push. Auto-scaling. Simple dashboard. $7/month minimum for production-grade. Best for: side projects graduating to real users. Tradeoff: smaller ecosystem than Vercel.
Northflank: Enterprise-grade Kubernetes. SOC 2 Type 2 certified. Auto-scaling, load balancing, zero-downtime deploys. Higher price ($50+/month minimum). Best for: production apps with compliance requirements. Tradeoff: steeper learning curve than Render.
Hetzner + Coolify: Cheapest for sustained load. Hetzner is a bare server ($3-10/month). Coolify is free open-source software you run on it. You manage everything. Best for: founders who know DevOps and want to save money. Tradeoff: you are the ops team.
AWS: Unlimited power. ECS, RDS, Lambda, S3, CDN. Also unlimited complexity. Best for: mature apps needing everything. Tradeoff: $100+ per month, steep learning curve.
For your first ship: Render or Vercel. Add Northflank or Hetzner later if you need enterprise features or cost optimization.
How do I choose and configure a database for my app?
Your app probably needs persistent storage. Do not skip this. A database is not optional for real apps. If you are on Vercel, use Vercel Postgres (built-in). If you are on Render, use Render Postgres (included). If you are self-hosting on Hetzner, do not run a database server on the same machine--use a managed service like Neon or Supabase instead. Running your own Postgres is possible but means you own backups, upgrades, and disaster recovery.
Connect your database via an environment variable (DATABASE_URL or similar). Never put the password in your code. Never put it in Git. Your deployment platform injects it at runtime. Test your connection string locally before deploying. Run a simple query: SELECT 1. If it returns 1, your connection works.
Schema migrations are how you update your database structure without losing data. Use a tool like Prisma, TypeORM, or Alembic (Python) to manage migrations. Before deploying, run your migration locally, test it, then deploy. Some platforms (Render, Northflank) run migrations automatically on deploy. Verify this in your platform's documentation.
Backups are not optional. Your platform should handle automated daily backups. Verify this. Test a restore (restore from backup, verify the data). A backup you have never tested is a backup that does not exist.
What should I audit before your first paying customer uses it?
Before you launch, walk through this checklist. It takes two hours. Ship without it, and something will break on your first real user. First: document your environment variables. Which ones are required? Which are optional? Create a .env.example that is filled out. Second: test a backup and restore. Download your database, restore it locally, verify nothing is missing. Third: audit your code. Delete every console.log(), remove test credentials, remove hardcoded URLs. Fourth: set up error alerting. Sign up for Sentry (free tier included) or use your platform's built-in logs.
Fifth: verify HTTPS is on by default and HTTP redirects to HTTPS. Sixth: test on mobile. Is your UI responsive? Does it work on a small phone screen? Seventh: stress test. Can your app handle 100 simultaneous users? Ask Claude Code to help you write a load test. Use a dedicated production-readiness checklist: see our Ship guide on checklist-before-your-first-paying-customer for the complete list.
How do I set up monitoring, error tracking, and logs after deployment?
After you deploy, you are blind without visibility. Check your platform's built-in logs first. Vercel, Render, and Northflank all have log dashboards--use them. Watch logs for the first 30 minutes after deploy. Are there any errors? Any warnings?
For error tracking, sign up for Sentry (free tier included). It will send you Slack or email alerts when your app crashes. You will see the stack trace, the user who hit it, and the exact line of code that broke. Fix errors from Sentry within hours of deploy. Do not let them stack up.
For performance, check your platform's built-in metrics: response times, database query times, CPU and memory usage. Set up a synthetic uptime monitor: Vercel and Render both have this built-in. A simple ping hits your homepage every 5 minutes. It will alert you if your app goes down before your users notice.
Review logs daily for the first week after launch. Then weekly. Set up Slack notifications for errors. This takes 10 minutes a week and catches problems before they become outages.
Frequently Asked Questions
Can you build a full app with Claude Code?
Yes. Claude Code has generated over 78,400 projects on GitHub. It can build web apps with databases, authentication, and APIs. It cannot build native iOS or Android apps (it generates web apps only). For full-stack web applications, yes: Claude Code can do the entire stack.
Can you deploy Claude Code locally?
Yes. You can run a Claude Code app on your laptop for development and testing. Use Docker: docker run -p 3000:3000 myapp. For production, deploy to a platform like Render or Northflank, not your laptop.
How do I deploy a Claude Code app?
Initialize Git, push to GitHub, containerize with Docker, secure environment variables, test locally, choose a deployment platform, add a database, and set up monitoring. See this guide for the seven-step process.
Can you deploy Claude Code to AWS?
Yes. Use ECS (Elastic Container Service) or Lambda. AWS will run your Docker container. The learning curve is steeper than Render, but AWS offers unlimited scale.
What if my Claude Code app has bugs after deployment?
Check your logs first (your platform's dashboard or Sentry). Fix the bug, commit to Git, push, and your platform will auto-deploy. This should take 5 minutes. If logs do not show the error, ask Claude Code to add logging: console.log(error) in your catch blocks.
Is Claude Code free to use?
Claude Code is part of Claude.com and is free to use. Hosting your app (Render, Vercel, etc.) has separate costs, usually $0-50/month depending on your platform and traffic.
Do I need DevOps experience to deploy a Claude Code app?
No. Platforms like Render and Vercel hide DevOps behind a dashboard. Click "Deploy" and it works. Understanding Docker and environment variables is helpful but not required. Learn as you go.
The Bottom Line
Deploying a Claude Code app is not magic--it is a process. Follow the seven steps (Git, Docker, secrets, test, platform, database, monitoring), and your app will be production-ready. Skip any step, and something will break. The Claude Code part ends in the first 20 minutes. Everything else is standard deployment practice, the same for any web app. Ship your app with Opsily's managed hosting on Ship.