← Back to Blog
Header image for blog post: How to set up preview environments for apps built with Claude Code
Daniel Adeboye
Published 27th July 2026

How to set up preview environments for apps built with Claude Code

TL;DR: how to set up preview environments for apps built with Claude Code

Every production-ready preview environment should provide:

  • Automatic environments for every pull request
  • Isolated infrastructure for testing changes safely
  • Temporary URLs for review and QA
  • Automatic cleanup after merge

There are two ways to set this up on Northflank:

  1. Using Claude Code with Northflank Skills (recommended): Install Northflank Skills and ask Claude to configure preview environments for you.
  2. Configure manually: Connect your Git repository from the Northflank dashboard and create a Preview Blueprint yourself.

What is Northflank?  Northflank is a full-stack cloud platform that deploys vibe-coded apps with production-grade infrastructure: managed databases, secrets management, TLS, CI/CD pipelines, preview environments per pull request, and BYOC into your own cloud. No infrastructure code. No DevOps background required.  Sign up to get started or book a demo.

You built an app with Claude Code. It runs locally. Now you need a safe way to validate every AI-generated change before it reaches production.

Instead of reviewing code alone, your team can test a live deployment for every pull request before merging changes.

This guide shows two ways to set that up on Northflank: let Claude configure everything with Northflank Skills, or do it yourself through the dashboard.

Why preview environments matter for Claude Code apps

Claude Code can generate and modify large amounts of code in minutes. That speed makes a reliable review workflow even more important. Every change should be validated before it reaches production, and every reviewer should be testing the same application.

Preview environments give every pull request a production-like deployment with its own services, databases, and URL. Developers, designers, QA engineers, and stakeholders can validate changes before they're merged, while isolated environments reduce the risk of AI-generated regressions reaching production.

What every preview environment should provide

Whether you use Northflank or another deployment platform, every production-ready preview environment should provide the same core capabilities.

  1. Automatic creation for every pull request: Opening a pull request should automatically create a new environment without requiring manual deployment.
  2. Isolated infrastructure: Every preview should run independently from production and other pull requests. Databases, services, and environment variables should not interfere with one another.
  3. Production-like configuration: Preview environments should use the same runtime, networking, dependencies, and infrastructure as production so reviewers test realistic conditions.
  4. Shareable URLs: Every preview deployment should generate a unique URL that developers, designers, QA engineers, and stakeholders can access without local setup.
  5. Automatic cleanup: Once a pull request is merged or closed, the preview environment should be removed automatically to avoid unnecessary infrastructure costs.

Northflank provides these capabilities out of the box using Preview Blueprints. The only difference is how you configure them: either by asking Claude Code through Northflank Skills or by creating the blueprint yourself from the dashboard.

Step 1: Create a Northflank account and connect your Git repository

Sign up for Northflank. The free tier includes two services, one database, and two cron jobs with always-on compute.

Once you’re in the team dashboard, go to Integrations and connect your GitHub, GitLab, or Bitbucket account. Northflank uses this connection to pull your repository code and trigger automatic builds every time you push a change.

Step 2: Choose your setup path

There are two ways to configure preview environments.

  • Using Claude Code with Northflank Skills (recommended): Claude configures the entire workflow using natural language.
  • Configuring manually: You create the same preview environment workflow yourself through the Northflank dashboard.

Both approaches create the same production-ready result. The only difference is whether Claude performs the infrastructure configuration for you or you configure it manually.

Step 3A: Set up preview environments with Northflank Skills

If you're using Claude Code, Northflank Skills can configure your entire preview environment workflow for you. Instead of navigating the dashboard and creating resources manually, you simply describe what you want in natural language and review the proposed infrastructure changes before they're applied.

Install Northflank Skills

From inside your Claude Code session, install the Northflank plugin:

/plugin marketplace add northflank/skills
/plugin install northflank@northflank

Or install it from your terminal:

claude plugin marketplace add northflank/skills
claude plugin install northflank@northflank

image.png

Before you continue: Install the Northflank CLI and log in. Northflank Skills uses the CLI to authenticate and manage infrastructure on your behalf.

Ask Claude to configure your preview environments

Once Northflank Skills is installed, it loads automatically whenever Claude is working with Northflank infrastructure. You don't need to mention the skill explicitly in your prompt.

For example, you can ask:

Create preview environments for this application on Northflank that automatically provision an isolated environment for every pull request. Generate a unique preview URL and automatically clean up each preview environment when its pull request is merged or closed. Then create a test branch and pull request to trigger the workflow so I can verify that the preview environment is working correctly.

If your application requires PostgreSQL, Redis, MinIO, RabbitMQ, environment variables, custom domains, or other infrastructure, simply include those requirements in the prompt. Claude will incorporate them into the deployment plan before asking you to approve the changes.

What Claude Code sets up

Here is exactly what Claude Code sets up, step by step.

1. Creates a build service and connects it to your repository

Claude creates a build service for your repository and connects it to your Git provider, enabling automatic builds and deployments.

2. Creates a Preview Blueprint

What is a preview blueprint? A Preview Blueprint is a reusable template that defines the infrastructure Northflank should create whenever a pull request is opened.

Claude creates a Preview Blueprint that automatically provisions an isolated preview environment for every pull request.

3. Creates a test branch and pull request

To verify the configuration, Claude creates a test branch and opens a pull request. This triggers the Preview Blueprint, which provisions a new preview environment automatically.

4. Verifies the preview environment

Once deployment completes, Claude verifies that the preview environment was provisioned successfully and is ready for review.

image 1.png

After Claude finishes configuring your preview environment workflow, your Northflank dashboard and pull request will look similar to this:

image 2.png

image 3.png

Step 3B: Set up preview environments manually

If you choose to configure preview environments manually, you can create the same workflow directly from the Northflank dashboard by following this guide:

What happens when you open a pull request

Once preview environments are configured, every pull request follows the same workflow.

  1. You or Claude Code create a feature and open a pull request.
  2. Northflank detects the new pull request automatically.
  3. A Preview Blueprint provisions an isolated environment.
  4. Your application and supporting infrastructure are deployed.
  5. Northflank generates a unique preview URL.
  6. Developers, designers, QA engineers, and stakeholders review the running application.
  7. You merge or close the pull request.
  8. Northflank automatically deletes the preview environment and all associated infrastructure.

Because every pull request receives its own isolated deployment, multiple developers and AI agents can work simultaneously without interfering with one another or with production.

FAQ: Preview environments for Claude Code

Do I need preview environments if I'm the only developer?

Yes. Even if you're working alone, preview environments let you verify AI-generated changes before they reach production. Reviewing a live deployment is often much easier than reviewing code or testing everything locally.

Does every pull request get its own environment?

Yes. Northflank automatically provisions a separate environment for every pull request, allowing multiple branches to be tested independently.

Can preview environments include databases?

Yes. Preview environments can provision managed PostgreSQL, MySQL, MongoDB, Redis, MinIO, RabbitMQ, and other project resources alongside your application.

What happens after I merge the pull request?

Northflank automatically deletes the preview environment and its associated resources after the pull request is merged or closed. You don't need to clean anything up manually.

Can Claude update my preview environment configuration later?

Yes. If you're using Northflank Skills, simply ask Claude to modify your Preview Blueprint, add services, provision another database, or change your deployment configuration. You'll review the proposed infrastructure changes before they're applied.

Conclusion

Preview environments are one of the safest ways to review AI-generated code before it reaches production. Instead of relying on local testing or code review alone, every pull request receives its own isolated deployment that behaves like a production environment.

With Northflank, you can configure preview environments either by asking Claude Code through Northflank Skills or by creating a Preview Blueprint yourself from the dashboard. In both cases, every pull request automatically receives a production-like deployment, making it easier for developers, QA engineers, designers, and stakeholders to validate changes before they reach production.

Ready to add preview environments to your Claude Code workflow?

Get started on Northflank with the free tier or book a demo to see how automatic preview environments help teams safely ship AI-generated code.

Share this article with your network
X