Deploy Express.js App on Seenode | Express.js Hosting & Deployment Guide
This guide explains how to deploy your existing Express.js application to seenode.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- A seenode account at cloud.seenode.com
- Git configured on your machine
- Existing Express.js project ready to deploy
Configure for seenode Deployment
Section titled “Configure for seenode Deployment”Port Configuration
Section titled “Port Configuration”Your main.js file should create an Express server that listens on a port defined by an environment variable. This allows seenode to correctly route traffic to your application.
const express = require('express');const app = express();const port = process.env.PORT || 80;
app.get('/', (req, res) => { res.send('Hello World\nWelcome to Seenode!');});
app.listen(port, () => { console.log(`Example app listening on port ${port}`);});Package Scripts
Section titled “Package Scripts”Ensure your package.json includes the following scripts:
{ "name": "example-nodejs-express", "version": "1.0.0", "main": "main.js", "scripts": { "start": "node main.js" }, "dependencies": { "express": "^4.18.2" }}Run
npm installpackage-lock.json file.
Deploy on seenode
Section titled “Deploy on seenode”-
Push to Git
Commit your project and push it to GitHub or GitLab.
-
Create a Web Service
From the seenode Dashboard, create a new Web Service and connect your Express.js project’s Git repository.
-
Configure Build & Start
seenode will attempt to detect these automatically. Configure:
- Build Command: npm install
- Start Command: node main.js
- Build Command:
-
Configure Port and Environment Variables
In the Configure Build & Start screen, set the Port field (above Environment Variables) to your desired value (e.g.,
8080). You do not need to add aPORTenvironment variable. Configure any other environment variables your app needs in the Environment section. -
Choose Pricing Tier
Select your preferred instance size and create your service.
-
Deploy
Click Create Web Service and watch logs until your web service is live.
-
Success
Once complete, your Express.js application will be accessible via your service’s URL.
Starting from Scratch?
Section titled “Starting from Scratch?”If you don’t have an Express.js project yet:
Option 1: Use our Template (Recommended)
Express.js Template
Deploy an Express.js project pre-configured for production.Option 2: Create from Express Docs + seenode Setup
Follow the official Express documentation to create a new project, then return here for seenode-specific deployment steps.
seenode-Specific Setup Steps:
- Create
main.jswith Express server - Configure port from environment variable
- Set up package.json with start script
Next Steps
Section titled “Next Steps”Now that your Express.js application is deployed, here are some things you might want to do next:
Set up a Custom Domain (Coming Soon)
Configure a custom domain to point to your new web service.Connect to a Database
Instantly scaffold and connect PostgreSQL and MySQL databases