LogoLogo
Run to Console
  • ClawCloud Run
    • Document
    • Getting Started
      • Create a DevBox
      • Deploy Database
      • Deploy from Docker
      • Deploy from Template
    • Guide
      • App Launchpad
        • Install Application
        • Update Application
        • Custom Domain
        • Exposing Multiple Ports
        • Environment Variables
        • Configuration Files
        • Auto Scaling
        • Persistent Storage
        • Custom Domain Certificates
      • Devbox
        • Devbox List
        • Devbox Details
        • Devbox Release
      • Database
        • PostgreSQL
        • MySQL
        • Redis
        • MongoDB
        • Kafka
        • Milvus
      • Object Storage
      • Advanced
        • Workspace
        • Terminal
        • Cron Job
        • KubeConfig
    • Pricing
    • Billing & Usage
    • Migration
      • Migrate from Docker
      • Migrate from Docker Compose
    • Architecture
      • Devbox Architecture
      • System Architecture
      • User Architecture
    • Legal
      • Privacy Policy
      • Terms and Conditions
      • Data Processing Addendum
    • Changelog
    • Best Practice
    • FAQ
    • More
      • Abuse Complaint
    • Help
  • Blog
Powered by GitBook

Copyright @ 2023-Present CLAWCLOUD. All Rights Reserved.

On this page
  • Creating a Devbox Project
  • 1. Select the development framework
  • 2. Configure network settings
  • 3. Create the project
  • Connecting to the Development Environment
  • Development and Debugging
  • 1. Access project files
  • 2. You can start debugging your Next.js application
  • 3. Access the application locally
  • 4. To access your running devbox
  • 5. In the project details page
  • Publishing the Application
  • Deploying the Application

Was this helpful?

Export as PDF
  1. ClawCloud Run
  2. Getting Started

Create a DevBox

This guide introduces how to use ClawCloud Run DevBox to create, develop, and deploy Next.js applications, including project setup, remote development with Cursor IDE, and cloud deployment.

PreviousGetting StartedNextDeploy Database

Last updated 1 month ago

Was this helpful?

ClawCloud Run DevBox is an all-in-one cloud development platform that integrates local development, online testing, packaging, and deployment. With simple click operations, you can quickly create the necessary environment and database dependencies. Developers can use their familiar local IDE for development while enjoying a simplified environment configuration process and an automated application deployment experience.

This guide will walk you through using DevBox to create a basic Next.js sample project.

Creating a Devbox Project

1. Select the development framework

Visit , click on the Devbox App, and then click the "Create Devbox" button. In the configuration, select Next.js as the development framework. Adjust the number of CPU cores and the amount of memory required for the project using the slider.

2. Configure network settings

  • Scroll down to the "Network Setting" section of the configuration page.

  • Container Port:

    • Enter "3000" in the Container Port field. This is the default port that Next.js uses for development.

    • If you need additional ports, click the "Add Port" button and specify them.

  • Enable Internet Access:

    • Toggle the switch to enable internet access for your DevBox. This allows external users to access your Next.js application through the public internet using the provided domain.

  • Domain:

    • By default, ClawCloud Run provides a subdomain for your application.

    • If you want to use a custom domain, click on "Custom Domain" and follow the instructions to set it up.

Note: Ensure that the container port (3000) is consistent with the running port of the Next.js application. If you modify the port in the Next.js configuration, you need to update it here accordingly.

3. Create the project

Click the "Create" button to complete the project creation.

Connecting to the Development Environment

After creating your project, you'll see it listed in the DevBox List. Each project has an "Operation" column with various options.

1. To connect to your project's DevBox runtime using Cursor IDE:

  • Locate your project in the DevBox List.

  • In the "Operation" column, click on the dropdown arrow next to the VSCode icon.

  • From the dropdown menu, select "Cursor".

  • Click on the "Cursor" option that appears.

2. When you click on "Cursor", it will launch the Cursor IDE application on your local machine. Within Cursor, a popup window will appear, prompting you to install the DevBox plugin for Cursor. This plugin enables SSH remote connection to the DevBox runtime.

  • Follow the instructions in the Cursor popup to install the DevBox plugin.

  • Once installed, Cursor will establish a remote connection to your DevBox runtime.

You can switch between different IDE options (VSCode, Cursor, WindSurf, Trae or VSCode Insiders) at any time by using the dropdown menu in the "Operation" column.

Development and Debugging

1. Access project files

After the connection is established, you'll be able to access and edit your project files directly within the Cursor IDE environment.

After the connection is established, you'll be able to access and edit your project files directly within the This remote connection allows you to develop your Next.js application using Cursor IDE, with all the benefits of a cloud-based development environment: - Your code runs in the DevBox runtime, ensuring consistency across development and production environments. - You can access your project from anywhere, on any device with Cursor installed. - Collaboration becomes easier as team members can connect to the same DevBox runtime.

2. You can start debugging your Next.js application

  • Open the terminal within Cursor IDE.

  • Navigate to your project directory if you're not already there.

  • Run the following command to start the Next.js development server:

npm run dev

If using a different runtime environment, use the corresponding startup command.

  • This command will start your Next.js application in development mode.

3. Access the application locally

Switch to the "Ports" tab of the Cursor panel.

Click the 🌐 button to the right of the address bar.

Select "Open in Browser" in the pop-up window to open and test the running app in your browser.

4. To access your running devbox

  • Return to the DevBox List in your browser.

  • Find the project you just created.

  • Click on the DevBox you want to access.

5. In the project details page

  • Look for the "Network" section.

  • You'll see an "Public Address" field.

  • Click on this external address.

This will open your Next.js application in a new browser tab, allowing you to view and interact with your running service.

Publishing the Application

1. Build the application:

  • In the Cursor IDE terminal, make sure you are in the project directory.

  • Run the build command :

npm run build

This command will generate a production-ready version of the application in the .next directory.

2. Start publishing:

  • Open the Devbox project list.

  • Find your project and click the "Details" button.

  • In the project details page, find the "Version History" area and click the "Publish Version" button in the upper right corner.

3. Fill in the publishing information

In the pop-up "Publish Version" dialog box, fill in:

  • Image name: The system has pre-filled the project image name.

  • Version number: Enter the version number (e.g., v1.0).

  • Version description: Briefly describe the content of this release (e.g., "First release" or "Fix login functionality").

4. Complete the publishing

  • After checking that the filled information is correct, click the "Deploy" button.

  • The system will start processing the publishing request.

  • After completion, the new version will appear in the "Release" list, showing the version number, status, creation time, and description.

At this point, the Next.js application has been successfully packaged as an OCI image, which can be used for deployment or shared with team members. Each release creates a snapshot of the current code, making it easy to manage different versions and allowing for quick rollbacks if necessary.

It is recommended to create a new version when the project has significant updates or reaches a milestone. This helps clearly document the development progress of the application and makes deployment and collaboration more convenient.

Deploying the Application

After packaging the application as an OCI image, it can be deployed to the production environment through the ClawCloud Run. The specific steps are as follows:

  1. Enter the deployment process:

    • In the "Release" area of the project details page

    • find the Release you want to deploy.

    • Click the "Deploy" button in the Actions column

    • the system will automatically jump to '"App Launchpad".

  1. Set deployment parameters

In "App Launchpad", follow the deployment wizard to set up:

  • Select the appropriate runtime environment.

  • Set resource limits such as CPU and memory.

  • Configure necessary environment variables.

  • Set up storage volumes as needed.

  1. Deploy the application

  • Click the "Deploy Application" button in the upper right corner, and the page will jump to the application details page.

  • When the status shows "running", it means the deployment is successful.

  • Click the access address under "Public Address", and you can open the deployed application in the browser.

After completing the above steps, the Next.js application is successfully deployed and can be accessed via the public network.

If you need to update the application, you can publish a new version in Devbox at any time. In the pop-up window, you can choose to update the deployed application or create a new application.

Through this complete workflow, you can conveniently develop and debug Next.js applications in a cloud environment while continuing to use your familiar local development tools. With the external access address, you can easily show the project progress to team members or customers. As long as they are connected to the Internet, they can access the application at any time.

After the development and testing of the Next.js application are completed, it can be packaged as an image to add version control and prepare for subsequent deployment.

OCI (Open Container Initiative)
ClawCloud Run
Create Devbox
Configure network settings