Introduction

Welcome back, intrepid developer! In our previous chapter, we got you all set up with a Void Cloud account and installed the powerful Void CLI. You’re now standing at the threshold of deploying your very first application to the cloud. How exciting is that?!

This chapter is all about taking that critical first step: deploying a classic “Hello World” application to Void Cloud. We’ll guide you through creating a simple web server, configuring your project for Void Cloud, and sending it live for the world (or at least, your browser) to see. Our goal is to give you that satisfying “aha!” moment when your code runs seamlessly in the cloud, building your confidence in the process.

By the end of this chapter, you’ll have a clear understanding of the basic Void Cloud deployment workflow, from local development to a live URL. Let’s make some cloud magic happen!

Core Concepts: The Path to Your First Cloud App

Before we dive into the code, let’s briefly touch upon the core ideas behind deploying an application to Void Cloud. Understanding these concepts will make the steps that follow much clearer.

The Void Cloud Project: Your Application’s Blueprint

Every application deployed to Void Cloud lives within a project. A Void Cloud project isn’t just your application’s code; it’s also a set of configuration files that tell Void Cloud how to build, run, and serve your application. The most important of these is the void.json file, which acts as your project’s blueprint.

How Deployment Works: From Code to Cloud

When you deploy your project, Void Cloud doesn’t just copy your files. It orchestrates a series of steps:

  1. Upload: Your local project files are securely uploaded to Void Cloud.
  2. Build: Void Cloud detects your project’s language (e.g., Node.js, Python, Go) and framework, then runs any necessary build commands (like npm install for Node.js or npm run build for a frontend framework).
  3. Deploy: The built application is then deployed to Void Cloud’s global infrastructure, making it accessible via a unique URL.
  4. Runtime: Void Cloud provides a robust runtime environment, automatically managing servers, scaling, and network access for your application.

This entire process is designed to be fast, efficient, and largely automated, allowing you to focus on writing great code rather than managing infrastructure.

Let’s visualize this basic flow:

flowchart TD A[Your Local Codebase] --> B{void deploy command} B --> C[Void Cloud: Upload & Build] C --> D[Void Cloud: Deploy to Runtime] D --> E[Live Application URL] E -->|\1| D
  • A[Your Local Codebase]: This is where you write your application’s files.
  • B{void deploy command}: You initiate the deployment from your terminal using the Void CLI.
  • C[Void Cloud: Upload & Build]: Your code is sent to Void Cloud, where it’s processed and built into a deployable artifact.
  • D[Void Cloud: Deploy to Runtime]: The built application is launched on Void Cloud’s infrastructure.
  • E[Live Application URL]: Void Cloud provides a public URL where your application can be accessed.

Our Runtime Environment: Node.js 24.x

For our “Hello World” example, we’ll use Node.js, a popular JavaScript runtime. Void Cloud offers excellent support for Node.js applications, automatically detecting your package.json file and installing dependencies. As of 2026, Void Cloud primarily supports Node.js LTS versions, with Node.js v24.x.x being the recommended stable version for new projects.

Step-by-Step Implementation: Hello Void Cloud!

It’s time to get our hands dirty and deploy our first application. Follow these baby steps closely!

Step 1: Verify Void CLI Installation and Login

First things first, let’s make sure your Void CLI is ready to go and that you’re logged into your Void Cloud account.

Open your terminal or command prompt and run:

void whoami

What to expect: You should see output similar to this, confirming your logged-in user:

Logged in as: [email protected]

If you’re not logged in or encounter an error, please refer back to Chapter 2 for login instructions or troubleshooting the CLI installation. We’re using void-cli v1.5.0 as of this guide’s publication.

Step 2: Create Your Project Directory

Let’s create a new folder for our “Hello World” project. This keeps things organized.

mkdir my-first-void-app
cd my-first-void-app

Explanation:

  • mkdir my-first-void-app: Creates a new directory named my-first-void-app.
  • cd my-first-void-app: Changes your current directory to the newly created one. All subsequent commands will be run from inside this folder.

Step 3: Initialize Your Void Cloud Project

Now, let’s tell Void Cloud that this folder is going to be a project.

void init

What to expect: The Void CLI will ask you a few questions. For our simple “Hello World” app, you can accept the defaults.

? Project name: (my-first-void-app)
? What framework or language are you using? (Node.js)
? Entry file for your application: (index.js)
? Do you want to generate a void.json file? (Yes)

Just press Enter for each prompt to accept the default values.

Explanation:

  • void init: This command initializes a new Void Cloud project in your current directory.
  • It automatically creates a void.json file, which is the core configuration file for your Void Cloud project. This file tells Void Cloud everything it needs to know about your application.
  • It also suggests Node.js as the framework and index.js as the entry file, which are perfect for our example.

Step 4: Create Your “Hello World” Application Code

We’ll create a super simple Node.js web server that responds with “Hello Void Cloud!”.

Inside your my-first-void-app directory, create a new file named index.js.

First, let’s add the bare minimum to create a server:

// index.js
const http = require('http');

// This line defines the port your server will listen on.
// Void Cloud automatically sets process.env.PORT for your application.
// If not running on Void Cloud, it will default to 3000.
const PORT = process.env.PORT || 3000;

// Create a server
const server = http.createServer((req, res) => {
  // Set the response HTTP header with a status code and content type
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  // Send the response body
  res.end('Hello Void Cloud from Node.js!\n');
});

// Make the server listen on the specified port
server.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

Explanation:

  • const http = require('http');: This line imports Node.js’s built-in http module, which provides functionality for creating HTTP servers and clients.
  • const PORT = process.env.PORT || 3000;: This is a crucial line for cloud deployments. Void Cloud (like many other platforms) dynamically assigns a port to your application. It exposes this port through the PORT environment variable. Our code checks for process.env.PORT first, and if it’s not set (i.e., when running locally), it defaults to 3000.
  • const server = http.createServer((req, res) => { ... });: This creates an HTTP server. The callback function is executed every time a request comes in.
    • res.writeHead(200, { 'Content-Type': 'text/plain' });: We set the HTTP status code to 200 (OK) and tell the browser that we’re sending plain text.
    • res.end('Hello Void Cloud from Node.js!\n');: This sends the actual “Hello Void Cloud!” message and closes the response.
  • server.listen(PORT, () => { ... });: This starts the server, making it listen for incoming connections on the specified PORT. The callback logs a message to the console once the server is successfully running.

Take a peek at the void.json file that void init generated for you. It should look something like this:

// void.json
{
  "name": "my-first-void-app",
  "build": {
    "command": "npm install",
    "output": "build"
  },
  "routes": [
    {
      "src": "/(.*)",
      "dest": "/index.js"
    }
  ],
  "env": {}
}

Explanation:

  • "name": "my-first-void-app": This is the unique name of your project on Void Cloud.
  • "build": { ... }: This section defines how Void Cloud should build your application.
    • "command": "npm install": For a simple Node.js app, if you had a package.json with dependencies, this command would install them. Since we don’t have dependencies yet, it won’t do much but is a good placeholder.
    • "output": "build": This specifies where build artifacts would be located. For our simple Node.js app, this isn’t strictly necessary as Void Cloud directly executes index.js, but it’s a common pattern for frontend frameworks.
  • "routes": [ { "src": "/(.*)", "dest": "/index.js" } ]: This is a powerful routing configuration.
    • "src": "/(.*)": This is a regular expression that matches any incoming request path (/ followed by anything).
    • "dest": "/index.js": This tells Void Cloud to direct all matched requests to our index.js file. This means our Node.js server will handle all incoming web traffic.
  • "env": {}: This object is where you’d define environment variables for your application. We’ll explore this in more detail in a later chapter.

For our current simple app, these defaults are perfectly fine!

Step 6: Deploy to Void Cloud!

This is the moment of truth! From your my-first-void-app directory, run the deploy command:

void deploy

What to expect: The CLI will upload your files, trigger a build, and then deploy your application. You’ll see progress messages in your terminal:

Void Cloud CLI v1.5.0
> Deploying 'my-first-void-app' to Void Cloud...
> Uploading project files (1 file, 0.1KB)
> Build started (Node.js v24.x.x detected)
> Running build command: npm install
> Build completed successfully.
> Deployment complete!
> Your application is live at: https://my-first-void-app-xxxxxx.void.app

Explanation:

  • void deploy: This command initiates the entire deployment process.
  • Void Cloud detects your index.js and void.json files, uploads them, and then executes the build steps (if any).
  • Finally, it provides you with a unique URL (e.g., https://my-first-void-app-xxxxxx.void.app). The xxxxxx will be a unique identifier for your deployment.

Step 7: Access Your Live Application

Copy the URL provided by the void deploy command (e.g., https://my-first-void-app-xxxxxx.void.app) and paste it into your web browser.

What to expect: You should see the glorious message:

Hello Void Cloud from Node.js!

Congratulations! You’ve just deployed your first application to Void Cloud! How cool is that?

Step 8: Making a Change and Redeploying

The real power of cloud platforms like Void Cloud is how quickly you can iterate. Let’s make a small change and see how easy it is to update your live application.

Open your index.js file and change the message:

// index.js (modified)
const http = require('http');

const PORT = process.env.PORT || 3000;

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  // Changed the message here!
  res.end('Hello Void Cloud - I updated my app!\n');
});

server.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

Now, deploy again:

void deploy

What to expect: Void Cloud will detect the changes, perform a new deployment, and provide a new deployment ID. However, your project URL will remain the same.

Refresh your browser window at the same URL you used before. You should now see:

Hello Void Cloud - I updated my app!

This demonstrates Void Cloud’s continuous deployment capabilities. Each void deploy creates a new immutable deployment, but the project’s main URL always points to the latest successful one.

Mini-Challenge: Personalize Your Greeting

Feeling confident? Let’s try a small challenge to solidify your understanding.

Challenge: Modify your index.js file to include your name in the greeting. For example, “Hello Void Cloud from [Your Name]!”

Hint: You’ll only need to edit one line in your index.js file. After making the change, remember to run void deploy again to push your update to the cloud.

What to observe/learn: After deploying and refreshing your browser, you should see your personalized message. This exercise reinforces the quick feedback loop of developing with Void Cloud: edit code, deploy, see changes live.

Common Pitfalls & Troubleshooting

Even with simple apps, sometimes things don’t go exactly as planned. Here are a couple of common issues and how to resolve them:

  1. “Cannot find module ‘http’” or similar Node.js errors during build:

    • Problem: This often means your index.js file has a syntax error or a typo in a module name.
    • Solution: Double-check your index.js code against the example provided. Run node index.js locally first to catch basic syntax errors before deploying.
    • Void Cloud Tip: If a deployment fails, Void Cloud will usually provide a link to the build logs. You can also run void logs <deployment-id> (replace <deployment-id> with the ID from the failed deploy message) to inspect the server output and error messages.
  2. Deployment completes, but the browser shows “Application Error” or a generic error:

    • Problem: Your application deployed successfully, but it crashed shortly after starting or isn’t listening on the correct port.
    • Solution: Ensure your Node.js application is listening on process.env.PORT. If it’s hardcoded to 3000, Void Cloud might not be able to route traffic to it correctly. Our example code const PORT = process.env.PORT || 3000; handles this correctly.
    • Void Cloud Tip: Use void logs for your deployed application to see its runtime output. This will often reveal uncaught exceptions or startup errors.
  3. void.json syntax errors:

    • Problem: If you manually edited void.json, you might have introduced a JSON syntax error (e.g., missing comma, unclosed bracket).
    • Solution: Use a JSON linter or validator (many IDEs have built-in support) to check your void.json file. The void deploy command will usually catch these errors and tell you which line is problematic.

Summary

Phew! You’ve just accomplished a major milestone: deploying your very first application to Void Cloud! Let’s quickly recap what we covered:

  • Project Initialization: You learned how void init creates the foundational void.json file for your project.
  • Simple Node.js Server: You wrote a basic index.js file that serves a “Hello World” message and correctly listens on process.env.PORT.
  • Void Cloud Deployment Workflow: You experienced the seamless process of using void deploy to send your code to the cloud, have it built, and made live.
  • Rapid Iteration: You saw how easy it is to update your deployed application with a simple code change and another void deploy command.
  • Basic Troubleshooting: You’re now aware of common issues and how to use void logs to debug.

This “Hello World” application is just the beginning. In the next chapter, we’ll start exploring more advanced project configurations, environment variables, and how Void Cloud handles static assets for more complex web applications.

Keep up the great work!

References

This page is AI-assisted and reviewed. It references official documentation and recognized resources where relevant.