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-appInitialize a new Node.js project:
npm init -yInstall Express:
npm install expressCreate 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_StoreTest Locally
Run the application locally to verify it works:
npm startOpen 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 mainReplace YOUR_USERNAME with your GitHub username.
Deploy on Out Plane
Step 1: Install GitHub App
- Go to console.outplane.com
- Navigate to Applications from the sidebar
- Click Deploy Application
- If prompted, click Install GitHub App
- Select which repositories Out Plane can access
- Click Install and you'll be redirected back to Out Plane
Step 2: Select Repository
- Find your repository in the list (use search if needed)
- Click to select it
- Choose the branch to deploy (default:
main) - Set Root Directory to
/(or your app's subdirectory)
Step 3: Configure Build
| Setting | Value |
|---|---|
| Build Method | Select Dockerfile |
| Application Name | Enter a unique name (e.g., my-node-app) |
| Port | 3000 |
Step 4: Select Resources
Choose an instance type based on your needs:
| Instance | vCPU | RAM | Recommended For |
|---|---|---|---|
| op-20 | 0.5 | 512 MB | Development, testing |
| op-46 | 1 | 1 GB | Small production apps |
| op-82 | 2 | 2 GB | Medium traffic |
| op-94 | 4 | 4 GB | High performance |
Step 5: Configure Scaling
- Min Scale: Set to
1for always-on, or0for scale-to-zero - Max Scale: Maximum instances under load (1-10)
Step 6: Environment Variables (Optional)
Click Add Variable to add environment variables:
| Key | Value |
|---|---|
NODE_ENV | production |
Step 7: Deploy
- Review your configuration
- Click Create Application
- Wait for the build to complete (typically 2-3 minutes)
Step 8: Access Your App
Once the deployment status shows Ready:
- Go to the application Overview tab
- Find your domain:
my-node-app.outplane.app - 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 mainA new deployment will start within seconds.
View Logs
To debug issues or monitor your application:
- Go to your application in the console
- Click the Logs tab for runtime logs
- 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.