Out Plane LogoOut Plane

Node.js

Step-by-step guide to deploy a Node.js application on Out Plane

This guide walks you through deploying a Node.js application on Out Plane using Git-driven deployment with a Dockerfile.

Prerequisites

  • An Out Plane account
  • A GitHub account
  • Node.js installed on your machine
  • Git installed on your machine

Create the Node.js App

Create a new directory for your project:

mkdir my-node-app
cd my-node-app

Initialize a new Node.js project:

npm init -y

Install Express:

npm install express

Create a file called index.js with the following code:

const express = require('express');
const app = express();

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

app.get('/', (req, res) => {
  res.json({ message: 'Hello from Out Plane' });
});

app.get('/health', (req, res) => {
  res.status(200).send('OK');
});

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

Update package.json to add a start script:

{
  "scripts": {
    "start": "node index.js"
  }
}

Create the Dockerfile

Create a file called Dockerfile in your project root:

FROM node:20-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

EXPOSE 3000

CMD ["npm", "start"]

Create a .dockerignore file to exclude unnecessary files:

node_modules
.git
.env
*.log
.DS_Store

Test Locally

Run the application locally to verify it works:

npm start

Open http://localhost:3000 in your browser. You should see the JSON response.

Push to GitHub

Initialize a Git repository and push to GitHub:

git init
git add .
git commit -m "Initial commit"
git remote add origin [email protected]:YOUR_USERNAME/my-node-app.git
git branch -M main
git push -u origin main

Replace YOUR_USERNAME with your GitHub username.

Deploy on Out Plane

Step 1: Install GitHub App

  1. Go to console.outplane.com
  2. Navigate to Applications from the sidebar
  3. Click Deploy Application
  4. If prompted, click Install GitHub App
  5. Select which repositories Out Plane can access
  6. Click Install and you'll be redirected back to Out Plane

Step 2: Select Repository

  1. Find your repository in the list (use search if needed)
  2. Click to select it
  3. Choose the branch to deploy (default: main)
  4. Set Root Directory to / (or your app's subdirectory)

Step 3: Configure Build

SettingValue
Build MethodSelect Dockerfile
Application NameEnter a unique name (e.g., my-node-app)
Port3000

Step 4: Select Resources

Choose an instance type based on your needs:

InstancevCPURAMRecommended For
op-200.5512 MBDevelopment, testing
op-4611 GBSmall production apps
op-8222 GBMedium traffic
op-9444 GBHigh performance

Step 5: Configure Scaling

  • Min Scale: Set to 1 for always-on, or 0 for scale-to-zero
  • Max Scale: Maximum instances under load (1-10)

Step 6: Environment Variables (Optional)

Click Add Variable to add environment variables:

KeyValue
NODE_ENVproduction

Step 7: Deploy

  1. Review your configuration
  2. Click Create Application
  3. Wait for the build to complete (typically 2-3 minutes)

Step 8: Access Your App

Once the deployment status shows Ready:

  1. Go to the application Overview tab
  2. Find your domain: my-node-app.outplane.app
  3. Click to open your live application

You'll also see an Internal URL for service-to-service communication within Out Plane.

Automatic Deployments

After the initial setup, Out Plane automatically deploys when you push to your configured branch:

git add .
git commit -m "Update feature"
git push origin main

A new deployment will start within seconds.

View Logs

To debug issues or monitor your application:

  1. Go to your application in the console
  2. Click the Logs tab for runtime logs
  3. Click the HTTP Logs tab to see incoming requests

Next Steps

Buildpack alternative: Instead of Dockerfile, you can select Buildpack as the build method. Out Plane will auto-detect Node.js and run npm install and npm start automatically.