Back to Blog
Tutorial January 15, 2026 10 min read

How to Deploy a Node.js App from GitHub

This guide walks you through the complete process of deploying your Node.js application on Chajio — from placing your order all the way to going live with a custom domain, the right build pack, and a green success check.

Step 1: Place Your Order and Get Access

Getting started on Chajio is straightforward. Head to our App Hosting plans page, choose the plan that fits your needs, and complete your order. Once payment is confirmed, your order is activated automatically and your App Deployment Panel login credentials are sent to your email.

Use those credentials to log in to your deployment panel. This is where you will manage all your applications, domains, environment variables, and deployments.

Step 2: Connect Your GitHub Account

After logging in, navigate to your account settings and click Connect to GitHub. You will be redirected through GitHub's OAuth flow — grant the panel read access to your repositories. We never write to or store your code.

Once connected, your GitHub account will appear as linked. You can revoke this access at any time from GitHub under Settings > Applications > Authorized OAuth Apps.

Step 3: Create a New Application

In the left sidebar, click Applications, then click Create New App. You will be taken through a short setup form:

Repository

Select the GitHub repository you want to deploy from the dropdown. Choose the branch — typically main or production.

Application Name

Give your app a clear, identifiable name (e.g., my-api-production). This is used as an internal label and appears in your dashboard.

Description

A short description to help you remember what this app does, especially useful when managing multiple applications.

Step 4: Choose Your Build Pack

The Build Pack tells Chajio how to build and run your application. Choosing the right one is important. Here is what each option means:

Default (Auto-detect)

The platform inspects your repository and automatically identifies your language and framework. For Node.js apps, it detects your package.json and handles the build for you. Use this for standard Node.js, Express, Fastify, or NestJS apps where you don't need any custom system-level configuration. It is the simplest option and works for the majority of apps.

Dockerfile

Uses the Dockerfile at the root of your repository to build a container image. This gives you complete control over the build environment — you can install custom system packages, pin exact runtime versions, or run multi-stage builds to keep your image lean. Use this when your app has non-standard dependencies or when you need a specific OS-level setup that auto-detection cannot handle.

Static

Builds your project and serves the resulting static files directly from a CDN — no server process involved. Use this for purely front-end projects: React SPAs, Vue apps, plain HTML/CSS sites, or documentation sites. It is faster, cheaper, and simpler since there is nothing to "keep running." If your app makes API calls to a backend, that backend lives elsewhere; only the front-end lives here.

Docker Compose

Reads your docker-compose.yml and spins up multiple containers as a single unit. Ideal for apps that require companion services running alongside them — for example, a Node.js API paired with a Redis cache or a background worker process. Use this when your application architecture has more than one service that need to start together.

For most Node.js apps, Default is the right choice and the one we recommend starting with. Switch to Dockerfile or Docker Compose only when your setup requires it.

Step 5: Set Your App Port

Enter the port your Node.js app listens on. The default is 3000, which is the standard for most Node.js and Express applications. If your app uses a different port, update this field to match.

Make sure your app reads the port dynamically rather than hardcoding it:

Correct port binding

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

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

Step 6: Add a Custom Domain

Under the Custom Domain section, enter the domain you want to serve your app on (e.g., api.yourbrand.com).

Important — DNS requirement

Your domain must be registered and have a CNAME record pointing to Chajio's network before you add it here. Log in to your domain registrar (e.g., Namecheap, GoDaddy, Cloudflare), and create a CNAME record for your subdomain pointing to the hostname provided in your panel. Once DNS propagates — usually within minutes to an hour — Chajio will automatically provision a free SSL certificate for your domain.

Step 7: Add Environment Variables

If your app needs configuration at runtime — API keys, database URLs, JWT secrets, feature flags — add them in the ENV section as key-value pairs. These are encrypted at rest and injected securely into your app when it starts.

Never commit a .env file to your repository. The ENV panel is the right place for all secrets and environment-specific values.

Step 8: Deploy Your Application

Once everything is filled in, click Deploy Application. The platform will clone your repository, run the build, and start your app. Give it a moment — you will see a real-time build log as it progresses.

When the build completes successfully, you will see a green check mark confirming your app is live. If the build fails, the log will tell you exactly where it went wrong.

Pro tip — build locally before you deploy

Before pushing to Chajio, run your build on your local machine first. Open your terminal and run:

npm install
npm run build

If your build fails locally, it will fail on the server too — the build environment follows the same steps. Catching errors on your machine is faster, cheaper, and gives you a full terminal to debug in. A build that passes locally has a very high chance of succeeding on Chajio. Never deploy code you have not successfully built locally.

Managing Multiple Applications

You can create as many applications as your plan allows. Each app is independent — its own GitHub connection, build pack, domain, and environment variables. This makes it easy to run a production app, a staging environment, and side projects all from the same panel.

To see how many apps your current plan supports, check your plan details in the Account section of your dashboard, or review our App Hosting plans.

Troubleshooting Common Issues

Build fails with "Module not found"

All dependencies must be listed under dependencies in your package.json, not only under devDependencies. Production builds skip dev dependencies.

App crashes immediately after deploy

Check the build log for startup errors. The most common cause is a missing environment variable or binding to a hardcoded port instead of process.env.PORT.

Custom domain not resolving

Confirm that your CNAME record is pointing to Chajio's network hostname and that DNS has fully propagated. Use whatsmydns.net to check propagation across regions before retrying.

Build succeeds but app returns errors in production

This almost always means a missing environment variable. Double-check your ENV section and ensure all keys your app depends on at runtime are present with the correct values.

Ready to deploy your Node.js app?

Place your order and go live in minutes — no complex server configuration needed.

View App Hosting Plans