Deploying your application

Last updated: June 13, 2025

This guide will walk you through the entire process of deploying your application, from final preparations to launching it live. The engine that powers this process is the Codesphere CI Pipeline, which automates the steps needed to get your code running reliably online.

1. Prerequisites: Before you deploy

To ensure a successful deployment, complete these two essential steps first.

Commit your code

The CI Pipeline deploys the most recently committed version of your code. Any unsaved or uncommitted changes will not be included in the deployment.

Before you begin, go to the Git tab, write a clear commit message, and commit all your changes.

Configure environment variables

Your application likely needs sensitive information or configuration that shouldn't be saved directly in the code, such as API keys, database passwords, or port numbers. These should be stored as Environment Variables.

You can manage these in the Env Vars tab in the main IDE view. Click "+ Add new variable" to create a new entry. These variables will be securely injected into your application's environment when the pipeline runs.


2. Configuring the CI Pipeline

The pipeline's behavior is defined in your ci.yml file. Here, you specify the commands for each of the three stages:

  • Prepare stage: Define the commands needed to install your project's dependencies (e.g., npm install).

  • Test stage (Optional): Define any commands to run automated tests that verify your code's quality (e.g., npm test).

  • Run stage: Define the command that starts your application server. This is the command that will keep your application running and accessible (e.g., npm start or python main.py). This is also where you select the resource plan for your live application.


3. Executing the deployment

You will now run each stage of the pipeline in sequence.

Step 1: Run the "Prepare" stage

Navigate to the Prepare stage view and click the "Run" button. Watch the output in the CI Pipeline tab at the bottom of the screen and wait for all commands to complete successfully.

Step 2: Run the "Test" stage

Once "Prepare" is complete, navigate to the Test stage and click "Run". If you have no tests defined, this stage will complete instantly.

Step 3: Run the "Run" stage

Finally, navigate to the Run stage and click "Run". This will execute the start command for your application. Once this stage is active, your application is officially deployed and running.


4. Accessing and monitoring your live application

  • Access your app: Once the Run stage is active, the platform provides a public URL to access your application. You can find this link in the top bar of the IDE by clicking "Open deployment".

  • Monitor performance: You can monitor the real-time CPU and Memory usage of your newly deployed application by navigating to the Monitoring tab. This is essential for ensuring your application is healthy and has enough resources.

  • View live logs: The live output of your running application (any stdout or stderr) will be streamed to the Terminal tab, allowing you to watch for errors or debug issues as they happen.