Deploying a Node.js app to Unubo Cloud

Deploying a Node.js app to Unubo Cloud

Introduction

This guide will show you how to deploy a Node.js application to Unubo Cloud in minutes. Please make sure you have the following:

  • A free Unubo account (Sign up, it's free)
  • A basic understanding of building Node.js apps
  • A GitHub project with your Node.js app

Your app

All apps on Unubo Cloud run on various ports. Use the "PORT" environment variable to allow Unubo to set the port for your app, as seen in the example Express application below.


const express = require('express');
const app = express();
const PORT = process.env.PORT;

app.get('/', (req, res) => res.send('Welcome to Unubo Cloud!'));

app.listen(PORT, () => console.log(`Ready on port`));
            

Create a new app

Go to unubo.app/apps/new to create a new app. The name of the app should only contain lowercase letters, numbers and dashes.

Create a new app

Deployment type

Once you've created your app, choose a deployment type that suits the needs of your app.

Deployment type

Repository

Connect your GitHub account, then choose the repo for your app.

Repository

Build type

For this guide we are deploying a Node.js app, so go ahead and choose Node.js as your build type.

Build type

Deployment settings

Source folder
If your app is in the root of your repo, leave the source folder as "/". If your app is within a subfolder of your repo, then set the source folder to the location of your app (i.e. "/apps/my-node-app").

Commands
Add all the commands needed to run your app (i.e. "npm run build", "npm start").
You do not need to enter the "npm install command, as this is included by default in the Node.js build type."

Deployment settings

Secrets

Secrets are used to provide your app with secure and confidental data, such as database URLs and API keys.

Secrets

Domains

Each app has its own unique URL based on its ID. For example, if your app is called "demo", then the URL for the app will be demo.unubo.app.

Custom domain
In order to use a custom domain for your app follow the two steps provided in the instructions of the "Domains" section.

Domains

Deploy

Hit "Deploy" button to begin the build process.

Deploy

Build progress

Now that your app is building, check its progress in the "Build" section. To see what's going on behind the scenes, select the "Advanced" link in the top right corner.

Build progress
Build progress

Status

The status section provides regular updates on the status of your deployed app.

Status

Logs

View the logs section to view real-time logs of your app.

Logs

Back to Guides